Event Strategy rule form
|
|
Event strategy provides a design experience based on selecting the patterns you apply. A new instance of the Event strategy rule contains two shapes: Real time data and Emit. You can add shapes by clicking the add icon available when you focus on a shape.
The Event Strategy tab provides the facilities to design and configure your event strategy.
Open the properties dialog of a shape (by double-clicking the shape, or by right-clicking and selecting the Properties option) to edit it. The properties dialog contains elements specific to a given shape. For details, unfold the following sections.
This is the starting shape of every event strategy. The properties which you can view here are defined in the data model of the Apply To class of the event strategy.
The Event key property contains the key to the class with your event strategy. This key is also used in the Window shape for grouping the incoming events.
In the Event timestamp section, you select one option:
Event time - Use this option when every event processed by your event strategy contains a property with time.
Specify the property which contains the timestamp and the date format it uses.
Note: The timestamps of the consecutive events must be in the ascending order, otherwise you get an error.
System time - Use your system time when processing events.
After the Real time data shape, you can add the Window or Filter shape.
Note: You can also add the Static Data shapes to define the alternative data sources. Navigate to the Real time data shape and click the bottom add icon.
You use this shape to filter out events of a given data stream before they enter a Window shape or another Filter shape. You can do this by adding filters and local variables.
Adding filter conditions
Filter properties using the equality, numeric, or string operators on the data flow properties.
Adding local variables
You create variables by calculating sum, difference, product, or quotient of two numeric properties. You can also create a variable by concatenating two strings.
After the Filter shape, you can add the Window, Filter or Aggregate shape.
Note: You can stack Filter shapes in your event strategy to specify the alternative conditions. Navigate to a Filter shape and click the bottom add icon.
You use windows to group relevant events from a data stream. The window size may be defined by the maximum number of events contained or by the maximum time interval to keep events.
In the Window section, select one option:
The Tumbling window processes events by moving the window over data in chunks. After the window buffers a specified number of events or the window time is over, it posts the collected events and moves to another chunk of data. No events are repeated in the next window.
You can specify the number of events or the time interval in the Count for field and dropdown list.
The Sliding window processes events by gradually moving the window over the data in single increments. As the new events come in, the oldest events are evicted.
You can specify the number of events or the time interval in the Look for last field and dropdown list.
You can also select the Use starting conditions for data collection check box and specify a condition or conditions when the window can start.
Adding starting conditions
Specify a condition under which the window starts grouping relevant events from a data stream.
The Window shape use an event key as the default grouping. It means that separate windows are created for the events with different event key values. If you want, you can also specify more properties and create separate windows for them.
After the Window shape, you can add the Window, Filter or Aggregate shape.
This shape allows you to perform calculations on data from the data stream.
Adding aggregators
You need to add aggregators to use the available aggregation functions.
In the Source field, specify a property that is available in the data flow.
Note: This field is not available for the Count function.
In the Aggregate field, name the property which should contain the result of your aggregation function.
Optional: Repeat the steps to add another aggregator.
Click Submit.
After the Aggregate shape, you can add the Window or Filter shape.
This shape allows you to specify the properties you want to use from an alternative data source and associate them with the data stream properties.
Note: When you add the Static Data shape to your event strategy and specify properties, you need to map the properties in the Static Data shape in the data flow.
In the Emit Properties dialog, you can specify when your event strategy should emit events. The following options are available:
Note: To ensure the correct configuration of your event strategy, there are internal shape and canvas validation mechanisms. Error modifier (the red X icon) is displayed on the shapes that are incorrectly configured.