# A Model Based Framework for IoT-Aware Business Process Management
## 4 IoT-Aware BPM Framework
### Architecture for the IoT-Aware BPM  
This section introduces the proposed architecture for enacting the simulation-based analysis of IoT-aware BPs. As pointed out in Section 1 and further explained in Section 4.6, the architecture aims at enabling the effective adoption of the digital twin paradigm. Moreover, its design exploits MDA-based standards and technologies to ease the development of the required executable simulation models.  
The proposed architecture, which is shown in Figure 7, consists of the following components:  
* **BP Modeling and Management**, which provides a visual environment to specify the IoT-aware BP and monitor its execution;
* **BP Execution Engine**, which actually executes the BP. Process tasks that specifically require an interaction with the sensors network invoke services provided by the Broker, which acts as the intermediate layer;
* The _M2T Transformation Layer_, which provides the Acceleo-based implementation of the aforementioned transformations, being Acceleo [39] an implementation of MOFM2T [33], the MDA standard for the specification of _model-to-text_ transformations;
- _MOF Metamodel Layer_, which provides an implementation of the IoT-BPMN metamodel based on MOF [30], the MDA standard for the specification of technology-neutral metamodels;
- The _Eclipse Modeling Framework (EMF)_, which provides the extensible environment for the specification and execution of the model transformations.
* **Broker**, which constitutes the intermediate layer for hiding the technological complexity of the underlying IoT infrastructure, thus providing transparency of the business layer from implementation-related details of the IoT-layer. It includes the following components:  
Figure 6: IoT-BPMN Metamodel Extension.  
The _Open Sensor Hub_, which is the core of the Broker. OSH implements the various standard parts of the SWE effort and provides a service-based interface for interacting with the IoT devices. The OSH implementation natively provides a set of _OSH Basic Drivers_ for enabling the data exchange with generic devices;
* _App-specific Sensor Drivers_ and _Sensor Data Layer_, which are the components whose implementation is supported by the IoTBPMN-to-Sensor _model-to-text_ transformation. Specifically, they provide the implementation of device-specific drivers and data models, respectively. As such components' implementation is strictly tied to the set of concrete sensors, the information needed for their implementation is specified by the use of stereotypes provided by the IoT4 SysML profile;
* Data Retrieval Layer, which is responsible of updating the BP simulation model (i.e., the digital twin) with the data collected by sensors defining the actual state of the real environment (i.e., the physical twin).
* **Simulation Engine**, which allows the execution of the simulation model. It provides an implementation of the eBPMN [37] framework for executing simulation models specified by use of PyBPMN [35];
* **BP Execution Engine**, which is in charge of executing the BP model.  
The next section introduces the methodology that clarifies how the IoTSyML profile, IoT-BPMN extension and the architecture discussed herein can be actually exploited to enact the analysis of IoT-aware BPS.