Assets Navigation Lab

This module showcases the Decision Central environment provisioned during the Environment Setup Lab. The business assets are retrieved from the mortgages project, one of the demonstration projects available out of the box for Decision Central.

In this lab, you explore the integration between a web application and the execution server engine (Decision Server) for Red Hat Decision Manager 7. You also navigate through the project import and export options in Decision Central and identify and search for different business assets in the project’s library.

Goals
  • Become familiar with business assets and their organization

  • Become familiar with the business asset icons and representations

  • Search for and open business assets for viewing and editing

Prerequisites
  • Successful completion of the Environment Setup Lab

  • Successful login to Decision Central

1. Import Project

The Decision Central project library view is displayed when you click Design from the Decision Central home page.

The project library view shows available projects in the library. If the library is empty, it shows "Nothing Here":

images/empty-library-perspective.png

With an empty project library view, you have the option to create a project or import an existing project.

The empty library view also includes a Try Samples button. Clicking this button displays a list of preexisting demonstration projects that you can use to showcase the product’s capabilities.

In this section, you import the mortgages project.

  1. From the empty project library view, click Import Project.

    • Expect to see an Import Project dialog where you specify a Git repository URL for the project.

  2. In the Import Project dialog, enter https://github.com/gpe-mw-training/bxms_decision_mgmt_foundations_lab.git for Repository URL and click Import:

    images/import-dmf_lab.png
    • Expect to see a list of projects in the repository:

      images/import-policy-quote.png
  3. Select the mortgages project and click Ok in the top right corner.

    • When the import is completed, the project library view appears with the mortgages project selected:

      images/mortgages-project-library.png

2. Navigate Project Library

The project library view shows a tabular list of the assets in the project. The tabular list allows the user to:

  • Search for assets.

  • Display a different number of assets per table page.

  • Navigate between asset pages.

2.1. Search for Assets

At the top of the tabular list of assets, you see a search input field. As you type characters into this field, the grid of assets is filtered by the search string. The grid is filtered by the asset’s fully-qualified name, and the match is not case-sensitive.

images/search_by_name.png
  1. Search for dsl.

  2. Search for scenario.

  3. Search for bankruptcy.

  4. Clear the search field.

2.2. Display Assets Pagination

At the bottom of the tabular list of assets, there is a pagination control that allows the user to change the number of rows to show on a single page and to navigate between pages.

  1. Find the page controller.

  2. Change the number of entries per page to 50.

  3. Change the number of entries per page to 15.

  4. Navigate to the next page and back.

3. Download Project

Projects can be exported so you can use them to upload to a source code repository and import them later into another instance of Decision Central or distribute them outside the environment where they were created.

3.1. Export Project

To export the project, you start from Decision Central’s home page.

  1. Click the Home icon from the upper panel to access the Decision Central home page.

  2. Click Design to display the project list.

    • Note that the empty project library view you saw earlier is now populated with a list of projects.

  3. Select the mortgages project.

    • This shows the project’s library view with a list of its assets.

  4. Select the Applicant asset from the top of the list, and if the Project Explorer panel is not displayed, click the blue > icon to open it.

    • This opens the Project Explorer perspective:

      images/project-explorer-perspective.png
    • The Project Explorer view is accessible only when you select any of the assets from the project’s library view.

  5. Click the gear icon in the Project Explorer panel and select Download Project to trigger the download in your browser:

    images/settings-gear.png
    • A ZIP file containing the package structure of your project is downloaded to your Downloads folder. The name of the ZIP file is structured like this: [Space Name]-[Repository Name]_[project name].zip.

    • Expect to find a file called myspace-myrepo_mortgages.zip in your Downloads folder.

      Note
      In some cases, the file name may be missing a [Space Name]- prefix.

3.2. Deploy Mortgages Demonstration Project

It is useful to know how to create an executable component from a project. Executable components are stored in a binary repository (Maven) so that they can be used as dependencies for other projects. Executable components are also distributed to execution servers. Execution servers are the runtime containers that allow rules execution from client applications.

