Getting started with decision services

Red Hat Decision Manager 7.1

Red Hat Customer Content Services

Abstract

In this tutorial, you will create and test a mortgage application decision service using Red Hat Decision Manager 7.1. The procedures in this document are based on the included Mortgages sample project.

Preface

As a business analyst or rules developer, you can use Decision Central in Red Hat Decision Manager to design a variety of decision services. In this tutorial, you will review the pre-defined data objects, business rules, and decision tables. You will then test the mortgage application decision service.

Prerequisites

Chapter 1. Opening the Mortgages sample project

The Mortgages sample project consists of predefined data objects, guided decision tables, guided rules, forms, and test scenarios. Using the sample project provides a quick way to get acclimated with Red Hat Decision Manager. In a real business scenario, you would create all of the assets by providing data that is specific to your business requirements.

Important

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 Mortgages sample project to view the predefined assets.

  1. Log in to Decision Central and click MenuDesignProjects.
  2. Click dots in the upper-right corner of the screen and select Try Samples.
  3. Select Mortgages 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 Mortgages data objects

This tutorial utilizes the predefined data objects in the Mortgages sample project.

The Mortgages data model is composed of four data objects:

  • Applicant
  • Bankruptcy
  • IncomeSource
  • LoanApplication

2.1.1. Viewing the Applicant data object

Follow these steps to familiarize yourself with the predefined Applicant data object.

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Input Applicant.java in to the project’s asset search box and click the Applicant data object.
  3. Review the Applicant data object fields.

    field data applicant dm

2.1.2. Viewing the Bankruptcy data object

Follow these steps to familiarize yourself with the predefined Bankruptcy data object.

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Input Bankruptcy.java in to the project’s asset search box and click the Bankruptcy data object.
  3. Review the Bankruptcy data object fields.

    field data bankruptcy

2.1.3. Viewing the IncomeSource data object

Follow these steps to familiarize yourself with the predefined IncomeSource data object.

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Input IncomeSource.java in to the project’s asset search box and click the IncomeSource data object.
  3. Review the IncomeSource data object fields.

    field data inc src

2.1.4. Viewing the LoanApplication data object

Follow these steps to familiarize yourself with the predefined LoanApplication data object.

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Input LoanApplication.java in to the project’s asset search box and click the LoanApplication data object.
  3. Review the Property data object fields.

    field data laon app

Chapter 3. Guided rules

Guided rules are business rules that you create in a UI-based guided rules designer in Decision 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. Viewing the Mortgages business rules

Follow these steps to familiarize yourself with the predefined business rules for the Mortgages project.

Related information

Business rules are defined using the Guided Rule wizard in Red Hat Decision Manager. For information about creating guided business rules, see Designing a decision service using guided rules.

3.1.1. Viewing the CreditApproval guided rule

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Click the CreditApproval guided rule.
  3. Review the CreditApproval guided rule’s WHEN and THEN conditions and values.

    credit approval rules

3.1.2. Viewing the Bankruptcy history guided rule

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Click the Bankruptcy history guided rule.
  3. Review the Bankruptcy history guided rule’s WHEN and THEN conditions and values.

    bankruptcy rules

3.1.3. Viewing the Underage guided rule

Procedure

  1. Click MenuDesignProjects, then click Mortgages.
  2. Click the Underage guided rule.
  3. Review the Underage guided rule’s WHEN and THEN conditions and values.

    underage rules

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 Decision 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. Viewing the Pricing loans decision table

The goal of this chapter is to introduce you to the Pricing loans 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 Mortgages sample project’s Pricing loans Guided Decision Tables asset. For information about creating decision tables, see Designing a decision service using guided decision tables.

Prerequisites

The business rules have been defined. For more information, see Section 3.1, “Viewing the Mortgages business rules”.

Procedure

  1. Log in to Decision Central and click MenuDesignProjects, then Mortgages.
  2. Scroll down and click the Pricing loans Guided Decision Tables asset.

    loans guided dt

Chapter 5. Test scenarios

Test scenarios in Red Hat Decision 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 Pricing low end scenario

Test the Pricing low end scenario using the data that is specified in the Pricing loans decision table as shown in Section 4.1, “Viewing the Pricing loans decision table”. For information about testing decision services, see Testing a decision service using test scenarios.

Procedure

  1. Log in to Decision Central. Click MenuDesignProjects, then Mortgages.
  2. Scroll down and click the Pricing low end test scenario asset.
  3. Review the Pricing low end test scenario’s GIVEN and EXPECT conditions and values.
  4. Click Run scenario.

The Reporting section at the bottom of the window should show a Success message. This is the expected result as the values and conditions set in the test scenario meet the requirements as specified in the Pricing loans decision table.

5.2. Testing the Are they old enough scenario

Test the Are they old enough scenario using the data that you specified when you created the Underage guided rule. For information about testing decision services, see Testing a decision service using test scenarios.

Procedure

  1. Log in to Decision Central. Click MenuDesignProjects, then Mortgages.
  2. Scroll down and click the Are they old enough test scenario asset.
  3. Review the Are they old enough test scenario’s GIVEN and EXPECT conditions and values. Leave the preset age value of 17 as is.
  4. Click Run scenario.

The Reporting section at the bottom of the window should show a Success message. This is the expected result as an applicant below the age of 21 is not eligible for a mortgage loan as defined in the Underage guided rule.

age test

Chapter 6. Additional resources

Appendix A. Versioning information

Documentation last updated on Friday, October 12, 2018.

Legal Notice

Copyright © 2018 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.