This Java SE sample illustrates how to execute a decision service bundled in your JSE application with IBM Operational Decision Manager.
It makes use of:
- ODM Rule sessions JSE API
- The Java SE memory persistence introduced in ODM 8.9.2.
The sample architecture and workflow are as follows:
- The ODM Java Rule session API is invoked to execute the ruleset whose ruleset path is passed as argument (i.e.
/test_deployment/loan_validation_with_score_and_grade
). - The Rule Session API delegates the ruleset execution to the RES Execution Unit (XU).
- The XU fetches the ruleset from the RES memory persistence.
- As there is no such ruleset, the RES memory persistence looks up a matching RuleApp packaged in the application's classloader resources.
- The RES memory persistence loads the content of the RuleApp archive test-deployment.jar.
- The RES memory persistence returns the target ruleset to the XU.
- The XU retrieves the Java Execution Object Model (XOM) from the application classloader.
- The XU finally executes the ruleset and passes the available output results to the Rule Session API.
You'll need IBM Operational Decision Manager, version 8.9.2 or higher.
To build and run this sample you'll need to set the ibm.odm.install.dir
maven property so that it points to the actual location where ODM 8.9.2 is installed.
To build the source code, type the maven command:
mvn clean install -Dibm.odm.install.dir="<ODM_INSTALL_DIR>"
To run the sample, type the following maven command:
mvn exec:java -Dexec.mainClass="j2serulesession.Sample" -Dexec.args="/test_deployment/loan_validation_with_score_and_grade" -Dexec.classpathScope="test" -Dibm.odm.install.dir="<ODM_INSTALL_DIR>"
© Copyright IBM Corporation 2018.