The model manager user interface
The model manager lists all available analytic models within the current Cloud of Things environment as cards. Each card shows the mode (such as Draft or Production) and state (Active or Inactive) of a model. You add new models and manage the existing models from here.
Each card that is shown for a model has an actions menu (the three vertical dots that are shown at the top right of a card) which contains commands for managing the model (for example, to export or remove the model).
To edit a model, you can simply click on the card that is shown for the model (see also Editing an existing model). When you add a new model or edit an existing model, the model editor is invoked in which you define the blocks and wires that make up a model. See Using the Model Editor for detailed information.
If one or more tags have been defined for a model, they are shown on the card for that model.
If you want to change the name, the description or the tags of an existing model, you have to do this in the model editor. See Changing the name, description, and tags of a model.
If you have a long list of cards, you can easily locate the model that you are looking for by entering its name in the Model name search box. Or you can enter part of the model name. For example, enter the word “test” to find all models that have this word in their names. The characters that you type in may be contained at any position within the model name. These search criteria are not case-sensitive. When search criteria are currently applied, an is shown next to the search box; click this to clear the search and thus to show all available cards.
You can also reduce the number of shown cards by using a filter. See Filtering the models for detailed information.
If is shown on the card of a deployed model, this model is no longer processing events. Move the mouse pointer over this message to display a tooltip with information on what went wrong.
See the Cloud of Things documentation for detailed information on the items that are shown in the top bar (application switcher and user button).
Filtering the models
The model manager offers several ways to reduce the number of shown cards, thus letting you quickly locate the models that you are looking for.
Filtering also works in combination with a model name that you specify in the Model name search box which is explained in The model manager user interface.
To filter the models
-
In the toolbar of the model manager, click More filters.
-
In the resulting dialog, select one or more filters.
You can filter the models according to the following criteria:
-
Mode
You can show only the models that are in a specific mode. For example, if you only want to see the models that are in simulation and test mode, select the corresponding check boxes.
-
Status
You can show only the models that are in either the Active or Inactive state. For example, if you only want to see active models, select the corresponding check box.
-
Device or device group
You can show only the models that use specific devices in their input blocks and output blocks, specific device groups in their input blocks, or even specific assets. Open the Filter by device or device group name drop-down list box, select one or more devices, device groups, and/or assets and click Apply.
-
Data point
You can show only the models that use specific data points, such as
c8y_TemperatureMeasurement
. This requires that at least one device has been selected in the Filter by device or device group name drop-down list box. Open the Filter by data points drop-down list box, select one or more data points, and click Apply. -
Tags
You can show only the models for which specific tags have been defined in the Model Configuration dialog box, which is shown when you add a new model or when you invoke that dialog box from the model editor (see also Adding a new model and Changing the name, description, and tags of a model). Open the Filter by tag drop-down list box, select one or more tags, and click Apply.
All of the above-mentioned drop-down list boxes include a Filter search box that you can use to reduce the number of items that are offered for selection. You can enter a name or part of a name. For example, enter the word “test” to show only the items that have this word in their names. The characters that you type in may be contained at any position within the name. These filter criteria are not case-sensitive. Clicking the All check box selects all items that are currently shown in the drop-down list box, depending on the contents of the Filter search box.
You can combine several types of filters, for example, to show only active models in production mode that use a specific device.
-
-
Click Apply filters.
The toolbar of the model manager now shows the types of filters that are currently applied. For example:
Click Clear filters in the toolbar if you want to clear these filters. Or to clear a specific filter, click on a filter icon in the toolbar, and deselect the filter in the resulting dialog box. Clicking Reset filters in that dialog box also clears the filters.
Adding a new model
When you add a new model, the model editor is invoked. See Using the Model Editor for detailed information.
Note: The new model will only be listed in the model manager, when you save the model in the model editor. See also Saving a model.
To add a new model
-
In the toolbar of the model manager, click New model.
-
In the resulting Model Configuration dialog box, enter a unique model name.
You can optionally enter a description for the model and one or more tags.
Tags are helpful for filtering the models in the model manager to show only the models for which a specific tag has been defined (see also Filtering the models). To add a tag, you simply type its name and press Enter or the Tab key. The tag is then shown in a colored rectangle. To remove a tag, click on the that is shown in the rectangle. The dialog prevents you from entering duplicate tags for a model; if you enter such a tag name, the duplicate tag is not added and the original tag blinks one time.
-
Click OK.
The model editor appears. See Overview of steps for adding a model for a brief overview of how to add blocks and wires to the new model.
Editing an existing model
You can edit each model that is currently listed in the model manager.
If a model is in the Active state, editing will set the model to read-only mode. In this case, the model editor only allows you to view the contents of the model (for example, you can view the block parameters). You can navigate and zoom the model as usual, but you cannot change anything. The save button in the model editor is therefore disabled.
To edit a model
-
In the model manager, click the actions menu of the model that you want to edit (or view) and then click Edit.
Or simply click the card that is shown for the model (but not on the toggle button for changing the state or the drop-down menu for changing the mode).
If the model is in the Active state, a dialog appears informing you that you can only view the model. When you click Continue, the model editor appears and you can view the model, but you cannot change it.
See Using the Model Editor for further information.
Deploying a model
A model can have one of two states. The current state is always indicated on the toggle button that is shown for a model:
- Active. This state indicates that the model has been deployed.
- Inactive. This state indicates that the model is currently not deployed.
The inputs that a model receives and what happens to its outputs depends on the mode to which the model is set. Each model can be set to one of the following modes:
- Draft. The model is still under development. (New models are created in draft mode.)
- Test. This mode is only permitted for models using a single device. When active, the model is deployed to the Apama correlator so that the measurements and events from the device are processed. The output of the model is only stored (and recorded as an
Operation
orMeasurement
object of a “virtual device”) and not sent back to the device. - Simulation. This mode is only permitted for models using a single device. When active, the model uses historical input data (replayed in real time from previously received data) and is deployed to the Apama correlator. The output of the model is only stored (and recorded as an
Operation
orMeasurement
object of a “virtual device”) and not sent back to the device. To start a simulation, you must define the time range from which the input data is to be used. When all data from the time range has been replayed, the model is automatically undeployed from Apama and the model state is changed to Inactive. The timestamps of the historical data entries remain unchanged for easier comparison of simulation runs. See also Model Simulation. - Production. When active, the model is deployed to the Apama correlator so that the measurements and events from the devices are processed. The output of the model is stored and sent back to the devices.
A model in draft mode can only be in the Inactive state. A model in test, simulation or production mode can be in either the Active or Inactive state.
When a model is imported by loading a JSON file, it is always imported as an inactive model.
To deploy a model
-
In the model manager, click the drop-down menu in the model that you want to deploy and select one of Production, Test or Simulation.
-
If you have selected simulation mode, click the calendar icon which is now shown, specify the time span that is to be used, and click Apply. See also Simulation parameters.
-
When the toggle button currently shows Inactive, click this button to change the state to Active. For simulation mode, you can only set the state to Active when a valid time range has been defined.
Undeploying a model
You can undeploy each model that is currently in production, test or simulation mode and for which the toggle button shows Active.
When you undeploy a model, the model is stopped and no longer processes incoming data. Any state built up in the model is lost. For simulation mode, this means that the model is stopped before all historical data from the specified time range has been replayed.
To undeploy a model
- In the model manager, click the toggle button in the model that you want to undeploy so that Inactive is then shown on the button.
Copying a model
You can copy each model that is currently listed in the model manager.
When you copy a model, the copy gets the same name as the original model followed by the number sign (#) and a number. For example, when the name of the original model is “My Model”, the name of the first copy is “My Model #1”. The number in the model name is increased by one with each subsequent copy that you create. The copy gets the same description as the original model. It is recommended that you edit the copy and give the model a meaningful name and description.
To copy a model
-
In the model manager, click the actions menu of the model that you want to copy and then click Copy.
A card for the copied model is immediately shown in the model manager.
Exporting a model
You can export each model that is currently listed in the model manager. This is helpful, for example, if you want to transfer a model from the current Cloud of Things tenant to a different tenant. The model is saved in JSON format.
To export a model
-
In the model manager, click the actions menu of the model that you want to export and then click Export.
The resulting behavior depends on your browser. The model is usually exported to the download location of your browser.
Importing a model
You can import a model that has previously been exported (in JSON format). This is helpful, for example, if you want to import a model from a different Cloud of Things tenant.
To import a model
-
In the toolbar of the model manager, click Import model.
-
In the resulting dialog box, navigate to the location where the model that you want to import is stored.
-
Select the model and click Open.
A card for the imported model is shown in the model manager.
Removing a model
You can remove each model that is currently listed in the model manager. When you remove a model that is currently deployed, it is first undeployed and then removed.
To remove a model
-
In the model manager, click the actions menu of the model that you want to remove and then click Remove.
-
In the resulting dialog box, click Remove to confirm the removal.
Reloading all models
You can refresh the display to show any changes other users have made since the page loaded, or to see whether deployed models have entered a failed state.
To reload all models
- In the toolbar of the model manager, click Reload.