# A Model Based Framework for IoT-Aware Business Process Management
## 5 Implementation of the IoT-Aware Framework Prototype  
As discussed in Section 4.5, the framework architecture includes five main components providing the capabilities to (i) specify a BP model (BP Modeling and Management component), (ii) run the BP (Execution Engine), (iii) execute the required model transformations (Model Transformation Engine), (iv) communicate with the underlying sensors network (Broker), and (v) simulate the BP by executing the relevant simulation model which plays the role of DT (Simulation Engine). This section describes how the framework prototype has been developed. As illustrated in Figure 7, part of the framework capabilities are provided by existing open source components. The core technologies at the basis of prototype implementation are the Java programming language and the Eclipse Modeling Project [42], an Eclipse component that provides concrete tools to enable the actual adoption of model-driven software engineering approaches. Figure 8: Methodology for the IoT-aware BPM. Figure 9: Specification of PyBPMN and IoT-BPMN. The core of the Eclipse Modeling Project is the Eclipse Modeling Framework (EMF) [43], which constitutes the backbone of the proposed framework implementation. It provides:  
* _Ecore_, the Eclipse reference implementation of OMG's Essential-MOF (EMOF) [30], the OMG standard for the specification of neutral metamodels;
* A visual environment to create, manage and store _metamodels_ serialized as XML Metadata Interchange (XMI) data [31]. According to the framework architecture, the prototype provides various _model-to-model_ and _model-to-text_ transformations. In this respect, the following technologies of the Eclipse Modeling Project have been used:
* _QVT Operational (QVTo)_, which is an implementation of the QVT Operational Mappings language issued by OMG. QVTo provides a transformation engine to execute _model-to-model_ transformations on Ecore-based models. Specifically, QVTo allows the transformation of an _input model_, which conforms to the relevant _source metamodel_, to an _output model_, which is in turn an instance of the _target metamodel_. Both the _source_ and _target_ metamodels have to be specified by use of of Ecore [44] and serialized as XML schemas according to XMI rules [44];
* _Acceleo_, which is an Eclipse plugin that implements the OMG MOFM2T standard. Acceleo provides a _model-to-text_ transformation engine which takes as input an XMI model that conforms to a given Ecore-based source metamodel and yields as output a text document. The latter is obtained by use of a _template-based approach_, where fixed text is completed with the information retrieved from the input model [39]. The aforementioned technologies and standards are at the basis of the prototype framework, which consists of a set of components described hereinafter. The implementation of both the _BP Modeling and Management_ component and _BP Execution Engine_ makes use of the open-source Camunda Platform, version 7 [45], which provides a BPMN visual editor and a BP execution engine. As regards the _Transformation Engine_, an EMF- and Java-based implementation of the following transformations have been developed:
* **BPMN-to-IoTBPMN Model-to-Model Transformation**, which takes as input the annotated BPMN model (serialized as an XML file) and yields as output an XMI-based IoT-BPMN model. Specifically, the transformation maps the annotation elements that describe IoT devices, as well as the performance and reliability properties of the BP under study (e.g., the sensor url endpoint, the device MTTF, etc. ), to the corresponding IoT-BPMN elements. As an example, the following annotations is used to generate an output model which includes a _SensorTask_ element where the _serviceEndPoint_ attribute assumes the value [[http://utv.testserviceurl.it/sensor1](http://utv.testserviceurl.it/sensor1)]([http://utv.testserviceurl.it/sensor1](http://utv.testserviceurl.it/sensor1)).