HELP!

Part 1: Building the Knowledge-base

To follow this tutorial and build the Expenses Claim Authorisation knowledge-base please log into your Viabl.ai platform. If you have no user account then please contact your Viabl.ai Platform administrator to set up your user account.

1.1 Creating your Knowledge-base

To create a new knowledge-base click on the green + icon on the bottom right side of the page.

Select the template: "General Knowledge-base"

Select the deployment mode: "Chat"

Enter the new knowledge-base name: "Expenses"

1.2 Creating your first object

1.2.1 From within your open "Expenses" Knowledge-base you will see an open Main_Decision_Flow Tree editor:

  • Right-click on the "Done" node on the Main_Decision_Flow Tree editor (or click on the burger menu next to Done) and select Add a New User Interface Object... then Add a Report
  • Follow the instructions on each page to complete the process of creating a new Report object:
    • Enter Name: "Intro_Report"
    • Description: ""
    • Select Category: "Dialogs & Reports"
    • Enter Text: "Welcome to my expenses tutorial"

1.2.2 Save and Test Run

  • Click the Save icon on the Report editor
  • Press F9 or click the Test Run button.
  • Select the Chat mode (if more than one was selected when creating the knowledge-base)
  • You should now see the text content of the Intro_Report displayed on a second browser tab.
  • Close this tab and go back to the Viabl Platform tab
Please note: If nothing happens when you attempt to **Save and Test Run**, please check that your pop up blocker has been disabled for the Viabl Platform

1.3 Building your Main_Decision_Flow tree

From within the Main_Decision_Flow Tree editor:

  • Right-click on the "Done" node and Add Knowledge after the Intro_Report
    • Name: "Expenses"
    • Knowledge Representation: "Decision Tree"
    • Category: "Knowledge"
    • Output Type: "List""
    • Outcome values: "Pass" & "Reject"
    • Multi-select: leave unchecked (N.B. Please note this is NOT a multi-select type of question)
    • Type of split: "Multi-way Split"

  • Right-click on the "Done" node and Add a New User Interface Object... then Add a Report after the "Pass" branch
    • Name: "Pass_Report"
    • Description: ""
    • Category: "Dialogs & Reports"
    • Type text: "This claim has been approved"

  • Right-click on the "Empty" leaf and Add a New User Interface Object... then Add a Report after the "Reject" branch
    • Name: "Reject_Report"
    • Description: ""
    • Category: "Dialogs & Reports"
    • Type text: "This claim has been rejected"


  • Set the Empty leaf node on the Main_Decision_Flow tree to "Done". To do this, right-click the "Empty" and select "Edit" (or double-click the Empty leaf) and choose the "Done" outcome.
  • Save and Test Run (see section 1.2.2)

1.4 Building the Expenses tree

1.4.1 Open the Expenses decision tree editor by double-clicking the Expenses node and add the following decision tree logic:

  • Right-click on the "Empty" leaf node and Add a New Question:
    • Name: "Employment_Grade"
    • Description: "What is the claimant's employment grade?"
    • Category: "Questions & Attributes"
    • Type: List
    • Values: "Director", "Senior Manager" & "Junior Manager"
    • Multi-select: leave unchecked
    • Type of split: "Multi-way Split"
  • Set the "Empty" leaf node on the "Director" branch to "Pass"
  • Save so that the Decision Map view is updated to reflect this new object

1.4.2 For the "Senior Manager" branch, right-click the "Empty" leaf node associated with this branch and select Add Knowledge then Add a Decision Tree

  • Name: "Hotel"
  • Knowledge Representation: "Decision Tree"
  • Category: "Knowledge"
  • Output Type: "List"
  • Outcome values: "3 Stars", "4 Stars", "5 Stars"
  • Multi-way Split
  • Set the Outcome Leaf with the "3 Stars" branch to "Pass"
  • Set the Outcome Leaf with the "5 Stars" branch to "Reject"

Alternative method for creating the Hotel Tree

A Question can easily be 'upgraded' to a Decision Tree, and if required a Decision Tree can be 'down-graded' to be just a Question. Often what starts as a simple question evolves so that its outcome is dependent on knowledge.

Right-click on the "Empty" leaf node at the end of the branch with "Senior Manager" and Add a New Question:

  • Name: "Hotel"
  • Category: "Questions & Attributes"
  • Type: List
  • Values: "3 Stars", "4 Stars", "5 Stars"
  • Multi-select: leave unchecked
  • Type of split: "Multi-way Split"
  • Set the "Empty" leaf node on the "3 Stars" branch to "Pass"
  • Set the "Empty" leaf node on the "5 Stars" branch to "Reject"
  • Save so that the Decision Map view is updated to reflect this new object

Right-click on the "Hotel" object in the Decision Map view and select Add Knowledge to a Question:

  • Select "Decision Tree" for the type of knowledge to add

1.4.3 Add a New Question to the end of the branch with "4 stars" by right-clicking the associated "Empty" leaf node.

  • Name: "Department"
  • Description: "Select the claimant's department"
  • Category: "Questions & Attributes"
  • Type: List
  • Values: "Sales & Marketing", "Accounts" & "HR"
  • Multi-select: leave unchecked
  • Type of split: "Single Branch Split"

