Views:

Training Module Overview

This module introduces the trainee to the Decision Table and Process Genie functionality of North52 Business Process Activities (BPA). It is expected that you have completed Training Module 1 and have access to a CRM system with the latest version of North52 BPA.

Objectives

The objectives are to:

  • Understand the capabilities of the Decision Table functionality
  • Create a single condition Decision Table for the Account entity
  • Create a multi-condition Decision Table and use it within a CRM workflow process (Process Genie)
  • Create a multi-condition Decision Table used for validation

High-level Steps

  1. Review the Decision Table functionality
  2. Create a Save – Perform Action formula with a Decision Table
    1. Create the formula
    2. Test the formula
  3. Create a Process Genie formula with a Decision Table
    1. Create the formula
    2. Reference the formula in a CRM workflow
    3. Test the formula
  4. Create a Validation formula with a Decision Table
    1. Create the formula
    2. Reference the formula in a CRM workflow
    3. Test the formula

Detailed Steps

Each of the high-level steps above are explained below in step-by-step detail to help you complete the training.

Decision Tables

Why Decision Tables?

In today’s fast-moving world software designers are being asked to automate the decision-making processes by putting business rules front and centre and not hidden behind layers of software coding.

The workflow designer in Dynamics 365 is a good example of this with a visual designer to create business processes. We believe that North52′s Decision Tables will turbocharge business rules / processes within Dynamics 365.

A Decision Table represents multiple related business rules by using conditions, actions and data values in a spreadsheet-style table. The decision table uses columns for the conditions and actions of the rules and rows to represent the associated data values.

Decision Tables allow you to create business rules in an easy to understand format which is different to the traditional IF-Then-Else rule formats.

Key Features

  • Simple visualization in a compact table format
  • Quick to read and understand, very little lost in translation.
  • Facilities a common understanding between tester, business analyst, project manager, developer, domain experts, etc.
  • Promotes grouping of rules in a single table. In an Eligibility example for a credit card you will naturally group the rules for Gold Card, Platinum Card, etc. into separate tables.
  • Really allows for domain experts and business analysts to gain control over the business logic

Creating a Decision Table

For our training exercise you are going to execute the Decision Table from a workflow, so we will be using the Process Genie formula type. The Decision Table itself will resolve around Credit Card Eligibility e.g. does a contact qualify for a credit card.

Import the Training solution

Import the training solution included in the training zip file:

  1. Navigate to Settings > Solutions
  2. Click the Import button
  3. Locate the North52Training_1_0_0_3_managed.zip solution file and complete the import step accepting the default options
  4. Click the Publish All Customizations button

Exercise 1: Simple Decision Table

This Decision Table will set the Credit Limit of an Account based on its Annual Revenue.

  1. Create a new formula
    1. Navigate to Settings > North52 > North52 Formula
      1. Click the New button
      2. Step 1: leave the Account entity selected
      3. Step 2: select the formula type to be Save - Perform Action
      4. Step 3: select the Decision Table editor
      5. Click the Create button
  2. Within the Source & Target section:
    1. Set the Source Property to be Annual Revenue
  3. Click Save

What are Conditions?

Conditions are prerequisites for Actions.

What does that actually mean? When certain conditions are met, the action will be triggered. For example, a condition might be that when the Annual Revenue of an account is greater than $1,000,000 then the Credit Limit on that account should be set to $75,000.

To set a Condition you click on the blank yellow field under Condition and then click on the Source tab on the left-hand configuration pane and then click on the field you want to set as your condition. 

In this instance we are going to use Annual Revenue.

  1. Click on cell A2 in the Decision Table
  2. Click on the Source tab
  3. In the Search source… field enter Annual
  4. Expand the Source folder
  5. Click on Annual Revenue to add this to the Decision Table

Now that we have selected that Annual Revenue will be our condition, we need to specify what exactly the condition will be.

  1. In cell A4 enter >1000000
  2. In cell A5 enter <1000000

This tells the Decision Table that we want to do 'Something' when the Annual Revenue is greater than $1,000,000 and to do something else when it is less than $1,000,000.

What are Actions?  

Actions are the desired outcomes you want. In this example the Action is that we want to set the value of the Credit Limit field on the Account.

  1. Click on cell B2
  2. Click on the Source tab
  3. Enter Credit in the search field
  4. Expand the Source folder
  5. Click on the Credit Limit field to add this to the Decision Table

The business rule required is: if the Annual Revenue is greater than $1,000,000 then the Credit Limit should be set to $75,000. However, if the Annual Revenue is less than $1,000,000 then the Credit Limit should be set to $25,000.

  1. Enter 75000 in cell B4 and 25000 into cell B5
  2. Click Save
  3. Test the Decision Table
    1. Navigate to Sales > Customers > Accounts
    2. Open any Account record
    3. Set the Annual Revenue field to be $500,000
    4. Click Save
    5. Check the Credit Limit field has been set to $25,000
    6. Set the Annual Revenue field to be $1,500,000
    7. Click Save
    8. Check the Credit Limit field has been set to $75,000

Note : If you can’t see Annual Revenue or Credit Limit, you may need to install the sample data set provided by Microsoft. Please go to Settings >System > Data Management > Sample Data and follow the steps provided.

Process Genie

Process Genie is a single custom workflow activity that gives you access to all the power of our BPA engine. Instead of maintaining your own library of custom workflows activities all you are likely to need is Process Genie.

You can use Process Genie in any of your CRM Processes:  Workflows, Dialogs or Actions. It works with real-time or background processes.

It is extremely easy to use:

  1. Create your Process Genie Formula
  2. Add the Process Genie step in your CRM Process and reference your Process Genie Formula
  3. (Optional) Use the result of the Process Genie Formula in following steps of your process

Exercise 2: Multiple condition Decision Table and Workflow (Process Genie)

For this training exercise you are going to execute the Decision Table from a workflow, so we will be using the Process Genie formula type. The Decision Table itself will resolve around Credit Card Eligibility – e.g. does a contact qualify for a credit card.

  1. Create a new formula
    1. Navigate to Settings > North52 > North52 Formula
      1. Click the New button
      2. Step 1: select the Contact entity
      3. Step 2: select the formula type to be Process Genie
      4. Step 3: select the Decision Table editor
      5. Click the Create button
  2. Click Save
  3. Select a cell within column A and Right-click on the Decision Table editor canvas to bring up the contextual menu:
  4. Select the Insert > Insert Condition option to insert a new condition column
  5. Repeat the Insert Condition process again so that you have 3 condition columns:
  6. Using your mouse select cell A2 as shown above
  7. Click on the Source tab
    1. In the Search Source text box type Annual
    2. Expand the Source node
    3. Click the field named Annual Income to add this to the Decision Table
  8. Using your mouse select cell B2
  9. Click on the Source tab
    1. In the Search Source text box type Total
    2. Expand the Source node
    3. Click the field named Total Assets of Applicant to add this to the Decision Table
  10. Using your mouse select cell C2
  11. Click on the Source tab
    1. In the Search Source text box type Credit Score
    2. Expand the Source node
    3. Click the field named Credit Score to add this to the Decision Table
  12. Using your mouse select cell D2
  13. Click on the Source tab
    1. In the Search Source text box type Credit Card
    2. Expand the Source node
    3. Click the field named Credit Card Type {Value} to add this to the Decision Table
  14. Expand the node named 'Credit Card Type {Value}'
  15. Using your mouse select cell D4
  16. Under the Source tab click the field named Platinum
  17. Position your mouse over the bottom right corner until the cursor is like a cross-hair
  18. Using your mouse drag down until as far as cell D15
  19. Using your mouse select cell A4
  20. Copy into your clipboard the data below. The values inside double parenthesis and separated by a comma is treated a between condition value (see more about condition values here)

< 100000

< 100000

< 100000

((100000, 150000))

((100000, 150000))

((100000, 150000))

((150000, 200000))

((150000, 200000))

((150000, 200000))

> 200000

> 200000

> 200000

  1. Paste this into cell A4
  2. Using your mouse select cell B4
  3. Copy into your clipboard the data below

< 500000

((500000, 1000000))

> 1000000

< 500000

((500000, 1000000))

> 1000000

< 500000

((500000, 1000000))

> 1000000

< 500000

((500000, 1000000))

> 1000000

  1. Paste this into cell B4
  2. Using your mouse select cell C4
  3. Copy into your clipboard the data below

> 188

> 180

> 172

> 164

> 159

> 151

> 145

> 134

> 131

> 124

> 120

