Previous Topic

Next Topic

Book Contents

Book Index

FIM to Vorto Model Mapping

Eclipse Vorto has been integrated with Eclipse Ditto. This integration opens a new set of use cases. Now, it becomes important to generate the Vorto model from the available functional item interfaces. This guide describes the mapping between the functional item interfaces and the Vorto model.

Vorto Models

Vorto Models are all abstractions which are used by Vorto.

The following couple are the abstractions allowing you to create a Vorto Function Block from the available functional item interfaces and types:

For more information refer to Vorto example repository.

Functional Item to Vorto Model Mapping

Data Types

Functional Item Type

Vorto Type

byte/java.lang.Byte

byte

short/java.lang.Short

short

int/java.lang.Integer

int

long/java.lang.Long

long

float/java.lang.Float

float

double/java.lang.Double

double

boolean

boolean

char

string

java.lang.String

string

Numeric

Entity:

vortolang 1.0

namespace com.bosch.iot.suite.edge.services.fim

version 1.0.0

entity Number {

  mandatory value as string with {

    readable : true

  }

  optional className as string with {

    readable : true

  }

}

 

Bean

Entity

Enum

Enum

FunctionalItem

dictionary[ string, string]

The dictionary contains single key with value FunctionalItem.UID which is mapped to the result of FunctionalItem.getUID().

Arrays

multiple attribute

Collections (Collection, Set or List)

multiple attribute

Maps

dictionary

Functional Item Type Entity

Vorto Type Entity

package

namespace

bean version

version

package version

version, if not a bean

class name

id

Data Types Example

vortolang 1.0

namespace com.bosch.iot.suite.edge.services.da.items

version 1.0.0

using com.bosch.iot.suite.edge.services.units.Quantity ; 1.0.0

entity Range {

    mandatory min as Quantity with {

        readable : true

    } "Represents the minimum value."

    mandatory max as Quantity with {

        readable : true

    } "Represents the maximum value."

    mandatory step as Quantity with {

        readable : true

    } "Represents the step."

    mandatory multiple possibleValues as Quantity with {

        readable : true

    } "Represents the possible values."

}

Functional Item

Functional Item Entity

Vorto Function Block Entity

package

namespace

interface name

id

@Name

displayname

@Version

version

@Description

description

@Attributes

N/A - internal usage

getUID()

N/A - internal usage

getName()

name config property (eventable)

setName(String name)

name config property (eventable)

getTags()

tags config property (eventable)

setTags(Set<String> tags)

tags config property (eventable)

getObjectClass()

N/A - internal usage

getAttributes()

N/A - internal usage

getItemMetadata()

N/A - internal usage

property

status property, if not writable

 

configuration property, if writable

property access

property attributes - readable, eventable, writable

getter

N/A - no Vorto support

setter

N/A - no Vorto support

operation

operation

Functional Item Example

vortolang 1.0

namespace com.bosch.iot.suite.edge.services.fim

version 1.0.0

displayname "Functional Item"

functionblock FunctionalItem {

    configuration {

        mandatory name as string with {

            readable : true,writable : true,eventable : true

        }

        mandatory multiple tags as string with {

            readable : true,writable : true,eventable : true

        }

    }

}

vortolang 1.0

namespace com.bosch.iot.suite.edge.services.da.items

version 1.0.0

displayname "Detector"

description "Represents a detector that can register a presence, change or something else."

using com.bosch.iot.suite.edge.services.fim.FunctionalItem ; 1.0.0

functionblock Detector extends FunctionalItem {

    status {

        mandatory detected as boolean with {

            readable : true,eventable : true

        } <NULLABLE false> "Represents the detection result."

    }

}