To package a Java™ or non-EJB rule session for Java EE, you use the rule session factory API to write an application that calls the ruleset. Then you edit the deployment descriptors and put the rule session JAR file and other files into the relevant archives.
To package an application by using a POJO factory:
Use the rule session factory API in your ruleset execution code (IlrPOJOSessionFactory).
<resource-ref>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<res-type>javax.resource.cci.ConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
Setting the res-sharing-scope value to Shareable might imply a sharing of the ruleset without consideration of the canonical ruleset path. You must set this value to UnShareable to isolate unexpected behavior related to the connection.
In most cases, you must add this reference at the level of the application-server-specific descriptor.
For example, to declare the <resource-ref> property for the XU in the weblogic.xml file:
<reference-descriptor>
<resource-description>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<jndi-name>eis/XUConnectionFactory</jndi-name>
</resource-description>
</reference-descriptor>
To declare this reference in an EJB application in WebLogic, use the weblogic-ejb-jar.xml file, and add the following code:
<resource-description>
<res-ref-name>eis/XUConnectionFactory</res-ref-name>
<jndi-name>eis/XUConnectionFactory</jndi-name>
</resource-description>
This segment of the descriptor binds the reference name used in the Rule Execution Server component to the real JNDI name eis/XUConnectionFactory. This is the name of the XU supplied at deployment time.
If you use only POJO factories, package the jrules-res-session-<appserver>.jar in your WEB-INF/lib directory. You can repackage as you want, but the goal is to grant access to the classes inside your servlet or JavaServer Pages. If your rules are written on Java classes, package them in the WAR file.
© Copyright IBM Corporation 1987, 2013. | Terms and conditions for information centers | Feedback
This information center is Built on Eclipse™. (www.eclipse.org)