Apama 10.15.0 | Connecting Apama Applications to External Components | Correlator-Integrated Support for the Java Message Service (JMS) | Using the Java Message Service (JMS) | Mapping Apama events and JMS messages | Using convention-based XML mapping with JMS messages | Using convention-based XML mapping when sending/generating messages
 
Using convention-based XML mapping when sending/generating messages
*To map an Apama event to a JMS message using the convention-based approach
1. Create an Apama event type with fields that correspond in type and order to the structure of the XML document. To use convention-based XML mapping, the event type representing the XML document must be nested inside a parent event type, so ensure that such a parent event type has been created. Typically, the parent event type might have two fields, a string field representing the JMS destination, and an event field representing the root of the XML document.
2. In the adapter editor's Event Mappings tab, click the Add Event button (Plus icon) to add a mapping for the desired parent event type (that is, the event type that contains the event field that represents the XML root element).
3. In the adapter editor's Event Mappings tab, right-click the Apama event that represents the root node of the XML document and select Add Computed Node to display the Add Computed Node dialog.
4. In the Add Computed Node dialog's Select Method field, select Convert to XML from the drop-down list. The dialog is updated to show more information.
You can specify a namespace and namespace prefix for the generated XML document if desired, or else leave them blank. By default, the Include empty fields option is enabled. This specifies that empty XML nodes will be generated when empty EPL string fields are encountered within an Apama event. This option does not affect empty strings within a sequence of EPL strings. If you clear the check box to disable the option, empty XML nodes will not be generated.
5. Click OK.
In the mapping tree, an entry of type Convert To XML is added to the selected event node.
6. Drag a mapping line from the Convert To XML entry to the desired node in the XML message, for example, to JMS Body.