Running the completed tutorial

You import and run the completed tutorial files, and then use run configurations to see how the decision service aggregates the logic of its contained rule projects. Then, you deploy the result to your file system.

About this task

The following diagram shows the decision service structure with its dependencies:

Structure of decision service.

To run the completed version of the tutorial:

Step 1: Importing the answer projects

You import the answer projects into Rule Designer.

Procedure

  1. Open the Samples Console in the en-US (American English) locale (see Running samples from the Samples Console).
  2. In the Samples and Tutorials view, go to Rule Designer > Tutorials > Creating a decision service with multiple projects > answer and click Import projects.
    Six projects are imported:
    • Loan Validation Base: A project that contains the business object model (BOM) that is used by the rules. This project references the XOM project and is referenced by all the other projects.
    • Loan Validation Check: A rule project that validates loan and borrower data.
    • Loan Validation Determination: A rule project that determines loan eligibility and insurance conditions.
    • Loan Validation Scoring: A rule project that determines score and grade used in determining loan eligibility.
    • Loan Validation Service: The main project for the decision service.
    • loan-validation-xom: A Java™™ project that defines an execution object model (XOM) for rule execution.

Step 2: Running a decision operation

You run a decision operation in the decision service.

Procedure

  1. If you are not in the Rule perspective, click Window > Open Perspective > Other > Rule to open the perspective.
  2. Click Run > Run Configurations > Decision Operation.
    The dialog box shows three run configurations:
    • run loan validation: This configuration is based on the loan validation with score and grade operation, which is found in the main project of the decision service. This decision operation aggregates the entire logic of the decision service, and contains rules from its different projects. It is designed for testing and simulation in a nonproduction environment.
    • run production: This configuration is based on the loan validation production operation, which is found in the main project of the decision service. This decision operation aggregates the entire logic of the decision service, is intended for production, and contains only validated rules.
    • run scoring: This configuration is based on the scoring decision operation, which contains only the rules of the Loan Validation Scoring\computation rule package.
  3. Select run production and click Run. The Console view shows that the loan is approved and the required insurance rate is 2%.

Step 3: Deploying the decision service

You deploy to your file system.

Procedure

  1. Open Loan Validation Service > deployment > test deployment. You see that this deployment configuration is meant for a nonproduction server, and references two decision operations.
  2. On the Overview page, click Proceed to RuleApp deployment.
    Note: A warning opens for Eclipse and your JDK. If your application server runs a different JDK, modify the settings in Eclipse to use that JDK.
  3. Click Finish to deploy to your file system. A deployment report opens to show the results of the deployment.
    Deployment report
  4. If you opened the File Explorer to see the files, close it to prevent a problem in deleting projects.

Results

The deployment report shows that you have deployed one RuleApp that contains two rulesets.