Use
Context objects are only relevant if you want communication to take place by using the Integration Server (A2A, B2B or Web-service oriented). A good alternative to XPath expressions, context objects enable you to access the content of messages during configuration in the Integration Directory. Take the following message instance as an example:
<InvoiceOut>
<customerData>
<address>
<name> ...
</name>
<postalCode>
...</postalCode>
...
</address>
...
</customerData>
</InvoiceOut>
To access the content of the <postalCode> field, you would use the following expression in XPath:
/InvoiceOut/customerData/address/postalCode
If you needed this expression in more than one condition, you would have to rewrite or copy it each time. Instead, you can assign a context object to the <postalCode> field, for example with the name postalCode. You can then use the postalCode context object in all conditions where you need the value of the <postalCode> field, which makes the conditions easier to read.
Comparison between XPath and Context Object
XPath |
Context Object |
/InvoiceOut/customerData/address/postalCode = “69120” |
postalCode = “69120” |
Context objects encapsulate the XPath expression that you would otherwise use to access the field content.
Once you have created a context object in the ES Repository and assigned a request message to the field, you can use it in the following situations:
· During receiver determination for a message, depending on its content
· During the processing of process steps in integration processes, depending on the content of a message
There is a series of predefined technical context objects for accessing the header information of the message.
A context object is scalar and has a reference type. This means that you cannot assign context objects to structure fields. The reference type determines which type of values you will use later to compare the context object:
Context Object Data Types
Reference Type |
Comparison Type |
xsd:string |
Lexicographical |
xsd:integer |
Numerical |
xsd:date |
Compare by date |
xsd:time |
Compare by time |