Extending the plug-in

You can extend the plug-in for rule engine events to receive information from the rule engines.

About this task

Using the EventPlugin class, developers can receive detailed events from the rule engines that are managed by Rule Execution Server. These events contain information about rule processing, such as which rules are executed, what decisions or actions are taken, and which object initiated the execution of the rule.

The class supports both the classic rule engine and the decision engine.

Events that take place in rule engines are instances of EngineEvent. To receive rule engine events, you must extend this class and implement its methods.

Procedure

Use the following sample to write your own code.
public class MyPlugin extends EventPlugin {

protected static StringWriter output = new StringWriter();

protected static String NEWLINE = System.getProperty("line.separator");

@Override
public void taskCompleted(TaskEvent evt) {
...
}
@Override
public void taskStarted(TaskEvent evt) {
...
}
@Override
public void ruleExecutionCompleted(RuleEvent evt) {
...;

}
@Override

public void ruleExecutionStarted(RuleEvent evt) {
...
	}
}

Results

Rule engine events can be notified to more than one plug-in for each XU instance.