In this section, you deploy the mortgages demonstration project and use a containerized application to test the deployment.

The mortgages demonstration project is a Decision Manager project intended to demonstrate the use of Decision Server to evaluate a mortgage loan application for approval.

  1. Click the Home icon from the upper panel to access the Decision Central home page.

  2. Click Design to show the project list.

  3. Select the mortgages project.

    • This shows the project’s library view with a list of its assets.

  4. Select Build & Deploy from the set of buttons in the upper right.

    • Expect to see confirmation of a successful deployment.

  5. Click the Home icon from the upper panel.

  6. Click Deploy to display the Deploy perspective.

    • This shows the list of servers and containers:

      images/servers-and-containers.png
  7. Verify that the mortgages_1.2.0 KIE container shows a green circle with a checkmark, indicating successful deployment.

    Note

    Note that the IP address for the remote server is an internal host IP address for the OpenShift environment. This means that while the IP address is accessible from within the OpenShift platform components, you cannot access this IP address from outside the OpenShift environment—for example, from your browser. In order to access the KIE containers from outside the OpenShift environment, you need a Decision Server route, which you get from the list of pods in OpenShift Container Platform.

  8. If you are not already logged in to OpenShift Container Platform, log in using your OPENTLC credentials:

    images/ocp-login.png
  9. Select the BPMS project from your project list:

    images/projects-list.png
  10. Locate the Decision Central deployment whose name begins with gpte-kieserver in the list and click the > icon to the left to display details of this deployment:

    images/external-route-execution-server.png
  11. From the Networking section in the Decision Server pod, select one of the entries under ROUTES External Traffic and open the link in a new window.

  12. By default the Decision Server route needs additional details about the information that you are requesting.

    • Expect to see a Forbidden message result:

      images/execution-server-forbidden.png
  13. Add /docs to the end of the URL in your browser route.

    • Expect to see the KIE server remote API reference documentation:

      images/execution-server-rest-api.png
  14. Navigate to the [decision_server_external_route]/services/rest/server/containers route to confirm the existence of the mortgages container:

    images/mortgages-container-execution-server.png
    Note

    The /services/rest/server/containers endpoint of Decision Server is a secured resource. This means that you need to present credentials to access the resource. You use the same credentials (adminUser for the username and test1234! for the password) that you used for entering Decision Central from the Environment Setup Lab .

3.3. Explore Mortgages Web Application

Along with Decision Central and Decision Server, the provisioned template also deploys a web application to showcase interaction with the Decision Server REST API. In this section, you use the web application and find the rules that make decisions based on the input.

In this section, you locate the web application route.

  1. Navigate to the OpenShift Container Platform web application using your browser.

  2. If not already logged in, log in to the OpenShift Container Platform using your OPENTLC credentials:

    images/ocp-login.png
  3. Select the BPMS project from your project list:

    images/projects-list.png
  4. Locate the Angular web application deployment whose name begins with gpte-ng-dmf in the list and click the > icon to the left to display details of this deployment:

    images/external-route-ng-dmf.png
  5. From the Networking section in the application pod, select one of the entries under ROUTES External Traffic and open the link in a new terminal window.

    • The gpte-ng-dmf application is a web application that helps interacting with Decision Server throughout the course.

  6. In the left panel of the gpte-ng-dmf application, click Mortgages:

    images/ng-dmf-main-mortgages.png
    • The Mortgages component interacts with the mortgages container in Decision Server:

      images/ng-dmf-mortgages-empty.png
    • The following describes the fields in the gpte-ng-dmf web application:

      Applicant Section
      Field Required Description

      Name

      no

      Optional name for mortgage loan applicant—not used for any decisions and not persisted anywhere

      Age

      yes

      Mortgage loan applicant’s age—important for some decisions to approve or deny loan

      Credit Rate

      yes

      Mortgage loan applicant’s credit rating

      Bankruptcy Section
      Field Required Description

      Bankruptcy Detected

      no

      Check box to indicate bankruptcy to engine

      Year

      no

      If bankruptcy is indicated, specify year bankruptcy occurred

      Amount

      no

      If bankruptcy is indicated, specify amount of bankruptcy

      Income Source Section
      Field Required Description

      Income Validated

      no

      Check box to indicate income source

      Income Amount

      no

      If income source indicated, specify income amount

      Income Type

      no

      If income source indicated, select either Job or Asset type

      Loan Details Section
      Field Required Description

      Loan Amount

      yes

      Requested loan amount

      Deposit Max Amount

      yes

      Initial payment or deposit amount

      Mortgage Length

      yes

      Requested mortgage length in years

