Execution patterns

Rule Execution Server supports synchronous execution patterns and asynchronous messaging through the Java™ Message Service (JMS) API.

Synchronous execution patterns include stateless and stateful rule sessions. If you use a message listener, you can set up asynchronous messaging.

Rule Execution Server supports the following execution patterns:
  • Local access outside a Java EE container: Use Java SE rule sessions and package the <InstallDir>/executionserver/lib/jrules-res-execution.jar file inside your application.
  • Local access, with or without transaction control: Use Plain Old Java Objects (POJO).

    A client module must embed the execution components that are used to reference the XU: <InstallDir>/executionserver/lib/jrules-res-session-java.jar

Synchronous execution patterns

Synchronous patterns of execution behave differently in stateless rule sessions and stateful rule sessions. See Rule sessions for details.

Stateless rule sessions

With stateless rule sessions, you can set input (in) parameters and get output (out) parameters. See IlrStatelessSession.

A stateless rule session can pass objects as input parameters, and then add them to the working memory by using a rule task initial action. Likewise, a stateless rule session can retrieve objects from the working memory in a final action and pass them as output parameters. At the end of the execution, the content of the working memory might be modified.

Stateful rule sessions

With stateful rule sessions, you can set input (in) parameters, get output (out) parameters, and access the working memory. See IlrStatefulSession.

You can change the state of a Java SE, POJO, or EJB component by inserting and updating objects in the working memory or retracting objects from it. To do so, you have to work with stateful sessions.
Note: You can also set parameter values and update the working memory by using the IlrContext API inside IRL.