Event Strategy components
Event strategies provide the mechanism to simplify complex event processing operations. Event strategies are triggered within Data Flows through the Event Strategy component.
All Event Strategies start with a Real-time data component and end with the Emit component. Between the start and end, you apply a sequence of operations such as windows, filters, and aggregations to identify the patterns and act upon them.
Real-time data
The starting point of every event strategy is the Real-time data component. The properties listed in the component represent the fields that are available for processing. The Event Key is used for grouping the incoming events in the subsequent components.
When defining the Real-time data component, a time for the event occurrence must be set. In the Event timestamp section, you can select the source of the time property of the incoming events: System time, or Event time, and assign one of the available fields.
Window
The Window component in an event stream is used to group relevant events from a data stream. If you want to segment your data into distinct, non-overlapping time intervals where each event belongs to exactly one window, you should use a Tumbling Window. You can also define the segment as a specified number of events.
Tumbling windows are useful when you want to get a clear picture of what happened during distinct intervals of time. For example, if you want to count the number of calls to the customer service center in a calendar month and make a decision afterwards, you use a Tumbling window. The Event strategy continues to accumulate and process the events within the defined window. When an event with a timestamp ahead of the time defined in the Tumbling window arrives, the results are emitted, and the next window begins. The data in the past window is lost, and all calculations begin from the beginning for the next window. Alternatively, you can use the number of events received to define the window size.
You select the Start the window conditionally checkbox when you want the window size to be dynamically defined by a specific property value of the incoming event at run-time.
This is useful in scenarios where the window size needs to adapt based on the characteristics of the incoming data. For example, when you want to group all events that occur during a call between a customer and a CSR. In this case, the window size is determined by the duration of the call.
A Sliding Window is useful when you want to continuously track a metric over time.
The Sliding window processes the events by gradually moving the window over the data in increments. As the new events come in, the oldest ones are removed.
For example, if you want to count dropped calls in the last 5 days and take an action when a threshold value is reached, you use a Sliding Window.
You can also define a Landmark Window that stores all events from the start of the data flow.
The following figure shows a simple example of how the counts of events are calculated depending on the defined window type:
Filter
The Filter component is utilized to selectively remove events from a specific data stream based on specific property values or static data associated with a particular event, before they proceed to another stage.
Events can be filtered based on event properties, static data linked to a specific event, or an aggregated value. Only events that meet the specified conditions will proceed to the next component.
The conditions within a filter component are always connected using the and operator.
To add more filters, click the Add filter button, where each filter component is connected using the or operator. It is also possible to define local variables in the Local variables section that do not exist within the data model and then use these variables as filter conditions.
Split
The Split component in the Event Strategy allows for dividing the data stream into multiple parallel paths, which helps in applying different logic to the sub-streams.
The connector that radiates from the Split component shape always leads to the Emit shape. This means that the events from individual paths are not combined before being emitted.
Split and Join
The Split and Join component allows the output of the parallel path to join back to the original path when given a specific condition.
Aggregate
The aggregate component enables you to make calculations on the stream of data.
The calculations are stored in the variables defined in the Aggregate column. The variables can then be used in the components downstream of the Aggregate component.
Lookup
In an event strategy, the Lookup component allows you to specify properties from an alternative data source and associate them with the data stream properties.
When you add the Lookup shape to your event strategy and specify the settings for invoking data from an alternative Data Set, a Static Data shape is automatically added to the Data Flow that references the event strategy rule with a Lookup shape.
In the Lookup component in the Data Flow , select the Data Set that contains the data that you want to use in the stream, and then map the properties from that data set to the data flow properties.
Emit
The Emit component is the end point of the event strategy.
The events that occur in the event strategy can be emitted as they occur or once in a given time frame. Once the event is emitted, the data continues through processing in the Data Flow, where the event strategy is used.
This Topic is available in the following Modules:
Want to help us improve this content?