Getting started with decision services
Abstract
Preface
As a business analyst or rules developer, you can use Business Central in Red Hat Process Automation Manager to design a variety of decision services. In this tutorial, you will create and test a mortgage application decision service.
Prerequisites
- Red Hat JBoss Enterprise Application Platform 7.1.0 is installed. See Red Hat JBoss EAP 7.1.0 Installation Guide.
- Red Hat Process Automation Manager is installed. For more information, see Installing and configuring Red Hat Process Automation Manager on Red Hat JBoss EAP 7.1.
-
Red Hat Process Automation Manager is running and you can log in to Business Central with the
adminrole.
Chapter 1. Opening the Mortgage Process sample project
The Mortgage Process sample project consists of predefined data objects, guided decision tables, guided rules, forms, and a business process. Using the sample project provides a quick way to get acclimated with Red Hat Process Automation Manager. In a real business scenario, you would create all of the assets by providing data that is specific to your business requirements.
The business process application example includes features that are Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and are not recommended for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about Red Hat Technology Preview support, see Technology Preview Features Support Scope.
Procedure
Navigate to the Mortgage Process sample project to view the predefined assets.
- Log in to Business Central and click Menu → Design → Projects.
- Click the three vertical dots in the upper-right corner of the screen and select Try Samples.
- Select Mortgage Process and click Ok.
The Assets view of the project opens.
Chapter 2. Data objects
Data objects are the building blocks for the rule assets that you create. Data objects are custom data types implemented as Java objects in specified packages of your project. For example, you might create a Person object with data fields Name, Address, and DateOfBirth to specify personal details for loan application rules. These custom data types determine what data your assets and your decision service are based on.
For more information about creating data objects, see "Creating data objects" in Designing a decision service using guided decision tables.
2.1. Viewing the Mortgage Process data objects
This tutorial utilizes the predefined data objects in the Mortgage Process sample project.
The Mortgage Process data model is composed of four data objects:
-
Applicant -
Application -
Property -
ValidationErrorDo
2.1.1. Viewing the Applicant data object
Follow these steps to familiarize yourself with the predefined Applicant data object.
Procedure
- Click Menu → Design → Projects, then click Mortgage Process.
Input
Applicant.javain to the project’s asset search box and click the Applicant data object.
Review the Applicant data object fields.

2.1.2. Viewing the Application data object
Follow these steps to familiarize yourself with the predefined Application data object.
Procedure
- Click Menu → Design → Projects, then click Mortgage Process.
Input
Applicantion.javain to the project’s asset search box and click the Application data object.
Review the Application data object fields.

2.1.3. Viewing the Property data object
Follow these steps to familiarize yourself with the predefined Property data object.
Procedure
- Click Menu → Design → Projects, then click Mortgage Process.
Input
Property.javain to the project’s asset search box and click the Property data object.
Review the Property data object fields.

2.1.4. Viewing the ValidationErrorDO data object
Follow these steps to familiarize yourself with the predefined ValidationErrorDO data object.
Procedure
- Click Menu → Design → Projects, then click Mortgage Process.
Input
ValidationErrorDO.javain to the project’s asset search box and click the ValidationErrorDO data object.
Review the Property data object fields.

