Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

2. The Create a New Event Formatter window opens, using which you can configure new event formatters. Enter the following details in the form to create a Map based event formatter as shown in the screenshot below.

Image RemovedImage Added

Here, there are several properties that need to be filled when creating a event formatter. User interface is divided in to 3 main components (From, Mapping and To) except the event formatter name to give more understanding to the user.

  • Event Formatter Name - Property that used to uniquely identify a event formatter configuration.
  • Event Stream - Can select a event stream (Stream name with version) where you going to listen for events, It is numbered as "1".
  • Stream Attributes - Based on the event stream selected, It shows what are the attributes available at that stream. (It is only for reference when creating output mapping)
  • Output Transport Adaptor Name - Transport adaptor which you going to use to publish the events from CEP. (Output Transport Adaptors which are created are listed here). It is numbered as "2". Based on the Transport Adaptor that selected sections "3", "4" and "5" will change accordingly.
  • Output Mapping Type - This property can be change based on the transport adaptor selected. Some transport adaptors can support for multiple types of mappings. User can select the required mapping type from the list. Is is numbered as "3".
  • Stream Definition Destination - Since, you have selected WSO2Event JMS type transport adaptor "wso2EventSenderjmsTransportAdaptor"; you need a stream Destination to send events from CEP. 
  • Stream Version - Version of the event stream.
WSO2Event Mapping

...


Map Mapping

Map event is simply as map object, that means a <key,value> pair. Here "Name" is used as a key in the event and actual value is used as value attribute.

  • Name - The attribute name to which the event data will be mapped when creating the output WSO2Event
  • Value Of - The attribute/property name from which the data element to be mappedType - Type of the element that is being mapped. This can be either of java.lang.String, java.lang.Integer, java.lang.Long, or java.lang.Double.

3. After adding details click the Add Event Formatter button. The Available Event Formatter page will open. To view event formatter configurations, click on the event formatter name. To delete event formatter, click the Delete button.

Image RemovedImage Added


Editing Event Formatter Configuration through the Management Console

By Clicking the Edit button of the relevant event formatter, you will able to edit the event formatter configuration and redeploy it. When you click the Edit button, it will redirect to a xml based editor window which allow you to edit the event formatter configuration from UI without opening the configuration file in the file system.

Image RemovedImage Added

Configuring through a xml File

...

1. Create a xml file and enter the following WSO2Event Map mapping event formatter configurations inside the above mentioned hot deployment directory. Event formatter implementation needs to be start with "eventformatter" root element.

Code Block
languagehtml/xml
<eventFormatter name="StatisticsFormatter" xmlns="http://wso2.org/carbon/eventformatter">
  <from streamName="statisticsStream" version="1.0.0"/>
  <mapping type="wso2eventmap">
   
<metaData>       <property>
        <from name="ipAddress"/>

       <to name="ipAdd" type="string"ipAddress"/>
      </property>
    </metaData>
    <payloadData>
      <property>
        <from name="user"/>
 
      <to name="username" type="string"/>
      </property>
 
  </payloadData>
  </mapping>
  <to transportAdaptorName="wso2EventSenderjmsTransportAdaptor" transportAdaptorType="wso2eventjms">
    <property name="stream">statisticsOutStream</property>
    <property name="version">1.0.0<transport.jms.Destination">statisticInfo</property>
  </to>
</eventFormatter>