1.4.4 To expand on each branch and select different outcomes

  • Right-click on the values of the "Department" question (or alternatively highlight the values and access the burger menu) and select Add a New Branch.
  • On the new branch double click to select values and pick "Accounts" & "HR"
  • Set the "Empty" leaf node for the "Sales & Marketing" branch to "Pass"
  • Set the "Empty" leaf node for the "Accounts" & "HR" branch to "Reject"


1.4.5 Add the Hotel object to the end of the branch with "Junior Manager" by right-clicking the associated "Empty" leaf node and then selecting Add an Existing Object; a list of existing objects will be presented, select Hotel then choose the Single Branch Split option. Right-click the values of Hotel to Add a New Branch, and then double click on the new branch and select check boxes for "4 Stars" & "5 Stars" then set the Leaf nodes as follows:

  • Set the "Empty" leaf node for the "3 Stars" to "Pass"
  • Set the "Empty" leaf node for the "4 Stars" & "5 Stars" to "Reject"
  • Save and Test Run (see section 1.2.2)

1.5 Building the Hotel tree

1.5.1 Open the Hotel tree by double clicking it in the Expenses tree or by double clicking it in the left-hand Decision Map view. If the Expenses tree hasn't been saved then a prompt will be presented before the Hotel tree is opened - just select "Yes" to Save changes to [Expenses]?

In the Hotel tree editor build the logic as follows:

  • Add a New Question:
    • Name: "Total_Hotel_Cost"
    • Description: "What is the total cost for the hotel?"
    • Category: "Questions & Attributes"
    • Type: Numeric
    • Decimal Places: 2
    • Minimum: 0
    • Maximum: 9999
    • Multi-select: leave unchecked
    • Type of split: "No Split"

1.5.2 Add a New Question immediately after Total_Hotel_Cost

  • Name: "Number_Nights_Stay"
  • Description: "How many nights stay at the hotel?"
  • Category: "Questions & Attributes"
  • Type: Numeric
  • Decimal Places: 0
  • Minimum: 0
  • Maximum: 99
  • Multi-select: leave unchecked
  • Type of split: "No Split"

1.5.3 Add a New Calculated Question immediately after Number_Nights_Stay

  • Name: "Hotel_Cost_Per_Night"
  • Category: "Knowledge"
  • Calculation Result Type: Numeric
  • Scripting Language: XpertScript
  • Decimal Places: 0
  • Script: Assign Hotel_Cost_Per_Night = Total_Hotel_Cost / Number_Nights_Stay see Tip below
  • Multi-select: leave unchecked
  • Type of split: "Multi-way Split"
The XpertScript editor helps to build valid scripts, carry out the following steps to construct the assignment above:
  • part of the script will be pre-built with the Assign command, the object name and the equality sign
  • click on the "edit" point in the XpertScript window
  • select the Object tab, scroll down and select Total_Hotel_Cost
  • click the "…" to add the division operator "/"
  • click the "edit" point and from the Object tab select "Number_Nights_Stay"

1.5.4 Right-click one of the branches of the "Hotel_Cost_Per_Night" and use Add a New Branch to add 2 more branches.

  • Define the thresholds for the branches of "Hotel_Cost_Per_Night". Double click the branch and update the comparitor/threshold so that the first branch has (<50), the second branch has (>=50 <100), the third branch has (>=100 <150) and the last branch has (>=150).
  • Set the outcome of the (<50) branch to "3 Stars"
  • Set the outcome of the (>=150) branch to "5 Stars"

1.5.5 Add a New Question to the (>= 50 <100) branch:

  • Name: "Central_London_Hotel"
  • Description: "Is the Hotel located in central London?"
  • Category: "Questions & Attributes"
  • Type: Boolean
  • No Default Value
  • Multi-way Split
  • Set the outcome for the "Yes" branch to "3 Stars"
  • Set the outcome for the "No" branch to "4 Stars"
  • Drag and drop "Central_London_Hotel" from within the tree onto the end of the (>=100 & <150) branch question and when prompted select "Copy Sub Tree"
  • Set the outcome for the "Yes" branch to "4 Stars"
  • Set the outcome for the "No" branch to "5 Stars"

1.5.6 The final "Hotel" Decision Tree will look like the image on the right.

  • Save and Test Run (see section 1.2.2)
Select different combination of values for "Employment_Grade", "Total_Hotel_Cost", "Number_Nights_Stay", "Central_London_Hotel" & "Department" to test for Pass or Reject.

1.6 Modifying the Decision Map Settings

The Decision Map has a mini-menu icon with optional settings that control what is displayed on the Decision Map.

Open this menu and select both of the options checked in the screenshot.

Select the Show Objects Referenced in Scripts setting will extend the Decision Map to include objects used in the calculated object Hotel_Cost_Per_Night

You can also choose to select the Show Dialog & Report Objects settings if you wish to see these Objects on your Decision Map.

On This Page