Task 1: Creating the decision model service

In this task, you create the project, the first nodes in the diagram, and the initial decision logic for your decision model service.

About this task

In a decision model service, you use a diagram to model data and decision nodes, and then author the decision logic of each decision node. Data nodes represent the data that is received from the client application, and decision nodes contain the logic in the form of business rules.

In this task, the data node is for the customer name, and the decision node returns a salutation with two possible replies:
  • Says Hello to the customer and adds the customer's name.
  • Replies with a default statement if no name is provided.

Step 1: Creating the project

You first create the Salutation2 project for your decision model service. The project contains all the information required to build and deploy a decision service. The project can also be exported as a .zip file.

Procedure

  1. Log in to your tenant of Operational Decision Manager on Cloud, and open the Decision Center Business console.
  2. In the Library tab, click the Create New Decision Model Service button "".
  3. Enter Salutation2 as the project name for your decision model service. For the description, you can enter the following information:

    Getting started with decision model tutorial. Decision model service composes greeting that includes the time, degree, and gender.

    Note: This tutorial does not cover the decision governance framework, so you do not have to select it.
  4. Click Create.
  5. Make sure that the Branches tab is selected, and then click main to access the main branch.
    You can see the modeling diagram, which contains a decision node and a data node:

    Image shows the decision model project with an empty diagram.

    Decision Center assigns a new version number to the decision model every time you save it. The decision model works as one versionable element. Changes to individual rules or nodes can be consulted through the version of the decision model.

    Note: The nodes are in an error state until you give them a type.

Step 2: Creating the initial nodes

You create and define the relationship between the data that is provided by the client application, and the decision that is returned by your decision model service. Initially, you want your decision model to accept a customer name as input data, and provide a salutation to the customer.

Procedure

  1. Click the Edit button "" below the tab names, just above the diagram.
    Version 1.0 of the decision model diagram is now editable.
  2. In the diagram, click the default data node Input Data 1.
  3. In the Model tab, change the Output variable name of the node to Name. You can do this in Output variable name field or the name field just above the Details field.
  4. Under Output type, click Make a selection, and then click string to select it as the type to handle the customer name as text.
    The type determines what the node can receive as input and send as output. Data modeling requires you to carefully assign the correct type to each node.
  5. In the diagram, click once on the Decision 1 decision node.
  6. Name your new decision node Salutation, and choose string as the type.
    Your decision model now has a data node feeding a top-level decision node:

    Image shows the top level decision node fed by data node.

Step 3: Creating the decision logic

You have the minimum node structure: one data node feeding one decision node. The decision node accepts input data from the nodes that point to it, and produces a decision that is based on the logic that you author.

About this task

Authoring the decision logic involves two aspects:
  • Writing business rules that provide a decision that is usually based on conditions.
  • Writing sufficient business rules to cover the possible cases that the client application encounter.

The nodes in the diagram are available in the business rules as variables of the form the 'node name'. For now, you have the Name data node available as 'the name', and the Salutation decision node as 'the salutation' in the rule and decision table editors.

Procedure

  1. Select the Salutation node in the diagram to edit its content.
  2. In the Model tab, under Decision logic, click Add rule.
    The wizard proposes a starting point for the rule that is based on conditions that you might want to apply to the data that it receives.
  3. There are no conditions to consider for the name, so click Create rule.
  4. In the middle panel, change the name from rule-1 to salutation rule.
  5. Click the <a string> placeholder, and select 'the name' from the proposed options that appear.
    In this state, your decision model service simply returns the name provided as input. To add more value to the process, change the rule as follows:
    set decision to "Hello " + 'the name' + "!" ;
    Note: Add a space in "Hello " to insert a space before the name.

    The keyword decision is available in each decision node to designate the output value of the node. Replacing with 'the salutation' is exactly equivalent.

  6. Still under Decision logic, click Set output default, and replace the rule as follows:
    set decision to "We don't have correct information to greet you!";
  7. Click Save and Continue at the top of the window, and then Create New Version to save version 1.1 of your decision model service.

Step 4: Validating the decision model

The decision modeling tool enables you to validate your model immediately. You run your decision model service on data that you provide.

Procedure

  1. Click the Validate tab.
  2. Click the Add button "" beside Data sets.
  3. Enter Jones in the Name field for your data set, and click Run.
    The validation report shows the output from running your decision model, and information that is useful when troubleshooting:

    Image shows the report from running the decision model service.

  4. Click the three dots next to Name, and click Delete item to clear the name from the data set.
    Image shows the delete function.
  5. Click Run again.
    The report shows the default message.
    "We don't have correct information to greet you!"
  6. Click Cancel, and then Yes because the next tasks use different data.

What to do next

In the next task, you add to the salutation by making the final decision dependent on another decision.