In this tutorial you are going to learn, how you can use the Eclipse IDE to describe a Vorto Information Model and manage it in the Vorto Repository.
-
Install Eclipse IDE 2018-12 for Java and DSL Developers
-
Open Eclipse IDE
-
Install the Vorto Eclipse Plugins from the zip-file from the Vorto Eclipse Update Site
-
Restart your Eclipse
- Right-click -> New Project
- Choose a project name and click Finish.
In this tutorial we will use a security camera to illustrate how to describe a device with Vorto using Eclipse. To keep it simple, we will describe the camera with the indispensable Informationmodel and only one Functionblock.
1. Informationmodel
To create a new Informationmodel, right-click on your created project and select New File.
It is important the file name suffix represents the type of file you want to create: SecurityCamera.infomodel
After clicking Finish, you will be asked if you want to convert your project to an Xtext project. Click Yes to enable autocomplete.
With the help of the autocomplete function (Ctrl-space
) you can now describe the Informationmodel of your device.
The next step is to describe the needed functionalities of the camera.
2. Functionblock
When creating the new file for the Functionblock, make sure that you use the correct suffix: Presence.fbmodel
Now we need to reference from the Informationmodel to your newly created Functionblock.
Go back to your .infomodel
file and add using org.mycompany.demo.Presence ; 1.0.0
, using your respective namespace and name.
Now you need to define an instance of the function within functionblocks. The autocomplete function should already suggest your referenced Functionblock.
You can now import your Informationmodel into the Vorto Repository where you can manage your models and release it to the community. To do that, you need to export your project as a General Archive File.
Log into the Eclipse Vorto Repository with your BoschID or GitHub account and Import the zip-file.
- Connect the device to Bosch IoT Suite by a given Vorto Information Model
- Reference Vorto Models files from your custom DSL with Eclipse Xtext
- Other tutorials
In case you're having difficulties or facing any issues, feel free to create a new question on StackOverflow and we'll answer it as soon as possible!
Please make sure to use eclipse-vorto
as one of the tags.