With the help of the class ITPMessage, ITPElement implements a messaging mechanism in the tree. As a result of this, elements in the tree can communicate without knowing each other. An element may send a message by calling the function bubbleUp. This sends the message to the parent element, so that it will end up at the root node of the tree. From this point the message will be broadcasted down the tree, allowing each node to react to and modify the message. The latter may involve attaching of an answer, or marking the message as shouldStop in which case broadcasting will be stopped.
This mechanism is for instance used to notify other nodes of a change in an answer. The class ITPGroup will modify the visibility of a group if there has been a relevant change to the answer of its corresponding toggle question.