> 112

  1. Paste this into cell C4
  2. Click Save
  3. Copy the formula Short Code from the top right-hand corner of the form
  4. Navigate to Settings > Process Center > Processes
  5. Click New
    1. Enter Decision Table Test in the Name field
    2. Select Workflow as the Category
    3. Select Contact as the Entity
    4. Click OK

Note: If you have a pop-up blocker active (such as adblock), this may cause this process to fail. We advise turning it off for your hostname.

  1. On the Process form:
    1. Check As an on-demand process from the Available to Run section
    2. Uncheck Record is created from the Options for Automatic Processes section
    3. Click Add Step and select North52 > N52 Process Genie
    4. Enter Check Eligibility as the description for the Process Genie step
    5. Click the Set Properties button
    6. Enter the Short Code from your formula in the Formula ShortCode field
    7. Click Save
    8. Click Activate, and confirm the activation
    9. Close the window
  2. Navigate to Sales > Customers > Contacts
  3. Open a Contact record
  4. Set the following fields values and click save

Field Name

Field Value

Annual Income 

250000

Total Assets of Applicant

200000

Credit Score

198

                                   

  1. Click on the ellipses (…) More Commands menu and select Run Workflow
  2. Select Decision Table Test and click the Add button
  3. Confirm the Application of Workflow by clicking the OK button
    1. The Process Genie formula will execute as part of the workflow process
  4. The Contact record will be updated with a Credit Card Type of Platinum. You may need to refresh.
     

Exercise 3: Validation Decision Table

Scenario: You need to validate the Start and End Times on an Appointment has been set to a valid working time.

To build this formula use the following steps:

  1. Create a new formula:
    1. Navigate to Settings > North52 > North52 Formula
      1. Click the New button
      2. Step 1: select the Appointment entity
      3. Step 2: select the formula type to be Validation
      4. Step 3: select the Decision Table editor
      5. Click the Create button
  2. Set the Mode to Server Side
  3. Set the Event to Create & Update
  4. From the Source and Target section, set the Source Entity field to Appointment
  5. Set the Source Property fields: In the Server Side Properties section select End Time, then CTRL-Click to select Start Time as the second option.
  6. Click Save
  7. Click into cell A2
  8. Click on the Source tab
  9. In the Search source… input box enter ‘start
  10. Expand the Source node
  11. Click on Start Time to add this to cell A2
  12. Right-Click in column A and select Insert > Insert Condition from the contextual menu
  13. Click into cell B2
  14. Click on the Source tab
  15. In the Search source… input box enter ‘end
  16. Expand the Source node
  17. Click on End Time to add this to cell B2
  18. Click into cell A4
  19. Click on the Functions tab
  20. In the Search functions… input box enter ‘isworking
  21. Expand the Date node
  22. Ctrl + Click on the IsWorkingDay function to add this to cell A4

    Note: Ctrl + Click on a function will add it to a cell within {{{ }}} – this shorthand will use the value of the field/variable referenced in row 2 of the column as it’s parameter. Alternatively you could use the function in its full form: IsWorkingDay([appointment.scheduledstart]). Only functions which can take a single parameter can be used in this way.
  23. Click into cell B4
  24. Ctrl + Click on the IsWorkingDay function to add this to cell B4
  25. Click in the Action column C and cell C4
  26. Enter the text string ‘NoOp’ including the single quotes

    This says that if both the Start Time and End Time are both working days do nothing (NoOp = No Operation)
  27. Click in cell C5
  28. Enter the text string 'Start or End time for the Appointment is not a working day' including the single quotes. Expand the width of column C to make it more readable (you can double click on the right side of column C and it will automatically expand to the width of the contents in the cells below:

    This row acts as a default action as there are no conditions associated with it. If row 5 conditions are not met, then one of the Start or End times for the appointment must fall on a non-working day.
  29. Click Save
  30. Check the Syntax of your formula by pressing on the Syntax check button
  31. If everything is ok, then the following notification will be displayed:
  32. The formula is now ready to test. We need to set up at least one business closure date to test against.
    1. Navigate to Settings > Business > Business Management > Business Closures
    2. Click New
    3. Set a date, keeping the All Day Event checked
    4. Click OK
  33. Create a new Appointment record, set the Start Time and End Time to the day that your business closure was set
  34. Click Save, and the validation will take place and present the error message specified in the formula to the end user:

Further Reading

For more in-depth information, more complex examples and reference material about Decision Tables please refer to our Support website