Tree Nodes are one of Zingtree’s most popular decision tree building features. By allowing one tree to launch another, you can better organize your work and use smaller components repeatedly as a part of larger processes.
For example, a hardware company that makes lots of products may have a specific troubleshooting process for power-on problems that are common to many trees. By linking to a subtree, this troubleshooter can be authored just once, and used from several different trees.
A common request when implementing tree nodes is to be able to automatically return to the original decision tree that launched the process – just like a return statement in any programming language. This is done using a special type of tree node that is labeled as “return to previous tree.”
Summary: Setting Up a Return to a Previous Tree
Setting up a return tree node requires these steps:
- Create a tree node in the starting tree, and specify a node number to return to.
- In the subtree, use a tree node selected as return to previous tree. When this node is reached, the return node in the calling tree appears next.
Setup: Step by Step
- Create your starting tree and the subtree that will be launched from the starting tree.
- In the starting tree, create a tree node. Include the tree to launch, as well as a node in the starting tree that you want to return to when the subtree is finished (highlighted in red below). It looks like this when editing a tree node:
- In the subtree, create a new tree node and specify it as “return to previous tree.” Like this:
When the “return to previous tree” node is reached in the subtree, the return node from the starting tree will appear.
Thanks for Shawn G. and others for the inspiration!