The sub engine creator is solely responsible for creating new engines specifically designed to execute sub-models at runtime.

1. Signature

This section further outlines the signature of the interface before describing where the framework will access the methods in relation to sub-model handling.

ISubEngine create(IContext currentContext, IModel model, ISubModelNode currentNode);

Creates a new sub-engine using the super-engines context, the model to execute and the executing node

2. ISubEngine

ISubEngine mostly functions as a marker interface to indicate this engine is executing a sub-model. It also offers some utility functions in order to access necessary entities in its super-engine.

IModel getModel();

Returns the model which will be run by this engine

Set<ModelMapping> getModelMappings();

Returns a set of entities which resemble in-/outputs of the sub-model

3. Sub-Model Handling

The sub-engine creator interface is solely used in order to run enable PAK to run models, that contain sub-models. The engine containing the root model will create all necessary sub-engines to run all possible sub-models before starting its execution. During this process create(context, model, node) is called once for each sub-model that is present in any model.