A context begins when the event runtime receives an event that references a particular context ID value for the first time. You can use the system context to track events and actions that are associated with a context ID. For more complex event processing, you can define a context definition to correlate multiple related events and actions during a defined time interval or at a specified date and time.
For example, if the Customer EmailAddress business object field is the context ID and an event is received that contains an EmailAddress field with a value of Jane.Doe@SomeCo.com and this instance is the first that such a value has been encountered, then a context is defined.
The event runtime uses a table in the event runtime to track all context information. The event runtime database table is called the steps table. The steps table can also be referred to as the context table in the information center. Information about the event is added as a row in the table. The time a particular event or action occurs is recorded. In this way, the number of times an event or action occurs or the interval between an event and other events or actions can be tracked.
When handling of an event is time-delayed (a rule), or when an action is time-delayed, the time that the table entry is added to the steps table is different depending on whether it is a rule or an action. For time-delayed rules, an entry is added to the steps table immediately. The table entry is not delayed because of the scheduled time-delay. However, when actions are time-delayed an entry is added to the steps table after the action has fired, which is after the time-delay.
Each event rule associated with the event that evaluates to true fires its associated actions. These actions are also added to the steps table and use the same context ID as events in the context.
Each subsequent event that is part of the context is stored in the steps table. Any actions that run as the result of these events evaluating to true are also added to the context. In this way, the event runtime is able to track a particular process in the context.
A context does not have any inherent order in which events are evaluated. The logic of each event rule determines under what circumstances an event is evaluated and subsequent actions fired. This means that a context starts if any event with new context ID value is detected by the event runtime. One way to force events to behave in a particular order is to have subsequent events in the context use results produced by an action in a previous event.
A context definition is a list of events and an associated context ID that groups multiple events for complex event processing. You can modify the context definition to specify the start and stop conditions for each context instance. See Defining a context.
Contexts can be viewed using the Event Tester widget. See Checking context data.