Patterns and Practices – Why do we need complex event processing, though you can do it through machine-learning (script-based)?

Complex Event Processing is a software technology that has its origins in the Publish Subscribe message broker. In contrast to the normal P / S idea, it's not about forwarding individual events based on assigned topics. These are complex events that are calculated in an expanding manner. By combining data (here events) from different sources, these have a higher degree of information. A well-known example is a fire alarm in an intelligent building. They detect sensor-based heating by temperature sensors and smoke, which in combination trigger a fire alarm. By focusing on (almost) real-time data processing, it is immediately recognized and information latency minimized.

The remaining problem with CEP is that you must specify what you are looking for. This so-called pattern matching requires the specification of certain rules. As a rule, this is done via a so-called Event Processing Language (SQL-like). To overcome the declarative and time-consuming nature, researchers in this field use machine learning techniques.

BUT: Why do we have to rewrite the transformation step to the CEP rules, if you can even train an ML algorithm and run it as an infinite script?