The mapping rule for context data elements in a CBE could cause them to have the same attribute name in the Enterprise Console event, which is not allowed by the event server. The mapping mechanism eliminates that possibility by adding the "ctx." prefix to the attribute names created from the context data elements in the CBE event.
Collisions with the name of another context data element that has already been mapped into the Enterprise Console event will cause the repeating context data elements to be discarded.
As an example, consider a CBE event with the following context data elements
<CommonBaseEvent ...> <contextDataElements name="repeat_count" type="String"> <contextValue>contextValue</contextValue> </contextDataElements> <contextDataElements name="my_Context" type="String"> <contextValue>contextValue</contextValue> </contextDataElements> <contextDataElements name="my_Context" type="other_type"> <contextId>http://www.ibm.com</contextId> </contextDataElements> <contextDataElements name="my:Context" type="other_type"> <contextId>http://www.ibm.com</contextId> </contextDataElements> ... </CommonBaseEvent>
The resulting attributes, and corresponding values, in the Enterprise Console event would be:
ctx.repeat_count=contextValue ctx.repeat_count.type=String ctx.my_Context=contextValue ctx.my_Context.type=String
The first element "repeat_count" has the same name as an attribute in the Enterprise Console EVENT class, but the addition of the ctx prefix prevents the name collision.
The second context data element named "my_Context" is not mapped because it would cause a duplicate attribute name in the resulting Enterprise Console event.
The third context data element named "my:Context" is not mapped because the ":" character is not a valid character in an attribute name for a Enterprise Console event and had to be replaced with an "_" (underscore) character before it can be mapped to an attribute in the Enterprise Console event. Since the resulting name "my_Context" has already being used, the context data element is discarded.
Extended data elements are mapped before context data elements. In that sense, conflicting names between the converted name of an extended data element and the converted name of a context data element will cause the context data element to be discarded.
As an example, consider a CBE event with the following context data elements
<CommonBaseEvent ...> <extendedDataElements name="ctx.my_Context" type="string"> <values>my value</values> </extendedDataElements> <contextDataElements name="my_Context" type="other_type"> <contextId>http://www.ibm.com</contextId> </contextDataElements> ... </CommonBaseEvent>
The resulting attributes, and corresponding values, in the Enterprise Console event would be:
ctx.my_Context='my value'
The context data element named "my_Context" is not mapped because it would cause a duplicate attribute name in the resulting Enterprise Console event. Note that when there is a name collision for a context data element, the associate ctx.ContextDataElement.name.type is not created as well.
Mapping context data elements in the Common Base Event format to Enterprise Console event format