Analytics Builder 10.16.0 | Using Analytics Builder for Cumulocity IoT | Understanding Models | Models
A model is a container which can have a network of blocks connected to each other with wires.
The behavior of a block inside a model does not depend on other blocks. There can be multiple instances of the same block in a model where each instance may behave differently, depending on the configurable parameters or the inputs connected to the block.
You can create two different types of models: models without template parameters and models with template parameters.
Models without template parameters
All blocks in the model use defined input devices or device groups and contain defined parameter values. Such a model can be activated immediately in the model manager.
Models with template parameters
A model in which one or more template parameters are defined is called a template model. Template parameters can be bound to any number of block parameters, provided that the type of the block parameter is the same as that of the template parameter.
For example, you can define a template parameter for the device name and another for the threshold value. These template parameters can later be set individually in the different instances of the model. For example, one template parameter can specify a device which can then be used for several input and output blocks. Or one instance can use device ABC with a threshold value of 100, and another instance can use device XYZ with a threshold of 200. Models with template parameters are not activated directly in the model manager. You have to create at least one instance of the model, and you can then activate each instance separately using the instance editor.
The scope of the template parameters is local to the model in which they are defined. In other words, template parameters defined in one model cannot be used in any other model that is deployed in same tenant or subtenant. The names of the template parameters must be unique within the scope of the model in which they are defined.
There are two relevant roles for this type of model, this can be the same person or different persons:
*Model author
The model author creates the model and defines all of its blocks, parameters and wires. Most importantly, the model author creates the template parameters and binds them to the appropriate parameters in selected blocks.
*Instance maintainer
The instance maintainer creates the instances of the model and assigns values to the template parameters that are to be used by each instance.
The model author has the following options to define a template parameter:
*It can have default value which is provided as the default value in the instance editor. The instance maintainer may then leave it at the default value or change it to another value.
*It can be optional. The instance maintainer then has the possibility to either provide a value or leave it blank.
*It can be required. The instance maintainer must then provide a value. A required value is one that is not optional and has no default value.