This document is the API document for the Rule Processing Framework.
Introduction
RPF provides the basic logic and functionality for rule evaluation and infrastructure for sending events etc.

The RPF is not bound to any specific form of data, or any specific form of targets or actions. As such it can be used to do processing on any data using a set of rules, and ask any kind of target to take any kind of action. This will enable programmers to implement all kinds of various features using the RPF.
Examples where RPF can be used:
  1. Exception highlighting in Report rendering.
  2. One can define a context that processes in the ETL process and sends event based on the rules results. The events can be used to send certain Email messages or SMS messages using i.e. the Platform Services publish/subscribe features.
  3. An event can trigger publishing of KPIs to the dashboard in IDP.
  4. Events can trigger stored processes to run.
  5. Stored processes triggered by events in the ETL process can produce data that can later be evaluated in an Exception Highlighting context, making complex rules run fast, as they will run on the server during the ETL process, and the Exeption Highlighting context just evaluate simple rules on the ETL produced data.
  6. Intelligent Agent contexts can be put in place to analyze the activity on viewing certain reports, and then a rule can describe that an event will be send that will have an action of turning the report into a scheduled batch report, optimizing the most active reports for viewing.
  7. And much more
What is RPF?
RPF is a functionality that enables application programmers to define a Context sensitive processing of data.

How does RPF work?
A context is defined by an ordered set of rules that gets evaluated by a context sensitive evaluator. The rule evaluation produces results that are mapped to events. An event has an ordered collection of event targets associated to it. Furthermore an event has an ordered collection of actions associated to it. When the context processes the set of rules, some of the rules produce results that will map to an event. An event will then be sent to the event targets with the actions this target should perform.

A simple example:
In the below sequence diagram you see an example of the RPFUser making use of RPF to evaluate a Rule.
First a Target, an Action and a Rule is created.
Then the Target and Action is assosiated with the Rule.
So a Context is created and the Rule is added to the context.
Then a DataVector is created and the value the rule should be evaluated against is added to it.
Now the RuleEngine is called to evaluate the Context against the DataVector.
In this example the Rule evaluates to true, which triggers that the registered Target is executed with the registered Action.


It is up to the user of the RPF to implement TargetInterface and ActionInterface, the RPF on the other hand provides implementations of RuleInterface, ContextInterface, DataVactorInterface and RuleEngine.