Memory ruleset execution sample details
You run this sample in the Samples Console.
Running this sample
To run this sample:
- Open the Samples Console.
- In the Samples Commands tab, expand .
- Double-click the execute command.
This operation can take some time to complete. It posts messages to the console during the run, and when it finishes, it displays the following decision report:
INFO: Create engine definition in debug from DSAR Report: Valid data true Approved false - Rate 0.055 - Monthly repayment 2,325.65 - Message Average risk loan Too big Debt/Income ratio: 1.40 We are sorry. Your loan has not been approved Completed: execute BUILD SUCCESSFUL
This command calls the SampleClient class by using the ruleset parameter without a loan amount. Then, the sample code is called with a default loan amount.
Running the sample using a smaller loan amount as a parameter
You run the sample to process a smaller loan amount.
- Open the Samples Console.
- In the Samples Commands tab, expand .
- Double-click the execute.small.loan command.
This operation can take some time to complete. It posts messages to the console during the run, and when it finishes, it displays the following decision report:
INFO: Create engine definition in debug from DSAR Report: Valid data true Approved true - Rate 0.055 - Monthly repayment 232.56 - Insurance required true Insurance rate 2% - Message Low risk loan Congratulations! Your loan has been approved Completed: execute.small.loan BUILD SUCCESSFUL
Rebuilding the sample
To rebuild the sample:
- Open the Samples Console.
- In the Samples Commands tab, expand .
- Double-click the clean command. This command removes the built classes, and the RuleApp and its XOM that the Build Command built in the lib directory.
How this sample works
The sample uses the following workflow:
- The ODM Java Rule session API is invoked to run the ruleset, whose ruleset path is passed as an argument, for example, /test_deployment/loan_validation_with_score_and_grade.
- The Rule Session API delegates the ruleset execution to the Rule Execution Server execution unit (XU).
- The XU fetches the ruleset from the Rule Execution Server memory persistence.
- As there is no such ruleset, the Rule Execution Server memory persistence looks for a matching RuleApp packaged in the application's classloader resources.
- The Rule Execution Server memory persistence loads the contents of the RuleApp archive test-deployment.jar.
- The Rule Execution Server 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 runs the ruleset and passes the available output results to the Rule Session API.
The sample uses the following features:
The sample architecture and workflow are as follows:

Source files
This sample is in <InstallDir>/executionserver/samples/jsedecisionservice.
You can view and modify the sample source files in Rule Designer:
- Open the Samples Console
- In the Samples and Tutorials tab, expand .
- Under Memory ruleset execution, click Import projects.
- Switch to the Java perspective to view the following classes:
- The RESJSEExecution class defines a way to call the decision service from the Java SE environment.
- The SampleClient class shows a way to use the RESJSEExecution class.