Skip to end of metadata
Go to start of metadata

When an event is raised, it touches off a series of rule set evaluations. The Kinetic Rule Engine (KRE) is responsible for determining what rule sets need to be evaluated for a given event. I say "evaluated" rather than "executed" because an event may not result in any rules being executed unless they are selected based on their eventex and the past pattern of event

Every rule that has a matching eventex will be added to the execution schedule. KRE guarantees that rules in a given rule set will be scheduled in order, but does not give any guarantees about the execution order of rule sets themselves.

The current version of the Kinetc Event API guarantees sequential execution of rules in a given rule set. Future versions may provide other mechanisms for rule ordering and conflict resolution. Managing and envisioning rule ordering in a rule language is complex. KEA mitigates this by defaulting to what programmers are used to, static ordering, in an effort to make transitioning from other programming languages easier. As Kinetic applications become more complicated, this strategy will likely not suffice.

After the schedule has been created, KRE executes it. Execution results in the creation of one or more directive documents. Note that it possible to have an execution cycle that does not take any action if all the scheduled rules simply produce effects and have no actions. A directive document is still produced in that case, but the list of directives is empty.

Because rules can raise events, one event can result in a rule executing that causes another event. Rules can raise events directly in the rule postlude. In that case, for efficiency reasons, the event is examined and the schedule updated during the same execution cycle. All the directives in this case will have the same transaction ID.

Rules can also raise new events by directing the endpoint to do so. When this happens, the endpoint raises the event afresh and KRE treats it as independent, creating a new schedule. The new schedule will create a separate directive document with a new transaction ID. 

Labels: