Example of a Decision in a Dynamic Process

Explore with an example how you can use a decision in a dynamic process.

Suppose you’re a customer service manager of a credit card company. You decide the credit card interest rates for potential customers. However, interest rates on credit cards aren’t arbitrarily set. Typically, banks set interest rates based on the risk a customer poses. A lower credit risk qualifies a customer for lower interest rate. A customer’s credit score and debt-to-income ratio are deciding factors. A high credit score and low debt-to-income ratio indicate that the customer has handled credit well in the past and is likely to pay new credit on time.

You need a decision model that decides based on the two deciding factors – credit score and debt-to-income ratio - if a potential customer can get a low interest rate offer.

The main artifacts that you create for implementing the example are:

  • A dynamic process CreditCard that houses the various activities that the user has to complete while applying for a credit card.
  • A decision model InterestRates that defines the rules that determine if the customer is eligible for a low interest rate offer.
  • An activity Offer within the dynamic process that gets activated in runtime if the decision's outcome or result is TRUE.
  • A form CreditCardApplicationForm where among other details such as customer name and email, you enter values that are used as input values for the InterestRates decision model.

Before you begin, review the main steps for using a decision in a dynamic process. See Configure a Decision Sentry in a Dynamic Process.

  1. Create a process application and its components.
    1. Create a dynamic process CreditCard that houses activities required while applying for a credit card. One of the activity can be the Offer activity that offers the low interest rate.
    2. Create or import a decision model InterestRates, and activate it. Use the activated decision in your application so that it is present under Decisions in the Process Application page.

      Description of example-dmn-dp1.png follows
      Description of the illustration example-dmn-dp1.png

      The InterestRates decision model’s logic decides if a customer is eligible for a low interest rate offer (when the Offer activity gets activated), depending on the credit score and debt-to-income ratio.

      • Low interest rate is available if the credit score is greater than 750
      • Low interest rate is also available if the credit score is greater than 650 and the debt-to-income ratio is less than 15%
    3. Create a form with relevant fields such as Credit Score and Debt To Income Ratio whose values are used as input for the decision. Set the dynamic process to start with the form.
  2. Configure data and its flow in the dynamic process.

    Use the GetInterestRatesOfferInput business object from the decision’s services in the Start form of your dynamic process. This ensures that the values entered in the Credit Score and Debt To Income fields flow into the InterestRates decision model from the dynamic process.

  3. Configure the decision's condition from the properties pane of the activity that you want to activate.
    1. Open the properties pane of the Offer activity and create an activation condition. In the resulting Activation pane, click the Create Data Condition icon to create a data driven condition.
    2. In the Create Data Condition dialog box, name the data driven condition as DMN Condition.
    3. Select Decision as the condition type.
    4. Select InterestRates as the decision model, and GetInterestRatesOffer as the decision service.
    5. In the Map Input Values fields, the input value (body) from the decision model is auto-populated. Map the input value to the form's data object formArg.getInterestRatesOfferInput.

      When the user enters values into the fields Credit Score and Debt To Income, the values flow into the decision model as input values, and the decision logic gets executed.

    6. Finally, define the condition in the Condition fields. Set body.interpretation is equal to output.true. This means if the response of the InterestRates decision model is true, then the Offer activity gets activated.

      Description of example-dmn-dp3.png follows
      Description of the illustration example-dmn-dp3.png

      Note that output is the data type you create in the dynamic process. It contains the possible interpretation types (TRUE, FALSE) from the InterestRates decision model.

      Description of example-dmn-dp4.png follows
      Description of the illustration example-dmn-dp4.png

  4. Try out the application in runtime as an end user.

    Begin by test activating the application to validate and make it available in runtime.

    1. Enter some values in the start form. Submit the form to create a dynamic process instance.
    2. Select and open the dynamic process to see the list of activities.

      The InterestRates decision uses the values submitted in the start form (Credit Score:800 and Debt To Income=10) as inputs, and the resulting output is true as the defined rule creditScore >650 and debtToIncome <15 is fulfilled.

      As the condition defined for activating the Offer activity fulfills, therefore we can see the Offer activity in the activity list.

      Try out the instance again by entering different values in the start form. You’ll observe that the Offer activity is not visible (that is, it doesn’t get activated) if the defined decision condition doesn’t fulfill.

You've successfully defined a decision sentry in a dynamic process.