Context Mapping
- Last UpdatedMay 12, 2025
- 2 minute read
Context Mapping determines the ID of the context within which an Object ID resides.
Each mapping entry in the configuration is examined in sequence and the first mapping entry to match is used to generate the object’s context ID.
The simplest form of ContextID map entry to derive Context for an object is shown below:
<Object>
...
<Conditions>
<Attribute name="object_context" pattern="ROOT" />
</Conditions>
<ContextID value="[object_context]" />
...
</Object>
Specify multiple levels of context using the ‘|’ character to separate levels:
<Object>
...
<Conditions>
<Attribute name="object_context" pattern="ROOT" />
<Attribute name="object_subcontext" pattern="PARENT" />
<Attribute name="object_Childcontext" pattern="CHILD" />
</Conditions>
<ContextID value="ROOT|PARENT|CHILD">
</ContextID>
...
</Object>
<Object>
...
<Conditions>
<Attribute name="object_context" pattern="ROOT" />
<Attribute name="object_subcontext" pattern="PARENT" />
<Attribute name="object_Childcontext" pattern="CHILD" />
</Conditions>
<ContextID value="[object_context]|[object_subcontext]|[object_Childcontext]">
</ContextID>
...
</Object>
Note: Conditions may hold multiple attribute elements. All conditions must be met for the mapping to be applied.
To modify context value, use Lookups and transforms.
<Object>
...
<Conditions>
<Attribute name="object_context" pattern="ROOT" />
</Conditions>
<ContextID value="[object_context]">
<Transforms>
<Replace pattern="\d{2}" value="yyy" />
</Transforms>
</ContextID>
...
</Object>
<Object>
...
<Conditions>
<Attribute name="object_context" pattern="ROOT" />
</Conditions>
<ContextID value="[object_context]">
<Lookup id="csv Map" >
<FailAction action = "EmptyValue" />
</Lookup>
</ContextID>
...
</Object>
Use objects from associated objects to modify the value of ContextID, as shown below:
<Object>
...
<IncludeAssociatedObjectAttributes type = "^FillsVoids$" refID = "[ClassName]" >
<Conditions>
<Attribute name = "ClassName" pattern = "^OPENINGELEMENT" />
<Attribute name = "Name" pattern = "^element1$" />
</Conditions>
</IncludeAssociatedObjectAttributes>
<ContextID value="[ClassName]_[associated:ClassName]" />
...
</Object>
In this case, the value of the ClassName attribute along with the value of ClassName of the first associated object matching the condition is used in deriving ContextID. The prefix "associated:" is used when referring to the associated object's attribute.
If an object does not match any of the mapping entries, it is not assigned any context. To set a default context that is used if none of the other mapping entries match, an entry with no qualifiers should be created at the bottom of the mapping file:
<Object>
...
<ContextID value="AVNGATE" />
...
</Object>