Chapter 3. Guided rules
Guided rules are business rules that you create in a UI-based guided rules designer in Business Central that leads you through the rule-creation process. The guided rules designer provides fields and options for acceptable input based on the data objects for the rule being defined. The guided rules that you define are compiled into Drools Rule Language (DRL) rules as with all other rule assets.
All data objects related to a guided rule must be in the same project package as the guided rule. Assets in the same package are imported by default. After you create the necessary data objects and the guided rule, you can use the Data Objects tab of the guided rules designer to verify that all required data objects are listed or to import other existing data objects by adding a New item.
3.1. Defining Business Rules
Define business rules in Red Hat Process Automation Manager using the Guided Rule wizard.
Related information
For more information about Guided business rules, see Designing a decision service using guided rules.
3.1.1. Creating the Validate Down Payment guided rule
Procedure
- Log in to Business Central and click Menu → Design → Projects, then Mortgage Process.
Click Add Asset → Guided Rule, then enter:
-
Guided Rule:
Validate Down Payment -
Package:
com.myspace.mortgage_app
-
Guided Rule:
- Click Ok to open the Guided Rule Editor.
3.1.2. Defining the Validate Down Payment guided rule conditions
The conditions that you specify in this section are used to determine whether of not the down payment meets the specified requirements.
Procedure
-
Click
next to the WHEN label to open the Add a condition to the rule window. Then, select Application… and click Ok.
- Click the There is an Application label and select Any of (Or) from Multiple field constraints.
- Click the There is an Application [app] with: any of the following: label , then select downpayment from Add a restriction on a field.
Click --- please choose ---, then select equal to.

Click
, select Literal value, and enter 0.
- Click the There is an Application [app] with: any of the following: label, then from the Add a restriction on a field select downpayment.
- Click --- please choose ---, then select greater than or equal to.
-
Click
, then click Expression editor.
- From the Choose… menu, select app.
- From the Choose… menu, select downpayment.
3.1.3. Defining the error conditions
You must define the conditions and results of the data that is received and processed. In this section, you will define the following two conditions:
- ValidationErrorDO
- retractValidationErr
3.1.3.1. Defining the ValidationErrorDO
Specify the error message that will be presented to the loan applicant.
Procedure
-
Click
next to the THEN label. Select Insert fact ValidationErrorDO, and click Ok.
- Click the Insert ValidationErrorDO label and select error from the Add field pull-down menu.
-
Click
, then click Literal value.
In the error field, enter:
Down payment cannot be 0, greater than, or equal to the property sale price..
-
Click
next to the THEN label. Select Add free form DRL and click Ok.
Enter the following in the Add free form DRL… text box:
System.out.println("Executed Rule: " + drools.getRule().getName() );- Click (show options…).
-
Click
next to the (options) label to open the Add an option to the rule window.
Select ruleflow-group from the Attribute drop-down menu and enter validation in the ruleflow-group field.

