You want to select and run a decision tree.
Step-by-step guide
To use a decision tree follow these steps:
Create a decision tree
First create a decision tree.
- Create a new decision tree in Studio.
- Enter name and display name.
Close the general tab.
Start building the decision tree by selecting an attribute for the first question ( condition node ).
Please note attributes used in decision trees must belong to a singleton entity
- For each possible answer you can select another node via the resource centric controls.
- A decision tree must end with a result node (container, asset, tree or action).
- In order to be able to search for a decision tree you must enter one or more symptoms in the symptoms tab on the right.
- Save and close the decision tree when it is finished.
Create a decision tree selector
- Create a new container.
- Enter the name.
- Select AQ_DecisionTreeSelector as the container type.
- Close the general tab.
- Enter the name of an attribute which holds the search query.
This attribute must belong to a singleton entity and will be placed on the page by the AQ_DecisionTreeSelector container.
- Enter the names of the buttons that will be used to search for (matchbutton) and select (selectbutton) a decision tree.
- The AQ_DecisionTreeSelector uses a trigram matching algorithm to determine which decision tree symptom matches with the search query and calculates an overall score for each decision tree.
Optionally you can enter a threshold ( percentage ) or a max number of results that are displayed.
Save and close the container when it is finished.
Create a decision tree evaluator
- Create a new container.
- Enter the name.
- Select AQ_DecisionTreeEvaluator as the container type.
- Close the general tab.
- Enter the names of the buttons that will be used to display the continue and retry button.
- Optionally you can enter the name of the decision tree if you would like to start a decision tree immediately without using a AQ_DecisiontreeSelector.
- Optionally you can choose to not ask prefilled questions by setting the skip-filled-question parameter.
- Optionally you can show derived answers by setting the show-implicit-answers parameter.
- Optionally you can display answered questions as read-only with the answers-readonly parameter.
- Optionally you can display action attributes with the show-attribute-solution parameter.
- Save and close the container when it is finished.
Create a decision tree flow
- Now that you have created all individual components you can create the following flow, to search for and execute a flow.
- Create a page containing the decision tree selector. In our example we named this page advice.
- Create a sub flow to evaluate the tree.
- In the sub flow create a page (on which the decision tree evaluator is placed) and a condition node to fetch the system.event.
Please note: the decision tree evaluator still uses actions to navigate a flow. Which actions are available are described in the reference guide.
- Save the flow.
- Test your decision tree in the runtime.
See also: Decisiontree example project.