Defining Information Models

This section details the following topics:

Information Models

Creating a New Information Model

Editing an Information Model

Information Models

Information models represent the capabilities of a particular type of device entirety. An information model contains one or more function blocks.

Creating a New Information Model

Prerequisites

You have create a function block model (refer to Creating a New Function Block Project).

Proceed as follows

  1. In the Vorto Model Project Browser, select the project in the Select Vorto Project drop-down list.
    Select a Project
  2. Right-click in the Information Models area and choose New Information Model from the context menu.
    The Create Information Model dialog opens:
    Create information model dialog
  3. Enter a name as Information Model Name, for example, PhilipsHue.
  4. Adjust the entries for the input fields Namespace and Version, if necessary.
  5. Optionally, enter a description in the Description entry field.
  6. Click Finish.
    The new information model (PhilipsHue) is created. Furthermore, the information model DSL source file (.infomodel) is generated and displayed in the model editor. The file contains a complete structure according to the DSL syntax with the values given in the preceding steps.
    Information model DSL editor

Editing an Information Model

Prerequisites

You have created an information model (refer to Creating a new Information Model).

Proceed as follows

Edit the information model by extending the generated source file in the information model DSL editor.

Example

  1. Drag and drop the data type Color from the Datatypes area into the ColorLight funciton block.
  2. Create a new function block model named Switchable and update it according the following:

     namespace com.mycompany.fb
     version 1.0.0
     displayname "Switchable"
     description "Function block model for Switchable"
     category demo	
     functionblock Switchable {
         status{ 
             optional on as boolean
         }
    	
         operations{
             on()
             off()
             toggle()
         }
     }
    
  3. Drag and drop the two created and edited function blocks from the Functionblocks area into the information model PhilipsHue in the Information Models area to create the reference.
    The updated information model appears as follows: Drag and drop from Function Block to Information Model