This documentation is for WSO2 CEP 3.0.0. View the home page of the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

You can configure execution plans through the management console as explained below or by manually adding an XML file as explained in step 5.

  1. Start the CEP, log in to its management console, select Execution Plans and click Add Execution Plan.
  2. Enter details in the form that appears and click the Add Execution Plan button at the end of the form.

    The fields in the form are described below:

    • Execution Plan Name : Can contain only alphanumeric characters and '_' character
    • Snapshot time interval : Defines how often the state of the processing engine should be persisted, which is used to restore after a system crash. The default value is 0, which disables this feature. If snapshot is enabled, you must start the CEP with the embedded Cassandra server enabled. To do this, specify -Ddisable.cassandra.server.startup=false option at server startup.
    • Query expressions: See Siddhi Language Specification on how to write queries. When writing query expressions, you must import the required streams from event builders. The As field maps the incoming stream to a stream name suitable for the Siddhi processing engine. It can contain only alphanumeric characters and '_' character.

      In the text field that follows imported streams, you can enter any number of CEP statements, each ending with a semicolon. For example,

      The Exported streams section allows you to expose the output streams from Siddhi to the event formatter with preferred stream IDs. For example,

      For the StreamId, provide a character string that starts with an alphabetic because it is considered as a java variable in Siddhi. Stream Id is a combination of stream name and version. E.g., testStream:1.0.0.
  3. After an execution plan is successfully created, you can change its configuration and redeploy it. To do this, click the Edit link associated with it.
  4. An XML based editor opens allowing you to edit the event builder configuration from the UI itself, without having to edit the file in the file system. Do your modifications and click Update.
    Alternatively, y ou can specify an execution plan configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/executionplans directory, which is the execution plan 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 XML based configurations. Execution plan implementation must start with <executionplan> root element as in the example below:

    <?xml version="1.0" encoding="UTF-8"?>
    <executionPlan name="MediationStatsPassthru" statistics="enable"
      trace="enable" xmlns="http://wso2.org/carbon/eventprocessor">
      <description>A sample passthru query</description>
      <siddhiConfiguration>
        <property name="siddhi.enable.distributed.processing">disabled</property>
        <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
      </siddhiConfiguration>
      <importedStreams>
        <stream as="stats" name="org.wso2.sample.mediation.stats" version="1.0.0"/>
      </importedStreams>
      <queryExpressions><![CDATA[from stats 
    insert into outStream;]]></queryExpressions>
      <exportedStreams>
        <stream name="org.wso2.sample.out.mediation.stats"
          valueOf="outStream" version="1.0.0"/>
      </exportedStreams>
    </executionPlan>                                    

    To enable distributed processing in the CEP, start the server with Hazlecast enabled by setting the following element to true in <PRODUCT_HOME>/repository/conf/axis2/axis2.xml file:

    <clustering class="org.wso2.carbon.core.clustering.hazelcast.HazelcastClusteringAgent" enable="true">
  • No labels