Task 1: Creating a decision service

You create a decision service that contains a decision model. When you run the model, it produces a greeting.

Step 1: Creating a decision automation

  1. Sign in to Decision Intelligence using your instance credentials.
  2. On the home page, click the Create a new decision automation tile.
  3. Enter a unique name in the Name field, for example <Your initials> My Getting Started.

    The automation name in this tutorial is My Getting Started.

  4. Enter the following description:
    My decision automation for the getting started tutorial.
  5. Click Create. Your decision automation opens in Decision Designer.

Step 2: Creating a decision service

  1. In your decision automation, click New decision +.
    In the New decision service wizard, you can:
    • Create decision services from scratch.
    • Import a compressed file that contains one or more decision services.
    • Import samples and tutorials, including:
      • Discovery tutorials help you get started in Decision Intelligence.
      • Industry samples let you discover decision services that are tailored for specific business applications.
      • Localized samples show you an example of a simple decision service in the different languages that Decision Intelligence supports.
  2. Make sure Create decision service is selected and enter My Service in the Name field.
  3. Expand Language, and select English (United States).
  4. Enter the following description:
    My getting started decision service.
    Note: The group ID is optional. If none is entered, a default one is used. The group ID is used to uniquely identify a decision service.
  5. Click Create.
    Your decision service opens. It shows the following tabs:
    • Models: Create decision, task, predictive, and generative AI models.
    • Data: Define custom data types.
    • Decision operations: Define entry points for executing decision, task, predictive, and generative AI models.

Step 3: Creating a decision model

You define the flow of a decision through a diagram in a model. The primary parts of the diagram are nodes:
  • Decision nodes: Contain the logic that processes the input data.
  • Input nodes: Provide the data that is needed to make the decision.
  • Prediction nodes: Provide values that are computed in predictive models. (Prediction nodes are not used in this tutorial.)
  • Function nodes: Provide values that are computed in other decision models. (Function nodes are not used in this tutorial.)
  • Generative AI nodes: Provide values that are computed in generative AI models. (Generative AI nodes are not used in this tutorial.)

Data flows from input nodes to decision nodes, where rules determine the output. The rules are expressed as business rules and decision tables.

  1. In the Models tab, click Create +.

    The Decision model type is selected by default.

  2. Enter My Model in the Name field. You can add a description, but it is optional.
  3. Click Create.

    A basic model opens. It contains a diagram that has a decision node and an input node. In addition to the Modeling tab, Decision Designer shows four other tabs:

    • Error report: Checks the model for errors.
    • Run: Runs the model on test data.
    • View history: Shows the version of the model. You create the first version when you share the decision service.
    • Dependencies: Shows the decision artifacts and external libraries that the model depends on. You can declare new dependencies in this tab.

Your changes are automatically saved, and the information in these tabs is recomputed in each save.

You can use the navigation breadcrumbs to move back through the interconnected interfaces.

To the right of the breadcrumbs is a toolbar with a group of icons:

Decision Designer toolbar

From left to right, the icons have the following functions:

  • Status shows that your changes are saved automatically. The status icon is updated for each save.
  • Edit opens a window for editing the details of the model.
  • Undo reverts the last change.
  • Redo reinstates the last reverted change.
  • Navigation history helps you navigate easily between artifacts.
  • Load changes shows how many incoming changes can be loaded.
  • Share changes shows a blue dot when you have changes to share with your collaborators.
  • Deploy is a feature for deploying your decision service.

The appearance of the toolbar varies depending on the page that you are viewing.

Step 4: Defining the nodes

You start defining the nodes in the decision model by giving them descriptive names and output types. If you create a decision node that produces a message, for example, you might name it Message and set its output to string. For a node that outputs a price, you might name it Price and set its output to integer (see Modeling data).

  1. Select the Input node:
    • Change the Node name to Name.
    • Keep string selected in the Output type field.
  2. Select the Decision node:
    • Change the Node name to Daily advice.
    • Keep string selected in the Output type field.

Step 5: Defining the decision logic

You use rules to define the logic for decision nodes. A rule applies conditions to input data and, when those conditions are met, performs an action. A rule might check data for a specific value, for example, and if the data contains the value, the rule outputs an action that is related to the value.

You express rules in business rules and decision tables:

  • Business rules contain a rule statement that has a condition and an action.
  • Decision tables group business rules that use the same rule statement but with different variables.
  • Default rules apply an action when no other condition is met.

Rules use a natural language syntax (see Rule language) and include variables derived from node names in the model (see Understanding the structure of business rules).

  1. With the Daily advice decision node selected, open the Logic tab. Then, click the Create rule artifact Add button and select Business rule.
  2. Enter Advice rule in the Name field, select Name in the list of criteria, and click Create. The editor displays an error icon Error icon until you define the rule.
  3. The editor shows a default rule template:
    if
    Name is <a string>
    then
    set decision to <a string> ;
    Update it to output a greeting when a name is provided:
    1. Click the first <a string> and select defined from the completion menu.
    2. Click the second <a string> and use string interpolation to complete the output by adding `Hello { Name }!`.

      String interpolation assists you in authoring rules for decision services (see String interpolation).

    Your rule now looks like this:

    if
        Name is defined
    then
        set decision to `Hello { Name }!` ;

    This rule outputs a personalized greeting when a name is entered.

    Tip: Alternatively, you can copy and paste the greeting rule into the rule editor.
  4. In the right column, click the Create rule artifact Add button and select Default rule to add a rule that displays a message when no name is entered.
  5. Replace the default rule statement with:
    set decision to "Sorry, we don't have enough information to provide a response." ;

    Now, if no name is entered, the model outputs this default message.

  6. Click Back to the diagram to return to the model view.

    Data now flows from the Name node to the Daily advice node, which outputs either a greeting or the default message.

Step 6: Running the model

You run the model with test data to verify its behavior, and use the results to further develop the model (see Running models with test data).

  1. Open the Run tab.
  2. Click Add test data set +.

    You can provide the data in a friendly form or in its underlying JSON format. You can click the switch button Switch button to switch between the two edition modes.

    In this example, you enter your data in a form.

  3. In the form, enter Jamie in the name input field.

    The form uses the JSON representation of the name of an input node. In this instance, Name becomes name. For more information, see Modeling data.

  4. Click Run. You get the following result:
    Hello Jamie!
  5. Click the overflow menu Overflow menu icon next to name, and click Delete to remove the name from the test data.
  6. Click Run again. You get the following result:
    Sorry, we don't have enough information to provide a response.
  7. When finished, click Delete Delete icon in the header of the test data column to delete the test data set. You create a new test data set in the next task.