PAK Core – Enabling Sub-Models
1. What you will learn
After finishing this tutorial, you will have a basic idea on how to register the necessary services in order to make use of PAKs sub-model feature.
2. Prerequisites
To complete this guide you will need:
-
Roughly 10 minutes
-
Basic understanding on how the engine works
-
Basic understanding on how to register services
3. How to enable Sub-Model handling
By definition, a sub-model does not differ from a IModel in any way. It merely functions as a naming convention to identify a model that is included inside another model. When a sub-model is executed, it is assigned an own engine. Such an engine is called a sub-engine. Each sub-engine may have at most one super-engine (parent engine), but can hold multiple sub-engines itself.
In order to enable sub-model handling in your engine, there are two major services involved.
-
The IModelCollector is responsible for resolving and fetching a models sub-models at runtime
-
The ISubEngineCreator is responsible for creating a new sub-engine based on the sub-model to execute
To enable sub-model handling for your application, simply register the two implementations for the interfaces described before via the service provider. Now your engine is locked and loaded to run models containing sub-models.