You are viewing the documentation for Blueriq 14. Documentation for other versions is available in our documentation directory.
What is it?
A decision tree is a graphical representation of all alternatives in a decision making process.
Each node corresponds to a question (condition node) and the possible answers (attribute values) to that question. A leaf represents the conclusion based upon the path of given answers.
What does it do?
Decision trees are used for question scripts, i.e., when the outcome of a question determines the next step.
How to - create a decision tree
- Select the Home tab
- From the Logic group select the Decision tree icon
- Fill in the required fields
- Click on the arrow left of the word General to hide the General properties
- Build the tree
- Click Save or Save & close
Add or remove decision tree nodes
In the start situation you have to start with a condition node (or question): inside the node you can select the appropriate attribute.
When you hover over the condition node, you will see the resource centric control menu appear. You can add different nodes under the question for each possible answer to that question. You can add the following nodes.
Node type | Purpose |
---|---|
condition node | Ask for the value of an attribute (e.g. age). An attribute used in a condition node must belong to a singleton entity |
container node | Show the user a container. This can be useful to obtain information from the user that is not needed for the decision tree logic (e.g. in a decision tree that will determine what letter to send to you, you might ask the user his surname, regardless of the letter you are going to send him) |
asset node | Show the user a message |
decision tree node | Decision trees can be nested |
action (attribute) node | Set an attribute as the result of a decision tree |
Add or update symptoms
Suppose you have a large number of decision trees in a certain domain, for instance medical treatment. With these decision trees you are able to decide what a patient should do based on the symptoms he has. But it is not always obvious which decision tree applies to which symptom (also because in a large domain decision trees could overlap). Blueriq Studio deals with this problem by allowing you to specify which symptoms a decision tree covers. Then later on, you can use a special container which allows you a user to search for and start the right decision tree, based on the symptoms.
You can add symptoms in the symptoms edit box, right under the general tab. The symptoms are added in natural language (in the languages of your project).
Move a node or a branch
You can easily move a single node or an entire branch (a subtree) and connect it to another node by using drag and drop. When selecting a node in the tree, all nodes and branches below this node are also selected.
To move a node to another location in the tree
- Select the node you want to move.
- Drag towards the node you want to connect to.
- Drop the branch when the Drop beneath icon appears.
Convert a branch to a decision tree
You can convert a complete branch starting with a question into a new decision tree. When a tree gets too complex, it is recommended to divide your large tree into smaller sub trees. With this function you can decide to divide it in every stage of modelling.
- Select the question node which you want to convert to a new decision tree
- Select Convert to decisiontree
- Fill in the new decision tree fields
How to use a decision tree
A decision tree has to be explicitly called on a page to show it to a user, as opposed to a business rule that is evaluated when necessary. You can search for a decision tree based on its symptoms and then start it, but you can also start a decision tree directly.
A dynamic container is used for this. The dynamic container executes the tree and asks the user the questions that are defined in the tree. When the user answers, the dynamic container determines the next node to execute.
The dynamic container to search for a decisiontree is the Container type: AQ_DecisionTreeSelector. The dynamic container to execute a decisiontree is Container type: AQ_DecisionTreeEvaluator.