3.1.3.2. Defining the retractValidationErr
Define the error trigger details.
Procedure
-
Click
next to the WHEN label to open the Add a condition to the rule window. Then, select ValidationErrorDO and click Ok.
-
Click There is a ValidationErrorDO to open the Modify constraints for ValidationErrorDO window, enter
vdoin the variable name field, and click Set. -
Click
next to the THEN label. Select Delete vdo, and click Ok.
- Click (show options).
Enter
errorin the ruleflow-group field.
- Click Save, then click Save to confirm your changes.
Chapter 4. Guided decision tables
Guided decision tables are a wizard-led alternative to uploaded decision table spreadsheets for defining business rules in a tabular format. With guided decision tables, you are led by a UI-based wizard in Business Central that helps you define rule attributes, metadata, conditions, and actions based on specified data objects in your project. After you create your guided decision tables, the rules you defined are compiled into Drools Rule Language (DRL) rules as with all other rule assets.
All data objects related to a guided decision table must be in the same project package as the guided decision table. Assets in the same package are imported by default. After you create the necessary data objects and the guided decision table, you can use the Data Objects tab of the guided decision tables designer to verify that all required data objects are listed or to import other existing data objects by adding a New item.
4.1. Creating Decision Tables
Decision tables are a way to generate rules driven from the data entered into a spreadsheet. Decision tables are created in Red Hat Process Automation Manager using the Guided Decision Table wizard.
Prerequisites
The business rules have been defined. For more information, see Section 3.1, “Defining Business Rules”.
4.1.1. Viewing the Mortgage Decision Table
The goal of this chapter is to introduce you to the Mortgage Decision Table. For this tutorial, you will not create and set the decision table conditions. Instead, review the values and the conditions that are already defined in the Mortgage Process sample project’s MortgageDecisionTable Guided Decision Tables asset.
Procedure
- Log in to Business Central and click Menu → Design → Projects, then Mortgage Process.
Scroll down and click the MortgageDecisionTable Guided Decision Tables asset.
Chapter 5. Test scenarios
Test scenarios in Red Hat Process Automation Manager enable you to validate the functionality of rules, models, and events before deploying them into production. A test scenario uses data for conditions that resemble an instance of your fact or project model. This data is matched against a given set of rules and if the expected results match the actual results, the test is successful. If the expected results do not match the actual results, then the test fails.
After you run all test scenarios, the status of the scenarios is reported in a Reporting panel.
Test scenarios can be executed one at a time or as a group. The group execution contains all the scenarios from one package. Test scenarios are independent, so that one scenario cannot affect or modify the other.
5.1. Testing the loan application scenario
Test the loan application scenario using the data that you specified when you created the mortgage guided decision table. For this test, you will input data for a property in an urban location with a sales price of less than $300000.00 that is under five years old.
Prerequisites
-
The
Mortgage Processproject has been created The following data objects have been created:
- Applicant
- Property
- ValidationErrorDo
- Application
- The mortgage guided decision table has been created
5.1.1. Create the Qualify Test Scenario asset
Before you input the fact and test data values, you must create a new Test Scenario asset.
Procedure
- Log in to Business Central. Click Menu → Design → Projects, then Mortgage Process.
- Click Projects → Add Asset → Test Scenario.
In the Create new Test Scenario window wizard, enter the following values:
-
Test Scenario:
Qualify -
Package: select
com.myspace.mortgage_app
-
Test Scenario:
- Click Ok.
5.1.2. Input the Applicant facts and values
Input the Applicant test data based on the guided decision table values.
Procedure
- Click +GIVEN to open the New input window.
- Select Applicant from the Insert a new fact pull-down menu.
-
Enter
appin the Fact name field and click Add. - Click Add a field to open the Choose a field to add window and select annualincome from the Choose a field to add pull-down menu and click OK.
-
Click
next to annualincome.
-
Click Literal value in the Field value window and enter
150000in the annualincome field.
5.1.3. Input the Property facts and values
Input the Property test data based on the guided decision table values.
Procedure
- Click +GIVEN to open the New input window.
- Select Property from the Insert a new fact pull-down menu.
-
Enter
propin the Fact name field and click Add. - Click Add a field to open the Choose a field to add window and select saleprice from the Choose a field to add pull-down menu and click OK.
-
Click
next to saleprice.
-
Click Literal value in the Field value window and enter
250000in the saleprice field. - Click Insert 'Property'[prop] and select age from the Choose a field to add pull-down menu in the Choose a field to add window, and click OK.
-
Click
, then click Literal value and enter 4in the age field. - Click Insert 'Property'[prop] and select locale from the Choose a field to add pull-down menu in the Choose a field to add window, and click OK.
-
Click
, then click Literal value and enter Urbanin the type field.
5.1.4. Input the Application facts and values
Input the Application test data based on the guided decision table values.
Procedure
- Click +GIVEN to open the New input window.
- Select Application from the Insert a new fact pull-down menu.
-
Enter
applicationin the Fact name field and click Add. - Click Add a field to open the Choose a field to add window and select mortgageamount from the Choose a field to add pull-down menu and click OK.
-
Click
next to mortgageamount.
-
Click Literal value in the Field value window, then enter
250000in the mortgageamount field.
5.1.5. Input the expected values
Input the application’s expected values.
Procedure
- Click +Expect to open the New expectation window.
- Expand the Fact value pull-down menu, select Application, and click Add.
- Click Application 'application has values:
- Select mortgageamount from the Choose a field to add pull-down menu and click OK.
-
Enter
200000in the mortgageamount: equals field. - Click Save, then click Save to confirm your changes.
Click Run scenario.
Figure 5.1. Application test scenario screen

Chapter 6. Additional resources
Appendix A. Versioning information
Documentation last updated on: Monday, October 1, 2018.
