Configuring Rule Execution Server in scoped mode

You can configure Rule Execution Server so that it is scoped to a single Java EE application.

About this task

In this use case, Rule Execution Server is scoped exclusively to a single application. The Execution Unit (XU) is deployed within a single application. With this deployment option, you can deploy multiple applications to the same server.

Note:

If you package the Rule Execution Server XU resource archive (RAR) file in your enterprise application (EAR), applications that use a previous version of WebSphere® Operational Decision Management or multiple applications that use the current version of WebSphere Operational Decision Management, or both, can coexist in the same Java Virtual Machine (JVM).

Procedure

  1. Write and compile the source code, including the basic tasks of the client, and your business logic.
  2. Specify the deployment descriptors.
  3. Package the .class, .jsp, and .html files, deployment descriptors, and the Rule Execution Server .rar file into a Java EE application EAR file. Do not modify the RAR.
  4. Declare the RAR module inside the application.xml file, as follows:
    <application>
        ....
        <module>
            <connector>jrules-res-xu-<appserver>.rar</connector>
        </module>
        ....
    </application>

    You can use the class IlrPOJOSessionFactory as you do to deploy the XU to a server.

    It is also possible to package the rule session JAR in the same Java EE application EAR file. In this case, the application uses the local EJB binding and you do not have to define the JNDI name in the application server EJB descriptor file (ejb-jar.xml). The global JNDI tree is used to resolve external references, but it is not necessary to resolve a JNDI name relative to the component environment java:comp/env.

    If your descriptor contains <ejb-local-ref>, the JNDI lookup uses the value defined in the <ejb-link> attribute to find the EJB. There is no confusion with other EJBs deployed in other EAR files and no issue with mixed class loaders.

    Important:

    In the deployment phase of the EAR file, you must create a Java 2 connection factory (J2C). This step is necessary to add the JNDI name of the resource adapter.

    Tip:

    If you package a rule session factory inside an application EAR, you can remove the JNDI definitions from the rule session JAR.