Versions Compared

Key

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

To view a screencast of the Quick Start Guide, click here.

...

An Execution Plan can import one or more streams from the server for processing and push zero or more output streams back to the server. Refer Processing Events for further explanationsFor more information, see Analyzing Data.

  1. Log into the CEP Management Console and click on the Main tab. Under Manage, click Execution Plans to open the Available Execution Plans page. 
  2. Click Add Execution Plan to open the Create a New Execution Plan page.
  3. Enter information as follows to create the new execution plan

    Parameter NameValue
    Import Streamorg.wso2.event.sensor.stream:1.0.0
    AssensorStream
    Value OffilteredStream
    StreamIdorg.wso2.event.sensor.filtered.stream:1.0.0
  4. Click Import and then click Export. The section for query expressions will be updated as shown below.
  5. Add the following query expression.

    Anchor
    filter
    filter

    Code Block
    from sensorStream [sensorValue > 100]
                    select meta_timestamp, meta_sensorName, correlation_longitude, correlation_latitude, sensorValue
                    insert into filteredStream

    This query includes the value sensorValue > 100. Therefore, when the execution plan forwards events from org.wso2.event.sensor.stream:1.0.0  to org.wso2.event.sensor.filtered.stream:1.0.0, events in which the value for the sensorValue attribute is less than 100 will be dropped.

  6. Click Validate  Query Expressions. Once you get a message to confirm that the queries are valid, click Add Execution Plan.

...

  1. Log into the CEP Management Console and click on the Main tab. Under Manage, click Publishers to open the Available Publishers page.
  2. Click Add Event Publisher to open the Create a New Event Publisher page.
  3. Enter information as follows to create the new event publisher named UIPublisher.

    Parameter NameDescription
    Event Publisher NameuiPublisher
    Event Sourceorg.wso2.event.sensor.filtered.stream:1.0.0
    Output Event Adapter Typeui
    Message Formatwso2event
  4. Click Add Event Publisher to save the information.

Step 9: Create a dashboard and a gadget

WSO2 Analytics Dashboard will be used as the tool to analyse the output of the event flow you created in this guide. This step creates a dashboard and a gadget which analyses events from the  org.wso2.event.sensor.filtered.stream stream published by the uiPublisher publisher.

  1. Log into the CEP Management Console. In the Main tab, click Analytics Dashboard.
  2. Log into the Analytics Dashboard with your username and password.
  3. Click the menu icon and then click Gadgets to open the Gadgets page as demonstrated below.
    Image Modified
  4. Click GENERATE GADGET, and enter values in the Generate a Gadget wizard as follows.Image Modified
    1. In the Select Provider field, select Realtime Data Source. Then click Next.
    2. In the Event Stream field, select org.wso2.event.sensor.filtered.stream:1.0.0. Then click Next.
    3. Configure a chart as follows.

      Parameter NameValue
      Gadget NameSensor Value VS Timestamp
      Select Chart TypeLine Chart
      X-AxisTIMESTAMP
      X typetime
      Y-AxissensorValue
      Y typedefault
      Color domainsensorName
      Max length30
    4. Click Add to Store, and then click Go to Portal. the Dashboards page appears again.
  5. Click CREATE DASHBOARD to open the Create a Dashboard page. Configure a new dashboard as follows.Image Modified
    1. Enter a name and a description for the new dashboard as follows, and click Next.

      Parameter NameValue
      Name of your DashboardSensor Statistics
      DescriptionThis dashboard indicates the sensor value at different times in a particular location.
    2. Select the Single Column layout. A message appears to indicate that the dashboard is successfully created.
    3. Click the  icon for gadgets. Then select and drag Sensor Value VS Timestamp gadget to the first column as demonstrated above.

Step 10: Send Events to the HTTP Receiver via Curl Command

...