- Supply may arrive in multiple ways - there is an aggregation function that aggregates all events about arrival of supply.
- When all the supply arrived it is matched against the original order - this is a "pattern matching" - in this case - sequence of two events (order, aggregated supply) with some matching condition
- If does not match - then - there is a "non matching" event reported and then enriched from a database in more details about the order
- The enriched event is then reported to the supplier, and some decision is being taken.
- A decision is taken by "supplier type" - thus there is some filtering and routing based on the type.
- simple event processing: operations on events that do not change the events - just filter and route them.
- mediated event processing: aggregation and enrichment - this is a type of processing that transform the event. In enrichment it is transformed by adding attributes taken from an external store (e.g. database), while in aggregation - multiple events create one event with (in this case - sum of products in the different supplies).
- complex event processing -- detecting pattern - here the pattern is: order occurred and later all supplies arrive - but the quantities don't match. This is very simple pattern, but it is complex event processing, because it deals with complex events.
Some more observations:
- The border between mediated event processing and complex event processing (which both derive new events) is that mediated event processing does not detect a pattern, and does not need to keep the raw events in a state, however, it may be statefull (aggregation is statefull, but not complex event processing - the event that is kept at the end is simple.
- The names may not be very good - since pattern of complex event processing can be quite simple, while filter of simple event processing may be rather complex - however, the "complex" name became pervasive in the industry, and derives the others...
More about the other types of classifications - later