# A Model Based Framework for IoT-Aware Business Process Management
## 4 IoT-Aware BPM Framework
### IoT-BPMN: A BPMN Extension for IoT-Aware BPs  
This section introduces _IoT-BPMN_, an extension of the BPMN metamodel, in other words the notation that the proposed methodology exploits to provision the _behavioral view_ of the IoT System.  
As mentioned in Section 1, the proposed extension has been designed and developed according to principles and standards provided by MDA. Specifically, the extension is strongly based on a _metamodeling-based_ approach, according to which the existing BPMN metamodel has been analyzed and new metaclasses are introduced as extension of existing metaclasses, without altering the structure of the original BPMN metamodel.  
The extension process is illustrated in Figure 5. Specifically, the BPMN metamodel is provided in terms of MOF metaclasses. According to the MDA methodology, a BPMN model is an instance of the corresponding metamodel. The XMI [31] standard provides the rules for  
* Serializing an MOF metamodel to an XMI Schema;
* Serializing a model to an XMI document which is validated by the relevant XMI schema.  
Figure 4: SysML profile for IoT.  
The IoT-BPMN has been defined at layer M2 (metamodel layer) by extending existing BPMN metaclasses.  
The IoT-BPMN metamodel is easily obtained by adding metaclasses that extend the original ones, without applying any modifications to the BPMN metamodel. This also has the advantage of maintaining a complete backward compatibility with BPMN, so that a BPMN model conforms to both the BPMN metamodel and the IoT-BPMN metamodel.  
The second step of the extension process is the serialization of the IoT-BPMN metamodel by using the XMI Schema Production Rules, in order to obtain the IoT-BPMN XMI Schema.  
Finally, the XMI Document Production Rules are instead used to derive an IoT-BPMN document (i.e., a XML document) from the corresponding IoT-BPMN model.  
The BPMN metamodel extension which addresses the IoT-related concepts is shown in Figure 6 and consists of the following metaclasses.  
* **SensorTasK**, which represents an IoT device. It provides the serviceEndPoint parameter that allows the BP engine to inquire the sensor for collecting the measured data;
* **Observation**, which models a single observation made by the sensor. It includes the following attributes:
* _Description_, for specifying a free description of the measure;
* ResultTime, which describes when the observation has been made;
* _Result_, which is a reference to the class providing the actual measured value;
* **ObservableProperty**, which is the subject of an observation. Its definition property refers to an external dictionary/ontology where the relevant conceptual definition is provided;
* **FeatureOfInterest**, which describes a feature of interest for the addressed environment. It is specified as a subclass of the _BPMN2::Artifact_ metaclass, so that it can be associated to any other BPMN element;
* **SensorDataType**, which represents the abstract type characterizing an observation result. According to the IoT metamodel introduced in Section 4.2, it is further specialized by the concrete classes SimpleData, DataArray and DataRecord.  
Finally, it should be emphasized that the above-mentioned metaclasses focus on the IoT-related extension of the BPMN. As the proposed methodology specifically addresses the simulation-based analysis of BPs, the IoT-BPMN extension also includes the metaclasses provided by the PyBPMN metamodel extension [35], briefly summarized in Section 3.4, in order to provide a complete extension that allows one to capture both performance/reliability and IoT-related properties of an IoT system.  
The next section illustrates the proposed architecture for enabling the analysis of IoT-aware BPs.  
Figure 5: MDA-based Extension Process.