Versions Compared

Key

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

...

  • The following query forwards a processed event as an output to the cronTriggerStream event stream every 10 seconds.

    Code Block
    languagesql
    define trigger cronTriggerStream at '*/10 * * * * ?' ;
  • The following query merges the periodicalTriggerStream and sensorStream event streams. Only the values of the attributes specified in the query are merged. Attribute values are taken from the sensorStream event stream and inserted into the  periodicalTriggerStream event stream.

    Code Block
    languagesql
    from periodicalTriggerStream join sensorStream#window.time(10 sec)
    select meta_timestamp, meta_isPowerSaverEnabled, meta_sensorId, meta_sensorName, correlation_longitude, correlation_latitude, triggered_time, humidity, sensorValue
    insert into periodicalTriggeredSensorStream;
  • The following query merges the  cronTriggerStream and sensorStream event streams.  Only the values of the attributes specified in the query are merged. Attribute values are taken from the sensorStream event stream and inserted into the cronTrigerredSensorStream event stream.

    Code Block
    languagesql
    from cronTriggerStream join sensorStream#window.time(10 sec)
    select meta_timestamp, meta_isPowerSaverEnabled, meta_sensorId, meta_sensorName, correlation_longitude, correlation_latitude, triggered_time, humidity, sensorValue
    insert into cronTriggeredSensorStream;

...

  1. Log into the CEP Management Console.
  2. Click on the Tools tab and then click Event Simulator to open the Event Stream Simulator page. A file named events.csv containing sample data is displayed in the Send multiple events section as follows. Click Play to start sending events to the CEP from this file.

    The events triggered in the CEP are logged in your CLI as shown in the extract below.

    • The events that are triggered in the periodicalTriggerStream event stream every 5 seconds have periodical as the unique ID. 
    • The events that are triggered in the cronTriggerStream event stream every 10 seconds have cron as the unique ID.

Image Modified