Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Configuring through the Management Console UI

 

1. Log in to the CEP management console and select the Main menu in the left hand side of the screen. Then select the Execution Plans menu item under the Event Processor menu.

Image Removed

 

2.  The Available Execution Plans window opens. Click Add Execution Plan.

Image Removed

 

3. This will open the Create a New Execution Plan form. Fill in the form with valid values. The Execution plan name can 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.

    Execution Plan form can be divided into three main parts. Please go-through the below contents to get more information on this.

    Siddhi Configuration and Execution Plan Info

    Image Added
     Above fields in the form are described below:

    • Execution Plan Name : Can contain only alphanumeric characters and '_' character

...

Image Removed

 

...

    • Description : Description for the execution plan.

    • 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.

 

Image Removed

...

    • Distributed Processing - Can enabled the distributed processing for Siddhi, To enable distributed processing CEP needs to be started with clustering. 

    Query Expressions
    Image Added
    Here, Sidhhi query expressions can written. And also user can create custom event builders if they want to do. 

...

    • . When writing query expressions, you must import the required streams

...

    • . 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.

...


  1. Exported Streams

...

  1. Image Added

...

  1. The Exported streams section allows you to expose the output streams from Siddhi to the

...

  1. event formatter with

...

  1. preferred stream IDs.

Image Removed

...

  1. For the StreamId, provide a character string

...

  1. that starts with an alphabetic

...

  1. because

...

  1. it is considered as a java variable in Siddhi.

...

  1. Stream Id is a combination of stream name and version

...

  1. . E.g., testStream:1.0.0

...

 

Once all mandatory fields are filled, users can add the execution plan. If the execution plan deploys successfully, it will be displayed under the available execution plans section in Event Processor menu.

 

Editing an Execution Plan Configuration through the Management Console

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

Image Removed

Configuring through an XML file

...

  1. .  

    Info
    titleNote

    If 'Event Formatter' is selected as 'Default Event Formatter', a default event formatter will be created automatically when the execution plan is saved. To prevent automatic creation of an execution plan, select 'Custom Event Formatter' from the drop down. To disable it in the xml configuration, you can specify the exported stream similar to following.

      <stream name="org.wso2.sample.out.mediation.stats" valueOf="OutMediationStatsStream" version="1.0.0" passthroughFlow="disable" />
  2. 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.
  3. 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,

    Anchor
    step5
    step5
    y ou can specify an execution plan configuration using an XML file and save it in <PRODUCT_HOME>/repository/deployment/server/executionplans

...

1. Create a xml file, enter the execution plan configuration details.

2. Place the file inside the above mentioned hot deployment directory. Note that Execution plan configurations need to start with "executionplan" root element.

Image Removed

...

  1. 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:

    Code Block
    languagehtml/xml
    <?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">false</property>
        <property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
      </siddhiConfiguration>
      <importedStreams>
        <stream as="InMediationStatsStream"
          name="org.wso2.sample.mediation.stats" version="1.0.0"/>
      </importedStreams>
      <queryExpressions><![CDATA[from InMediationStatsStream
      select meta_host,timestamp,resource_id,direction,fault_count,count
      insert into OutMediationStatsStream;]]></queryExpressions>
      <exportedStreams>
        <stream name="org.wso2.sample.out.mediation.stats"
          valueOf="OutMediationStatsStream" version="1.0.0"/>
      </exportedStreams>
    </executionPlan>                             
    Info

    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">