Red Hat Decision Manager

A cloud-native approach to building business rules and decision services.

Hello World!

Build Something Today

Let's walk through everything you need to build your first application.

Thank you for downloading

Your download should start automatically. If you have any problems with the download, please use the direct link.



Hello World!

Preamble

Prerequisites

Before you start, make sure you have installed the following software:

  • Java SE Development Kit (JDK) version 1.8.x (Java 8) - we recommend Oracle JDK or OpenJDK.
  • A Git client.

1. Install Decision Manager runtime

5 minutes

Body
  1. Download the JBoss EAP 7 distribution zip.
  2. Download the Red Hat Decision Manager - Decision Central EAP 7 Deployable zip.
  3. Download the Red Hat Decision Manager - KIE Server EE 7 zip.
  4. Clone the Red Hat Decision Manager 7 Installation Demo Git repository: https://www.github.com/jbossdemocentral/rhdm7-install-demo
  5. Copy the 3 zip files that you’ve just download to the “installs” directory of the “rhdm7-install-demo” directory.
  6. Run the “init.sh” script (Linux / macOS) or “init.ps1” (Windows) script to install the Decision Manager 7 platform.
  7. Start the platform with “./target/jboss-eap-7.1/bin/standalone.sh” (Linux / macOS) or “.\target\jboss-eap-7.1\standalone.bat” (Windows Batch) or “.\target\jboss-eap-7.1\standalone.ps1” (Windows Powershell) script.
  8. Access the Decision Manager - Decision Central workbench at http://localhost:8080/decision-central, and log in with username “dmAdmin” and password “redhatdm1!”.

2. Import your first Decision Service

10 minutes

Body

Red Hat Decision Manager comes with a number of out-of-the-box template and example applications that can be used to quickly build and deploy a Decision Service microservice.

  1. Access the Decision Manager - Decision Central workbench at http://localhost:8080/decision-central, and log in with username “dmAdmin” and password “redhatdm1!”
  2. Go to “Menu -> Design -> Projects”. Click on “Import Project”
  3. Use the following repository URL https://github.com/jbossdemocentral/rhdm7-loan-demo-repo.git, and click on “Import”.
  4. Select “loan-application” and click on “OK”.
  5. After the project has been imported you will see three assets. Two Data Models (Loan and Applicant) and a Decision Table (loan-approval).
  6. Open the “loan-approval” Decision Table. Inspect the 4 rules that are defined in the table. The rules control whether the “Loan” gets approved based on the amount of the loan and the credit score of the application. More specifically, when the application gets approved, the “approved” field of the “Loan” will be set to “true”.
  7. Click on the “Build and Deploy” button to build the KJAR (the Decision Deployment Unit which contains the model and rules) and to deploy it on the execution server.
  8. Once the build and deployment has finished open “Menu -> DevOps -> Execution Servers”. The page will show a running “default-kie-server” with the “loan_application_1.0.0-SNAPSHOT” container.

3. Test your Decision Service

5 minutes

Body

The Decision Server comes with a Swagger UI that allows us to test the RESTful endpoints of the server and the rules deployed on it. We will use this UI to test our rules.

  1. Go to the URL”http://localhost:8080/kie-server/docs”. This will open the Swagger UI.
  2. Verify that the rules have been correctly deployed on the Decision Server by navigating to “KIE Server :: Core” : “GET” : “/server/containers”    . Click on “Try it out”, leave the parameters empty and click on “Execute”.

  1. The page will show a response with code “200” and a response body that lists the “loan-application_1.0.0-SNAPSHOT” container.

  1. Send a request to the Decsion Service by navigating to “Rules evaluation :: BRM” : “POST” : “/server/containers/instances/{id}.
  2. Set “Parameter content type” to “application/json”,  set “id” to “loan-application_1.0.0-SNAPSHOT” (this is the id of the Rules container), set “body” to:
{
"lookup" : "default-stateless-ksession",
"commands":[
  {
    "insert":{
      "object":{
        "com.redhat.demos.dm.loan.model.Applicant":{
          "creditScore":230,
          "name":"Jim Whitehurst"
        }
      },
      "out-identifier":"applicant"
    }
  },
  {
    "insert":{
      "object":{
        "com.redhat.demos.dm.loan.model.Loan":{
          "amount":2500,
          "approved":false,
          "duration":24,
          "interestRate":1.5
        }
      },
      "out-identifier":"loan"
    }
  },
  {
    "fire-all-rules":{
    }
  }
]
}

 

  1. Set “Response content type” to “application/json”
  2. Click on execute.
  3. The page will show a response with code “200” and a response body that lists the result of the rule execution. Especially, the “Loan” object’s “approved” field should now say “true”, which is the outcome of the rule evaluation.

Build Something Today

Let's walk through everything you need to build your first application.

Download