# Merging Spatio-Temporal Objects and Business Processes: Land Reform Process Case Study
## 4 Merging Spatio-Temporal Conceptual Model and Business Process: Land Reform Process Case Study
OCL is used to annotate BPMN and link it with the PostgreSQL/PostGIS relational model representing MADS. The following contains a soft example of the OCL contracts for the events and activities of the BPMN. The link between the Lanes Parcel and Borders is interpreted as follows:  
* If the event \"split\" for example (characterized by the purchase of a part of parcel1 and the creation of a new parcel2), occurs and updates the spatial and temporal features of an existent object (e.g., parcel1), this leads to an update and tracking of the MADS's  
Figure 4: BPMN denoting a land reform process. spatial value \"polygon\" of this parcel (and by consequence, in a second part, updates the temporal and spatial features of the created parcel: parcel2). Thanks to OCL, these steps can be introduced to increase the semantics and assure the executability of theBPMN events \"Update Spatial\", and \"Update Temporal\" for \"parcel 1\". The head of each rule in OCL (update) determines the SQL statement that will be applied. OCL:  
Update parcel1:  
_context Parcel::update temporal(temp :intl[)]_  
post: self.TEMPORALFEATURE=temp  
context Parcel::updatespatial(spl :polygon)  
post: self.SPATIALFEATURE=spl
* The \"update spatial\" event will lead to checking (among others) the associations between the lane Parcel and itself (and with the lane Building) and \"Select relevant\" parcels (and buildings). OCL:  
Select relevant:  
context Parcel::SelectRelevant()  
post: self.ContainsBuildingRef\(\rightarrow\)select(building and oclIsTypeOf(Building)) and self.BordersParcelRef-\(>\)select(border and oclIsTypeOf(Parcel))  
In the \"Border\" lane, the \"Select Relevant\" event leads to the \"Manipulate Topological Relation\" event that updates the values of MADS parcell's relations with adjacent parcels and \"Submits Reform Request\" event for other object parcels where their spatial/thematic values are affected/created by the spatial modification on parcel1. Indeed, \"Select Relevant\" in the lane \"Border\" takes us back to the Lane Parcel and a similar process will be applied to parcel 2. To connect the process events to the data, we connect every activity, decision, and message received or sent in theBPMN to the relational model resulting from the implementation of MADS schema. By using formal language to express the prior activities and start/end/message events and applying the Petri Net semantics forBPMN control flow, this description of the state evolution of all MADS objects becomes fully executable. Therefore, each activity in theBPMN diagram is specified for this purpose using an OCL operation contract. Each OCL action contains a precondition that specifies the requirements that must be met before the job can be completed, as well as a postcondition that describes the system's state following the operation's execution. TheBPMN diagram is formalized into a Petri net. We focus on formalizingBPMN models' control flow, which specifies how tasks and events should be executed. Petri nets have an initial marking that symbolizes theBPMN model's beginning condition. Each task will roughly correspond to a transition with one input and one output location. To represent the routing behavior of the gateway, gateway nodes will typically correspond to a combination of places and silent transitions. The Petri net we obtained in our case study is shown in Figure 5. Each task corresponds to a labeled transition, which has one input and one output place. Each gateway node maps to a set of places and transitions. The dotted rectangle in Figure 5 shows the transitions and places corresponding to the translation of the XOR merge gateway placed after the task \"Submit reform request\". Each OCL operation contract is written and used in Petri net as a set of logic rules from which we can infer the insertions, deletions, and updates that must be made to the PostgreSQL/PostGIS database to carry out the operations. By doing this, we transition from the declarative OCL specifications to an executable imperative formalism.