Manually mapping configurations for EDA events
In most cases, you can use Apama Studio to automatically map EPL events and JMS messages that consume and publish EDA events. However, in the following situations, you might find that you need to manually configure these mappings:
You already defined EPL event types that you want to use with EDA.
Automatic convention-based mapping provided by Apama Studio is not sufficient.
A correlator-integrated messaging adapter for JMS supports various approaches for manually mapping EPL events and JMS messages. See
Mapping Apama events and JMS messages.
The following steps are required to manually map Apama events and JMS messages that consume and publish EDA events.
1. Create Apama event type definitions to hold the EDA payload data.
2. Configure mappings for sending JMS messages that publish EDA events. Do the following in the correlator-integrated messaging for JMS adapter editor Event Mappings tab, with the Sender Mapping Configuration tab selected:
a. Pick the Apama event that is the placeholder event for the EDA event type in Apama to do all the associations.
b. Map all standard EDA headers with proper EDA header names to JMS properties.
c. Map the destination information either as a constant or from some Apama field value.
d. Create EDA XML from the selected Apama event and map the XML to JMS Body.
As discussed in
Mapping Apama events and JMS messages, there are a number of ways to create EDA XML. You can use any approaches or any combination of approaches described in that section. For example, you can use template-based mapping with convention-based mapping. Some part of the template can be generated by using convention-based mapping, some part can be hardcoded, and some part can be directly mapped from simple type EPL fields.
3. Configure mappings for receiving JMS messages that consume EDA events. Do the following in the correlator-integrated messaging for JMS adapter editor Event Mappings tab, with the Receiver Mapping Configuration tab selected:
a. Pick the Apama event that is the placeholder event for the EDA event type in Apama to do all the associations.
b. In the Expression column, update the expression to invoke the mapping for a specific JMS message. Usually, the expression should match the $Event$Type JMS property to the name of the expected EDA event.
c. Map standard EDA headers from JMS properties. You can either map all JMS properties to a dictionary or map a specific JMS property to an Apama event field.
d. Map JMS Body to the Apama event.
As discussed in
Mapping Apama events and JMS messages, there are a number of ways to create Apama events from EDA XML. Also, multiple approaches can be combined. For example, you can apply XPATH to the payload XML to obtain just the XML that can be converted into an Apama event by using convention-based mapping. Alternatively, you can apply XSLT to transform the payload XML and then use convention-based mapping to generate Apama events.