Reactions associated with variables: WHEN
VEs also have mechanisms for reacting to changes that occur to the ASSIGN or SAVEVALUE variables themselves during model execution.
Using the WHEN instruction, we can associate a variable with a procedure so that it is triggered whenever a write operation occurs that meets the specified conditions.
Its behavior is reminiscent of an ON_CHANGE associated with a variable, although WHEN allows different triggering conditions to be defined.
This allows the model to react to state changes without the need to continuously program monitoring routines.
Later, we will see how WHEN works and how it can be used to build reactive behaviors based on procedures and variables.