Defining stateful event processing
When you use stateful processing, an event that is received can influence how Business Automation Insights processes future events. This allows you to handle a sequence of related events and create summaries from them, for example you can calculate totals or durations.
You can also use multiple Processing Applications to track the progress of a non-automated workflow from events generated by different tools. Similarly, you can identify cases of high business importance, for example promotions, and correlate these with major decisions, for example pay raise calculation.
To better understand how custom events are processed, see the following figure.

In stateful event processing, correlated events are filtered and classified into sets, for
example contexts, based on the correlationPath property. Event processing
operations can be applied to each respective context independently. The results of these operations
can be stored until the processing of the next correlated event, and can then be passed to
egresses.
The correlationPath is a JSLT expression that represents the common identifier
to use to correlate events together.
There are two supported types of context operations: duration, and custom.