Event Strategy rule form - Completing the Event Strategy tab
You use the Event Strategy tab to design and configure your event strategy components. 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 that is available when you focus on a shape. To edit a shape, open the properties dialog box of a shape (by double-clicking the shape or by right-clicking and selecting the Properties option). The properties dialog box contains elements that are specific to a given shape.
Real-time data
This is the starting shape of every event strategy. The Event key property identifies the class with your event strategy and it is used in the Window shape for grouping incoming events. You can use any property from the inheritance path of the event strategy as the event key or as a property that is available to the event strategy in the Available fields section.
-
System time - Use your system time when processing events.
-
Event time - Use this option when every event processed by your event strategy contains a property with time. Specify the property that contains the time stamp and the date format that it uses.
Note: The time stamps of consecutive events must be in ascending order.
Emit
- As it happens - Emit the event as it happens.
- Only once - Emit the event as it happens, but only once during the specified time interval.
Split
Split and Join
The Split and Join dual shape, like the Split shape, allows for dividing the data stream into multiple paths to detect meaningful patterns in customer behavior through a simultaneous analysis of multiple streams in a single event strategy rule instance. However, with the Join shape, you can combine the data before it is emitted from the event strategy. The joining of events from multiple streams in the event strategy is done on the basis of the specified join condition logic.
Filter
Window
You can use windows to group relevant events from a data stream. You can define the window by the maximum number of events contained or by the maximum time interval to keep events.
- Tumbling
-
The Tumbling window processes events by moving the window over the data in chunks. After the window buffers a specified number of events or the window time has elapsed, it posts the collected events and moves to another chunk of data. No events are repeated in the next window.
You can manually specify the window size for all groups by selecting the User defined option for the window size. Alternatively, you can select the Defined by field to cause the event strategy to automatically define the window size for a group's new window from a specific property on the incoming event at run-time by using a specific property value of the incoming records. You can select any property from the event strategy inheritance path for dynamic window setting.
When the Defined by field option is selected and a new event for a group arrives at the window shape, a new window starts for that group if one does not already exist, with a size that is based on the value of the property specified in Defined by field parameter on the event. While active, the window collects events that apply to the corresponding record group. Upon the window time-out, the events are emitted and the window expires. When configured for dynamic window size, the window does not continue tumbling after expiring. For more information, see Dynamic window size behavior.
Note: When you run a batch or real-time data flow that contains an event strategy with Tumbling windows, in the Event strategy section of the Data Flow Work Item window, you can control whether a tumbling window emits remaining events after the data flow stops. If you disable this option, events that are not emitted from tumbling windows before the data flow stop are deleted. - Sliding
-
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 removed.
You can specify the number of events or the time interval in the Look for last field and drop-down list.
- Landmark
- The landmark window stores all events from the start of the data flow. Follow this window type with an Aggregate shape to calculate such values as median or standard deviation for specific property values of all events that the window captured.
The Window shape uses an event key as the default grouping. Separate windows are created for events with different event key values. If you want, you can also specify more properties and create separate windows for them.
Aggregate
This shape allows you to perform calculations on data from the data stream. Add aggregations and select calculation types to perform.
Lookup
For the Lookup shape, you can specify the properties from an alternative data source and associate them with the data stream properties. You can add this shape in an event strategy anywhere between the Real-time data and Emit shapes.