4. Execute Test Cases

In this section, you execute a number of test scenarios:

  • An approved mortgage loan application

  • A loan application denied because the loan requester is not old enough

  • A loan application denied because the loan requester’s credit history is not acceptable

4.1. Test Approved Mortgage Loan Application

In this section, you use the following example data to generate an approved response from the engine:

Field Value

Applicant Name

John Doe

Applicant Age

35

Credit Rate

AA

Bankruptcy Detected

False (unchecked)

Income Validated

True (checked)

Income Amount

70000

Income Type

Job

Loan Amount

25000

Deposit Max Amount

1500

Mortgage Rate

20

  1. If you do not see the Mortgage Loan Evaluation page, select the Mortgages option.

  2. Enter the example data into the loan evaluation form:

    images/approved-loan-data.png
  3. Click Submit.

    • Expect to see a pop-up dialog indicating that the loan is approved:

      images/approved-loan-result.png
  4. Click OK to dismiss the dialog.

4.2. Test Denied Loan Application Due to Applicant’s Age

In this section, you enter loan application data that generates a denied response from the engine. Then you examine the rule that causes the application to be denied.

You use the following example data, where only the applicant’s age is different from the previous example data:

Field Value

Applicant Name

John Doe

Applicant Age

15

Credit Rate

AA

Bankruptcy Detected

False (unchecked)

Income Validated

True (checked)

Income Amount

70000

Income Type

Job

Loan Amount

25000

Deposit Max Amount

1500

Mortgage Rate

20

  1. Update the Applicant Age field to 15, keeping the other data fields the same as the previous example.

  2. Click Submit.

    • Expect to see a pop-up dialog indicating that the loan is denied:

      images/old-enough-result.png
  3. Click OK to dismiss the dialog.

4.3. Examine Denied Decision Rule

In this section, you find the rule that is making the decision to deny the loan.

  1. Log in in to Decision Central.

    • If you have closed your Decision Central browser tab and need additional instructions on how to access Decision Central, refer to the section that reviews the OpenShift Container Platform components in the previous lab.

  2. Navigate to the mortgages project.

  3. Search for underage.

    • Expect to see results similar to this:

      images/underage-search.png
  4. Click the Underage asset to open the Underage.rdrl file and examine its contents:

    images/underage-rdrl.png

4.4. Test Denied Loan Application Due to Bad Credit History

As in the previous section, you enter loan application data that generates a denied response from the engine. Then you examine the rule that causes the application to be denied.

You use the following example data, changing the applicant’s age back to 35 and changing the credit rating from AA to OK:

Field Value

Applicant Name

John Doe

Applicant Age

35

Credit Rate

OK

Bankruptcy Detected

False (unchecked)

Income Validated

True (checked)

Income Amount

70000

Income Type

Job

Loan Amount

25000

Deposit Max Amount

1500

Mortgage Rate

20

  1. Return to the mortgages web application page.

  2. Enter the example data as shown or, if the previous form is still populated, change the applicant’s age to 35 and set the credit rating to OK.

  3. Click Submit.

    • Expect to see a pop-up dialog indicating that the loan is denied:

      images/only-aa-result.png
  4. Click OK to dismiss the dialog.

4.5. Examine Denied Decision Rule

In this section, you find the rule that made the decision to deny the loan.

  1. Navigate to the mortgages project in Decision Central.

  2. Search for credit check.

  3. Click the No bad credit checks asset to open the No bad credit checks.rdrl file.

  4. Examine the contents of the No bad credit checks.rdrl file.