Model Lifecycle
Once a new model is created or reinitialized after server startup, it goes through a fixed lifecycle:
- First, "valid" data source contexts are found in accordance with model type:
- If the model is absolute, its data source is the model context itself.
- If the model is relative, the server calculates its validity expression for every context in the system to define whether it's "compatible" with the model.
- If the model is instantiable, the server calculates its validity expression for every context in the system and adds a child container for models of this type to each context the model is valid for. Those containers host model instances.
- Second, model adds definitions of its variables, functions and events to every valid context:
- The context of an absolute model itself.
- All contexts a relative model is valid for.
- All instances of an instantiable model that are already defined in containers found during the first step.
- Third, model also adds functions referring model's rule sets to all valid contexts.
- Fourth, the model initializes its bindings' activators so that events and changes in source contexts will trigger model binding processing.
Normal Model Operation
Once initial startup in completed, the model switches to wait mode. Its further activities:
- Periodic model bindings are processed upon schedule, causing the model to process corresponding bindings
- Some server context events of variable value updates can also cause activation of certain model bindings
- Other system components read/write model properties and execute model functions
Was this page helpful?