A computation rule is defined by the computation pattern. It applies a computation (through an expression) to collected events as each event is received within a time interval. It is a stateful rule.
The computation pattern runs a computation function, as defined by the <computeFunction> element in the rule language, against each event that is accepted over a period of time. The time period is indicated by a mandatory time window, as defined by the <timeWindow> element.
With the computation pattern, the rule response runs when the time window is complete, as defined by the <onTimeWindowComplete> element. The value of the computation is available during the <onTimeWindowComplete> action.
Each time an event is received, the total value of the order is added to the total value of all orders that have occurred during the specified time period, and the updated total value of all orders is published within a user interface.