WSO2Event Event Builder converts events/streams from an input adaptor that supports WSO2-Events into an event stream that is compatible with the event processor. WSO2-Event has three data types (meta, correlation and payload), which can be mapped to the CEP backend runtime event attributes by specifying the mapping in the event builder.
You can configure through the management console as explained below or by manually adding an XML file as explained in step 5.
WSO2Event
mapping type. This property changes based on the event adaptor selected. It lists
only the mapping types supported by a particular event adaptor.
Click Add to add the individual attribute mapping to the event builder
For the correct properties to show, you must selected a input event adaptor that supports WSO2Event mapping type.
Alternatively, you can specify an event builder configuration using an XML file and save
it in <PRODUCT_HOME>/repository/deployment/server/eventbuilders
directory, which is the event builder deployment directory. Since hot deployment is
enabled, you can simply add/remove files to deploy/undeploy from the server.
Create
the XML file with the following WSO2Event based event builder configurations. Event
builder implementation must start with <eventbuilder>
root element and
the namespace set to http://wso2.org/carbon/eventbuilder
as in the example below.
<eventBuilder name="SearchStatBuilder" xmlns="http://wso2.org/carbon/eventbuilder"> <from eventAdaptorName="localEventReceiver" eventAdaptorType="wso2event"> <property name="stream">access_Analytics</property> <property name="version">1.0.0</property> </from> <mapping type="wso2event"> <property> <from dataType="meta" name="ipAdd"/> <to name="ipAddress" type="string"/> </property> <property> <from dataType="payload" name="username"/> <to name="username" type="string"/> </property> <property> <from dataType="payload" name="keywords"/> <to name="searchTerms" type="string"/> </property> </mapping> <to streamName="searchStatistics" version="1.0.0"> </eventBuilder>
Here if custom mapping disabled, then it is considered as a pass-through event builder which allows to send all the events without pre-configured mapping. But this feature is only implemented for wso2Event builder. (you cannot configure execution plan for pass-through event builder in UI level, you have to create it in the back-end, because CEP don't about the stream definition until first event comes to CEP. Then you can configure the execution plan and event formatter in back-end and deploy it.
For more details on creating different types of event builders, Please refer the official documentation Here.