HELP!

Viabl.ai Object Inference

Object Inference in the Viabl.ai Platform is the process by which Viabl.ai Platform Objects (such as Questions and Decision Trees) acquire their value at runtime. Here Object refers to Objects derived from a Base Class which are broadly divided into the following categories:

  • Question Object acquires its value from the user via a User Interface

  • Knowledge Object acquires its value (typically referred to as Outcome or Decision) by executing one of the following Knowledge Objects:

    • Decision Tree
    • Decision Table
    • Decision Rules (typically leads to multiple Outcome values being selected in one go)
    • Lookup Table (typically leads to multiple Objects acquiring their values in one go)
    • Calculated Attribute (for example Numeric Objects typically assigned by mathematical formula implemented using XpertScript)
    • Decision Flow Tree is a type of Decision Tree used to represent process flow logic. It determines the sequence and the conditions under which other Viabl.ai Platform Objects are executed. By default, it has a single Outcome value (typically "Done") which can usually be ignored. Other Outcome values can be added to indicate different statuses at the end of a process. "Looping" can also be used to repeat certain sub-tree sections until a condition is met.
  • Attribute Object is, in effect, an "auto-answered" Question and is typically created using the same Add a Question Tool or the Add Calculated Attribute Tool. It differs from a Question in that that it acquires its value via a script assignment (which must be executed prior to the Attribute's execution or inside the OnCapture Event Script of the Attribute itself) and not via direct user input. Its value can come from any of the following:

    • Direct assignment to a constant, another variable or using a formula (typically implemented using XpertScript)
    • Derived by an algorithm such as for data manipulation (typically implemented using JavaScript)
    • Assignment to the value obtained from a call to an external web service such as a Database API (typically via JavaScript AJAX calls)

Other type of inferences provided by Viabl.ai include Dialog & Script Inferences.

The very first Object executed in a Knowledge-base is the one designated as the Start Object (set to the Main_Flow Object by default). Inference from other Objects are executed automatically when those Objects are subsequently encountered during the execution of Knowledge Objects (e.g. a Question inside a Decision Tree or a Decision Tree inside a Decision Flow Tree, etc.).

Object inference can also be triggered, at any time, from within a Viabl.ai Platform Scripts, using the Do statement (XpertScript) or the .run() method (JavaScript).

Dialogs can also be triggered by being set in the tiedDialog Question Object property.


Below is a Decision Flow Tree that describes the Object Inference process in the Viabl.ai (Click the image to make it larger):


The labels for each node in the above Decision flow Tree correspond to (a) object properties, (b) object events or (c) actions performed by the rules engine. The idea is to depict how inference reacts to each property value and each event. Please refer to the table below for a description of each node label.

For example: if we take the question branch on the tree, we can see as inference proceeds it will check the next object to see if has an empty value and check the isEmpty property. If isEmpty is set to true, inference will proceed along the yes branch, and onto the onCapture event. If the object is not empty it will proceed along the no branch to check if the object is dynamic. If it is not, inference will end. If the object property has been set to dynamic however, we will then proceed along to the onCapture event.

The isDynamic property plays an important role in Looping

When inference hits the next isEmpty, and the answer is yes, the action PromptForQuestion will be called, prompting for a value. If there is no value, a check will be made on the property to see if allowBlank is set to true or false. If true, inference will proceed to the onLeave event. If false, inference will loop back to the PromptForQuestion action.

Name Type Description
isempty Property The object does not have a value (true/false)
allowblank Property Allow Question with no value to be skipped during UI capture
isdynamic Property Determines if an Object that already has a value, is to be executed by the inference engine (true/false)
PromptOnBlank Property Prompts the user for a value during inference if it has no value
onCapture Event This Event script will be executed first when the object is encountered in inference
onLeave Event This script will be executed just before the end of inference
PromptForQuestion Action Prompts the user for a value

On This Page