# A Choreography-Based and Collaborative Road Mobility System for L'Aquila City
## 3 Chorevolution Approach
At this point, [PERSON] sends M3 to [PERSON] that, after the execution of T2, replies M4 to [PERSON] and sends M5 to C. Only when M5 is received by C, it executes T3, replies M6 to [PERSON] and sends M7 to D. Finally, [PERSON] executes T4 and the choreography ends. By analyzing the choreography, we can distinguish three different types of participants: _consumer_, _provider_, and _prosumer_ (i.e., both consumer and provider). For instance, the consumer participant A might be played by an existing Client App; the provider participant D by an existing Web Service, e.g., Google Maps; B and C might be two prosumers that have to be developed from scratch in order to realize the specified choreography. Figure 2 shows the \"most general\" architectural configuration of the system that realizes the choreography specified in Figure 1. The top-most layer contains the services representing the business logic. In particular, a:A denotes that the role of the consumer participant A is played by a, the Client App in our example; d:D denotes that the role of the provider participant D is played by d, an existing provider service to be reused, whereas, concerning the participant B and C, in the figure, we do not make use of the notation x:X simply to indicate that they are not existing prosumer services and thus they can be either implemented from scratch or partially reused (for the provider part). Then, the second layer contains the **Binding Components** (BCs) [44] that cope with middleware-level protocol adaptation, e.g., REST versus SOAP adaptation. It is worth mentioning that SOAP is the default interaction paradigm for the underlying layers. Finally, the last two layers include the Adapter and CD artefacts for adaptation and coordination purposes, respectively. The additional artefacts are not always required; rather, it depends on the specified choreography and the characteristics (e.g., application-level interaction protocols, interface specifications,  
Figure 1: BPMN2 choreography diagram example. Figure 2: Choreography architectural style (a sample instance of). middleware-level interaction paradigms) of the existing services that have been selected to instantiate the roles of the choreography participants. To address the _automatic realizability enforcement_ problem, we have defined the CHOReVOLUTION synthesis process that allows for realizing dynamic choreographies via distributed coordination of services. Figure 3 shows an overview of the synthesis process. It takes as input the choreography specification--given in terms of BPMN2 Choreography Diagram and Messages XML Schema--and a set of third-party services used as possible candidates to play the roles of the choreography abstract participants. From these inputs, the synthesis process automatically generates all the needed additional software entities, i.e., CDs for solving coordination issues, Adapters for adapting application-level interaction protocols, and BCs for adapting middleware-level interaction protocols. At the end of the process, it is also generated the Choreography Deployment Description (called ChorSpec). The ChorSpec is an XML file referring to all the generated artefacts in order to specify their dependencies. In addition, it contains information required to correctly perform the choreography deployment on the Cloud (bottom layer in Figure 3). The synthesis process described above is supported by an Integrated Development and Runtime Environment (IDRE), named CHOReVOLUTION IDRE. The CHOReVOLUTION IDRE makes the realization of choreography-based applications easier by sparing developers from writing code that goes beyond the realization of the internal business logic. The IDRE is an open-source and free software, available under the Apache license. It is available as a ready-to-use bundle or you can download each component from [[http://www.chorevolution.eu/b](http://www.chorevolution.eu/b)]([http://www.chorevolution.eu/b](http://www.chorevolution.eu/b)) in/view/Documentation/Download.