Expertsystemen

 

Node Execution Order

To build predictable and bug-free logic, it is essential to understand that a node follows a strict top-to-bottom execution order. The placement of your rules relative to each other and to your interfaces determines when they are triggered.

If this execution order is not adhered to, the rules in the node may not work as intended or at all.

1. Pre-Interface Phase (Initialization)

Before anything is shown to the end-user, the system executes all rules located at the top of the node.

Purpose
Preparing the environment and setting default values.
Common actions
initvar(), setproperty(), or setmetadata().
Key Concept
Use this phase to ensure that when the user sees a question, all underlying variables are already correctly initialized.

2. The Interface Phase (Interaction & Data Retrieval)

This phase contains everything the user interacts with or everything that fetches data from external sources.

Elements
Text blocks, input questions, and ‘Interfaces and connections’.
Behavior
The system processes these elements at once. Their order in the action lists defines their place on the screen.
Key Concept
If a question depends on data from an external Interface, put the external interface connection in a node preceding the one where it is used in a question.

3. Post-Interface Phase (Processing & Routing)

Rules placed at the very bottom of the node, below all interface elements, are only executed after the user triggers a transition (e.g., clicks ‘Next’).

Purpose
Calculating results based on user input and determining the path to the next node.
Common actions
Complex calculations, if/else logic for routing, and final data transformations.
Key Concept
Logic placed here cannot change what the user sees on the current node, as the interface has already been processed.

Summary for Modelers

Top of Node
“Prepare the variables.”
Middle of Node
“Show texts, ask questions, and trigger external interfaces and connections.”
Bottom of Node
“Process the results and decide where to go next.”