ObjectID Mapping
- Last UpdatedAug 26, 2024
- 2 minute read
Object ID Mapping, also known as Identification, determines the ID assigned to an object in the output. Each mapping entry in the configuration is examined in turn and the first matching entry is used to generate the object’s ObjectID.
The simplest form of ObjectID map entry to derive ObjectID for an object is shown below:
<Object>
...
<Conditions>
<Attribute name="object_class" pattern="Door" />
</Conditions>
<ObjectID value="[GlobalId]">
</ObjectID>
...
</Object>
Note: Conditions may hold multiple attribute elements. All conditions must be met for the mapping to be applied.
Lookups may be used to obtain the objectID from an external data source.
<Object>
...
<Conditions>
<Attribute name="object_class" pattern="Door" />
<Attribute name="Name" pattern="Door 100X40" />
</Conditions>
<ObjectID value="[GlobalId]">
<Lookup id="ExcelLookup" >
<FailAction action = "DiscardObject" />
</Lookup>
</ObjectID>
...
</Object>
In this case, the value of the GlobalId attribute is used as a key to look up a value for the ObjectID. If no match is found, value is derived from its fail action.
You can use Transforms to modify the value of an attribute, as shown below:
<Object>
...
<Conditions>
<Attribute name="object_class" pattern="Door" />
</Conditions>
<ObjectID value="[GlobalId]_[object_name]">
<Transforms>
<Keep pattern="pump-\d{2}[A-Z]" />
<InsertAfter pattern="^.*$" value="InsertAfter" />
<InsertBefore pattern="^.*$" value="InsertBefore " />
</Transforms>
</ObjectID>
...
</Object>
For example, if the ObjectID value is "3$pEhtFpv31QFndkpGikoC_this pump-01A is new", the final tag will be "InsertBeforepump-01AInsertAfter".
You can also use attributes from associated objects to modify the value of ObjectID as shown below:
<Object>
...
<IncludeAssociatedObjectAttributes>
<AssociationType pattern="^FillsVoids$" />
<Conditions>
<Attribute name = "ClassName" pattern = "^OPENINGELEMENT" />
<Attribute name = "Name" pattern = "^element1$" />
</Conditions>
</IncludeAssociatedObjectAttributes>
< ObjectID value="[GlobalId]_[associated:GlobalId]" />
...
</Object>
In this case above, the value of the GlobalId attribute along with the value of GlobalId of the first associated object matching the condition is used in deriving ObjectID.
Note: The prefix "associated:" is used when referring to the associated object's attribute.
If an object is not associated with an ObjectID, it is not included in the output. This provides a means of filtering out unwanted objects. To avoid this, an entry should be created at the bottom of the mapping file that matches any object. For example:
<Object>
<ObjectID value="[GlobalId]"/>
</Object>
Note: The log files indicate a warning message whenever multiple objects in the EIWM have a common Object ID value. You can then decide if these objects must be unique, so that you must modify the relevant value in the source system or choose to use another method to determine the Object IDs.
The following example shows the warning message in the log file:
Object with [ObjectID]-[ClassID]-[Context]: "<ObjectID value>-<ClassID value>-<Context value>" is duplicated. Please revisit the mapping configuration.