Domain-specific execution manager is a new feature in WSO2 CEPDAS. It lets you customize, preconfigured domain-specific execution parameter values in an user friendly dashboard. The dashboard allows you to configure these parameter values through available domain templates.
Generally, you need to edit an execution plan by writing the required Siddhi queries, if you want to monitor a specific event flow or modify a parameter value in WSO2 CEPDAS. However, with this execution manager feature, you can focus on the query combinations by visualizing Siddhi queries with the help of the available template structures. With this feature you can identify a combination of choices to obtain the desired output stream of events.
...
You need to create template configurations specific to your domain in a XML file, and place them in the <CEP<DAS_HOME>/repository/conf/cep/domain-template/
direcotory
direcotory, to use the execution manager and populate the Siddhi Queries. By default, WSO2 CEP DAS contains a sample domain named TemperatureAnalysis
. Following is an example template configuration file specific for this TemperatureAnalysis
domain.
...
Code Block | ||
---|---|---|
| ||
<templateDomain name="TemperatureAnalysis"> <description>Temperature Analysis Description</description> <templates> <template name="Template1Maximum Temperature"> <description>To check averagemaximum room temperature within specified time window of all rooms</description> <executionPlan> <executionPlan><![CDATA[ <![CDATA[ /* Enter a unique ExecutionPlan */ @Plan:name('testPlan') @Plan:name('testPlan') /* Enter a unique description for ExecutionPlan */ -- @Plan:description('ExecutionPlan') /* defineEnter streamsa andunique writedescription query here ...for ExecutionPlan */ @Import('inStream:1.0.0') -- define stream inStream (temperature double, roomNumber int);@Plan:description('ExecutionPlan') /* define streams and write query here ... */ @Import('inStream:1.0.0') define stream inStream (meta_temperature double, meta_roomNumber int); @Export('outStream:1.0.0') define stream outStream (meta_temperature double, meta_roomNumber int); from inStream[meta_temperature > $maxVal] select meta_temperature,meta_roomNumber insert into outStream; ]]></executionPlan> <parameters> <parameter name="maxVal" type="int"> <displayName>Maximum Temperature</displayName> <description>Maximum room temperature threshold</description> <defaultValue>75</defaultValue> </parameter> </parameters> </template> </templates> <streams> <stream> { "streamId": "inStream:1.0.0", "name": "inStream", "version": "1.0.0", "nickName": "", @Export('outStream:1.0.0') "description": "", define stream outStream (temperature double, roomNumber int); "metaData": [ from inStream#window.time($timeInterval) { select avg(temperature) as temperature,roomNumber "name": "temperature", group by roomNumber having temperature>= $maxVal insert into outStream; "type": "DOUBLE" ]]> </executionPlan> }, <parameters> <parameter name="maxVal" type="int"> { <displayName>Maximum Temperature</displayName> "name": "roomNumber", <description>Maximum Temperature which needs to be checked</description> "type": "INT" <defaultValue>75</defaultValue> } </parameter> <parameter name="timeInterval" type="time">], <displayName>Time Interval</displayName> "correlationData": [], <description>Time can be defined such 5 sec, 1 min and etc</description> "payloadData": [] <defaultValue>1 min</defaultValue>} </parameter> </stream> <stream> </parameters> </template> </templates> <streams> { <stream> { "streamId": "inStreamoutStream:1.0.0",, "name": "inStreamoutStream", "version": "1.0.0", "nickNameversion": "1.0.0", "description": "", "metaDatanickName": "", [ { "namedescription": "temperature", "type": "DOUBLE" }, "metaData": [ { "name": "roomNumber", { "type": "INT" } "name": "temperature", ], "correlationData": [], "payloadDatatype": "DOUBLE" [] } </stream> }, <stream> { "streamId": "outStream:1.0.0",{ "name": "outStream", "versionname": "1.0.0roomNumber", "nickName": "", "descriptiontype": "INT", "metaData": [ { } "name": "temperature", "type": "DOUBLE" ], }, { "namecorrelationData": "roomNumber", [], "type": "INT" } "payloadData": [] ], "correlationData": [], } "payloadData": [] } </stream> </streams> </templateDomain> |
...
The execution plan is deployed in a template in WSO2 CEPDAS, once you save a configuration for the first time. You can modify the name specified in the execution plan, and re-deploy it by adding a configuration name. For more information on execution plans, see Creating a Standalone Execution Plan.
...
You can have one or more event streams in a domain template. Define the required event streams within the <streams>
element of the domain template. The input and output event streams that are defined in the template are deployed in WSO2 CEPDAS, once you save a configuration for the first time. For information on defining event streams, see /wiki/spaces/TESB/pages/32604253. An example configuration of event streams is shown below.
...
- Log in to the management console using the following URL: https://<CEP<DAS_HOST>:<CEP<DAS_PORT/carbon/
- Click Main, and then click Execution Manager under the Manage menu. You view the dashboard home page with the available domains as shown below.
- Click on the domain, which you need to configure.
- Click Add Configuration to add a new configuration to the selected domain as shown below.
- Enter a desired Configuration Name, Description, and values for the Parameter Configurations for the template configuration information as shown below.
- Click Add Configuration. You view a pop-up message on successful addition of the configuration as shown below.
- Close the pop-up message. You view the new configuration in the list of tall available configurations of the selected domain as shown below. You can edit or delete it using the corresponding options provided.
An execution plan with the configured parameters gets deployed, once you save the configuration. Follow the steps below to view this new execution plan.
Log in to the management console using the following URL, if you are not already logged in: https://<CEP<DAS_HOST>:<CEP<DAS_PORT/carbon/
Click Main , and then click Execution Plans under the Event Processor menu. You view the new execution plan added to the list of available execution plans as shown below.
Click on the name of the execution plan. The parameters you entered are applied to the execution plan as shown below.
The required event streams defined in the execution plan also gets deployed, o nce you save the configuration. Follow the steps below to view the event streams.
Log in to the management console using the following URL, if you are not already logged in: https://<CEP<DAS_HOST>:<CEP<DAS_PORT/carbon/
Click Main, and then click Execution Streams under the Event Processor menu. You view the deployed event streams in the list of available event streams as shown below.