Configuring receiver event mappings
Each event mapping for a received JMS message is configured by specifying the target Apama event type, a conditional expression to determine which source JMS messages should be mapped to this event type, and a set of mapping rules that populate the fields of the target Apama event based on the contents of the source JMS message.
To configure an event mapping
1. Ensure that the Apama event types you wish to use for mapping have been defined in an EPL file in your project.
2. In the Project Explorer, double-click the project's correlator-integrated adapter for JMS instance. This opens the instance configuration in Apama's adapter editor.
3. In the adapter editor, select the Event Mappings tab.
4. On the adapter editor's Event Mappings tab in the Mapping Configuration section, select the Receiver Mapping Configuration tab.
5. Click the Add Event button () to display the Event Type Selection dialog. 6. In the Event Type Selection dialog's Event Type Selection field, enter the name of the event. As you type, event types that match what you enter are shown in the Matching items list.
7. In the Matching items list, select the name of the event type you want to associate with the JMS message. The name of the EPL file that defines the selected event is displayed in the status area at the bottom of the dialog.
8. Click OK.
This updates the display in the adapter editor's
Event Mappings tab to show a hierarchical view of the JMS message on the left (the mapping source) and a hierarchical view of the Apama event on the right (the mapping target). In addition, the
Expression column displays a default JUEL conditional expression that determines which JMS messages will use the specified mapping rules. If you need to use a different conditional expression, you can edit the default. For more information see
Using conditional expressions.
9. Map the JMS message to the Apama event by clicking on the entity in the Message tree and dragging a line to the entity in the Event tree. For example, the simplest mapping for a standard JMS TextMessage would be a single mapping rule from JMS Body in the JMS message to a single string field in the Apama event. More complex mapping involves mapping the value of one or more JMS headers or properties or parsing XML content out of the text message. For more information see
Mapping Apama events and JMS messages. If a receiver mapping configuration lists multiple events, the mapper evaluates the expressions from top to bottom, stopping on the first mapping whose conditional expression evaluates to true. You can use the up and down arrows to change the order in which the evaluations are performed.