Apama 10.3 | Apama Documentation | 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 | Template-based XML generation
Template-based XML generation
Use this approach when sending JMS messages that contain XML. You assign a template that will be used to generate an XML document. The template contains placeholders for each of the source event fields whose values will replace the placeholders.
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 appears.
2. In the XML Template file field, enter the name of the template file you want to use or click the browse or down arrow button 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.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.