Template-based XML generation
With the template-based approach to mapping, you can map fields in an Apama event to elements and attributes in complex XML structures. The template consists of a sample XML document with placeholders that will be replaced with values from the Apama event fields. When you assign a template, these variables are displayed in the JMS message tree; you then map event fields to the variables.
To assign a template for mapping:
1. In the adapter editor's Event Mappings tab, right-click the JMS Body entry and select Assign Template. The Assign Template dialog is displayed.
2. In the XML Template file field, enter the name of the template file you want to use or use the Browse and Down Arrow buttons to locate the file.
When you specify a template file, the contents of the file are added to the text field in the dialog.
It is usually best to create the template file from a sample XML document before opening this dialog, but it is also possible to perform this task from the dialog itself, for small XML documents. To create the XML template, you define placeholders to represent field values that you want the adapter to obtain from the input event. To define a placeholder, insert a dollar sign ($) following by the placeholder name. After you click OK, the placeholder appears as a new child of the target's JMS body node.
3. In the source event, click the Apama event field and drag a line to the desired element or attribute in the target JMS message.