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. In order 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 ()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.
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.
6. In the mapping tree, Apama Studio adds an entry of type Convert To XML to the selected event node.
7. Drag a mapping line from the Conver To XML entry to the desired node in the XML message, for example, to the JMS Body.