Geospatially Constrained Workflow Modeling and Implementation

With rapid development and application of mobile internet, geographic information in the field of business process is now more widely used. There are more and more researches in the field of the relationships between geographic information and workflow modeling. According to the workflow with geospatial constraints, this paper first discusses the geospatial constraints theory deeply, proposes a new concept of geospatial constraints unit, and then designs a geospatial constraint net model (GCNet). Secondly, this paper designs a new workflow model with geospatial constraints (GCWF-net) based on GCNet and workflow net (WF-net), and then analyzes some properties of the model. Finally, this paper discusses how to put GCWF-net into application practice from three aspects: extending PNML (Petri Net Markup Language) labels for GCWF-net, converting PNML to BPEL (Business Process Execution Language) and implementing BPEL.


Introduction
A business process is "a procedure where documents, information or tasks are passed between participants according to defined sets of rules to achieve or contribute to an overall business goal" [1].Workflow is "the computerized facilitation or automation of a business process, in whole or part" [1], and is an abstract, summary and description of business rule of the business process and the operation steps.Business professionals create business process models in order to get an understanding of who is involved and which resources are needed for the execution of a business process.Such business process models are required as a basis for knowledge transfer, quality purposes, regulations, communication between internal and external collaborative partners, or documentation in general [2].At present, the technology of workflow modeling, analysis and simulation has been very mature and widely used in various sectors of society.With rapid development and application of mobile internet, geographic information in the field of business process is more widely used.There are some researchers beginning to study how to adapt to the demand of geographic information application in workflow modeling and the important role of geographic information in workflow automation and optimization.Traditional workflow uses mainly the geographic information as the static properties existing in workflow form or existing in the attribute information of the participating personnel, role, or organizations in a workflow, and its form is text, such as an address, a coordinate character string and so on.
Some researchers bring the geographic information into a workflow context, and mainly concentrate on the location-aware space.Chakraborty et al. [3] designed xBPEL language by extended BPEL.The xBPEL takes geographic location into consideration as an important context factor in the workflow operation mode, and based on this, a PerCallab system was designed.Wieland et al. [4] put forward the concept of context-aware workflow, and introduced what contextual factors should be considered in the workflow modeling and how to integrate them into the workflow implementation.They stressed the important role of location-aware, and the realization of the smart factory system "NEXUS" location is one of the most important considerations.De Leoni et al. [5] designed a process-aware information systems framework based on YAWL (Yet Another Workflow Language).In this framework, the workflow tasks and resources are visualized on the map in order to assist the decision-making of the business process.Delker et al. [6] presented the concept of a location information constrained process, and extended UML (Unified Modeling Language) modeling with location information.Che et al. [7] used the language (GML) on the basis of Delker's conclusion to strengthen the role of location information.Zhang li et al. [8] designed location-aware workflow modeling and verification based on Petri Nets, and proposed six geographic relation primitives.Zhu Xinwei et al. clarified the concept of geospatial constraints, constructed the UML semantic framework of geospatial constraint [9], designed and verified the business process model with geospatial constraint based on Petri Nets [10].For effective and efficient disaster emergency planning and management, Sackmann and Hofmann et al. [11,12] discussed the integration of place-related information in DRWfMS (Disaster Response workflow management systems), extended the knowledge base in BPM (Business Process Management) by formalizing "place" in process models and developed a framework for identifying and resolving place-related conflicts.
To sum up, the research on the relations of geospatial information and workflow modeling is increasing more and more.Researchers are extending the research focuses from geographic location to geographic information in the stage of workflow modeling, and have begun to research deeply the relations of workflow modeling and geospatial information in theory.
Based on the previous work, this paper discusses the relations between workflow modeling and geospatial information, proposes a novel modeling method based on Petri Nets.The contributions of this paper include the following: (1) Concepts: the level that the geospatial information impact on the business process is cleared, and the geospatial constraints subjects, objects, rules, states are discussed.The concept of geospatial constraints unit is put forward; (2) Models: the geospatial constraint net (GCNet) is designed based on geospatial constraint unit, and then workflow model with geospatial constraints (GCWF-net) is designed and analyzed according to GCNet and workflow net (WF-net); (3) Practices: this paper describes how to put GCWF-net into application practice from three aspects: extending PNML (Petri Net Markup Language) labels for GCWF-net, converting PNML to BPEL and the implement of BPEL.
The paper is organized as follows: Section 2 describes the concept of geospatial constraint unit (GCNet); Section 3 establishes and analyzes the workflow model with geospatial constraints (GCWF-net); Section 4 describes the implementation process of this model; and Section 5 provides conclusions and proposes future studies in this line of research.

Levels of Geospatial Information Impact on Workflow
In accordance with the participation degree, the levels of geospatial information impact on workflow can be described as the following: (1) First level-Geospatial information only describes the related information about workflow activities in text form, map visualization or other forms, and is always regarded as the attribute information of workflow activities, participant or organization, such as the location of activities implementation, the location of the person or organization.
(2) Second level-Geospatial information influences the workflow activities in a decisive role, including the sites of participant or execution and the workflow trend.However, this geospatial information is previously defined in workflow design, and the workflow instances are implemented in accordance with the design.
(3) Third level-Geospatial information influences the workflow activities in a decisive role too, but these influences is relative to geographic context of workflow activities.The geospatial information asks workflow for positive responses, adjusting the workflow participants, execution locations or process trends in order to achieve the goals of workflow.
In the second and third levels above, workflow activities are constrained by geospatial information and must be in accordance with requirements of the geospatial information.Geospatial constraint is a statement that states the geospatial information of one or more activities in workflow scenarios or workflow instances [10].To some extent, geospatial constraints that affect workflow activities are constraint mechanisms that constrain activities through the geospatial information related to these activities.

Subjects of Geospatial Constraints
Geospatial information is the performance and knowledge about the properties, characteristics and movement states of geographic entities.It describes the inherent quantities, qualities, distributions, relations and rules of spatial entities and environments, and it has positioning, quantitative, dynamic and multi-dimensional characteristics [14].From an object oriented perspective, geographical spaces are composed of geographic entities.It is geographic entities or relationships that cause geospatial constraints on business process.Therefore, geographic entities can be regarded as the subjects of the geospatial constraints.
The geographic entity can be defined as a phenomenon that occupies a position in space that cannot be divided into similar phenomena in the real world, and can be expressed as simple abstract geometric objects, such as point entities, line entities, surface entities, body entities.Geographic entities in the real world do not exist in isolation.The distribution relationship of geographic entities in the geographic space is called a spatial relationship, including three basic types of spatial relationships: the topology, direction and measure relationships.The topological relationship describes the adjacent, correlative and containing relationships of entities.The direction relationship defines the position relationship between the entities.The measure relationship mainly refers to the distance relationship between entities.
Geographic entities have three characteristics: spatial characteristics, attribute characteristics and temporal characteristics.Spatial characteristics are used to describe the location and spatial relationships between things or phenomena, and they are also called the geometric or topological characteristics.Attribute characteristics are used to describe the attributes of things or phenomena.Temporal characteristics are used to describe things or phenomena changing with the time.
Definition 1. Geographic Entities Set E: E is a finite set of geographic entities related to workflow activities: Every geographic entity is a five tuple: e = (e ID , e SC , e PC , e TC , e metadata ). ( e ID is entity identification; e SC is spatial characteristics set, including coordinates, geometric type, area, perimeter and topology relations, etc.; e PC is an attribute characteristics set; e TC is a temporal characteristics set; and e metadata is the meta data that describes the entity.

Geospatial Information Methods Set
Geospatial information constrains workflow activities through the results derived from geospatial information operations.The geospatial information operation is called spatial analysis.The use and analysis of spatial data is spatial analysis including all kinds of spatial operations, spatial reasoning and spatial data mining.Definition 2. Geospatial Constraints Methods Set C: C is the methods set of geospatial constraints and should be a three tuple including inputs set, outputs set and methods set: (3) In the process of workflow modeling, the semantic description about the geospatial constraints methods set is needed.The following discusses the basic geospatial constraint methods.
The OGC (Open Geospatial Consortium) defines space component as four categories: point, line, surface and set.Geometry is the root of all space component, and Geometry operation interface covers most of the space component interface.According to the definitions of OGC and the actual business processes demands, this paper summed up the common measure relationships, direction relationships, topological relationships and basic spatial analysis methods in workflow modeling with geospatial constraints in Figure 1.In this figure, P and Q are two geographic entities.

Geospatial Constraints Rules
The geospatial constraints rules are the requirements of geospatial information to the workflow activities.These rules are complicated, but no matter what kind of requirements or constraints, they are related to three issues: (1) Who constrains others?(2) Who are constrained?(3) How to execute the constraints?Therefore, the rules of geospatial constraints on workflow activities should be made clear as follows: the subject of constraints, the object of constraints, and the constraint methods set.Thus, the geospatial constraints rule generally is a three tuple: E is geographic entities related to the geospatial constraints; A is the activities constrained in the workflow; C is the geographic information methods set in the geospatial constraints.

Geospatial Constraints States
Geospatial information constrains the workflow activities and affects the execution of the workflow.If the current workflow activity has been constrained by geospatial information, the activity is enabled, or else the current activity is not enabled.Therefore, the geospatial constraints have two states: the enabled or not enabled state.Then, monitoring the geospatial constraints states is required.A Boolean expression can monitor the states: G(a) = true or G(a) = f alse.When G(a) = true, the current activity is enabled; otherwise, it is not enabled.

Geospatial Constraints Unit
In summary, the geospatial constraints unit is composed of the subjects, objects, rules, methods set, and states.These elements form the geospatial constraints unit to constrain workflow activities.Thus, the geospatial constraints unit should be a three tuple: W w f is the related workflow; S rule is the geospatial constraints rules including the subjects (geographic entity sets), objects (workflow activity) and geospatial information methods set; G is the geospatial constraint state monitor.

Geospatial Constraints Net Model
Petri Nets with a graphical formal semantics, a strict mathematical definition and precise syntax and semantics definition, relatively intuitive expression, have state-based process descriptions and rich model analysis methods, and can analyze workflow behaviors, states and performances.Yuan [15] defined C_net for implementing Petri Nets in programming.This paper uses some methods in C_net, and defines Geospatial Constraints Net(GCNet) based on Petri Nets and geospatial constraints unit.Definition 3. Geospatial Constraints Net (GCNet): a six tuple GN= (E, T; R, Wr, G, B) is a GCNet, if and only if: E represents a geographic entities variables set, which is called E Place.If |E| = 0, then the transition is not constrained by geospatial information.R is reading relation, and W r is writing relation.T is transition with geospatial constraints and is also the computing unit of geospatial constraints.T reads the geographic entities variables set E R , calculates these variables and gets some results, and then writes the results to variable set E W r .E R ∪ E W r = E.The equation "|T| = 1" indicates that this is a geospatial constraints unit that only affects one workflow activity.According to geospatial constraints units previously defined, the geospatial constraints calculating unit is divided into two parts: one is the guard function G that is a Boolean expression monitoring the constraints state; another is the body function B corresponding to the constraint methods set.
• have the same definitions with the pre-sets, post-set of directed nets.
(2) r(t) is the reading set of t, and the set includes inputted geographic entities variables.r(t) = {x|(x, t) ∈ R}.w(t) is the writing set of t, and the set includes the output variables.w(t) = {x|(x, t) ∈ W r }. r(t) and w(t) must satisfy: (3) tp(x) represents the geographic entities types of the variable x.When tp(x) is used as a set, it is in a range of x. (4) Type= x∈E tp(x) is the type set of all geographic entity variables.( 5) M E is called E_ marking of GCNet, if ∀x ∈ E : M E (x) ∈tp (x).(6) B is the body function of GCNet, if B(t) is a geospatial constraints methods set expressed with semantics.B reads geographic entities variables from r(t), writes the results into w(t) after spatial operations with geospatial constraints methods set, and notices the results to G function finally.( 7) G is called a guard function of GCNet, if G(t) is a Boolean expression, i.e., whether the results from B satisfy the requirement of geospatial constraints.
In Figure 2, a geographic entity variable is represented with a double circle; the transition is divided into two parts: guard function and body function; reading relation and writing relation are represented by lines, with small circles at the endpoints,connecting the variables and transitions.If the small circle is at the transition side, it represents reading relation, otherwise writing relation.

Definitions of Geospatially Constrained Workflow Model
In Petri Nets, "place" represents resources, and "transition" represents the qualitative or quantitative change of resources.For a transition, when the pre-sets can provide consumption resources and the post-sets can accommodate the produced resources, then the transition is enabled.Tokens are the resources flowing in the Petri Net.In van der Aalst's WF-net [17], transitions represent workflow activities, and places represents dependencies relationships between two activities.Token represents a case of business process.When the present activity is completed, according to the business rules, the next activity will be triggered by an artificial or by a workflow engine.
This section integrates the GCNet and WF-net to compose the geospatially constrained workflow model.In the model, if a transition is enabled, it must have two situations: one is the dependencies between activities, another is geospatial constraints.P, E, T; F, R, W r ,  M T , G, B): (1) P, T, F are the same definitions in WF-net, i.e., WF-net=(P, T; F).

Definition 5. Geospatially Constrained Workflow Model (GCWF-net): GCWF-net=(
(2) E, R, W r , G and B are the same definitions in GCNet, and ) M T is called transition marking of GCWF-net and is a state of transition.M T = G(t) + B(t).
(4) M P is the marking of P place in GCWF-net and is called P_ marking.
(5) M E is the marking of E variable place of GCWF-net and is called E_ marking.

Definition 6. Transition Rules: Let
B is the spatial operation methods set, B(x) is the results set that is derived from the spatial operation, and should be written into x.

Workflow Routing Structures
It can be seen from the above definitions that WF-net is the base net of GCWF-net.For the token, GCWF-net and WF-net do not make any difference.The tokens all flow from i place to o place under the dependence relations of the front and rear activities.Based on WF-net, GCWF-net extends geospatial constraints, including variables, reading and writing relations, G, B, etc., and then geospatial constraints are able to play a better role.Moreover, as long as there is no reading and writing conflict on the same variable at the same time, the workflow routing structure of GCWF-net and WF-net are consistent.
A workflow process definition specifies how the cases are routed along the tasks that need to be executed [17].In 1999, Workflow Management Coalition (WfMC) published the terminology and vocabulary (V3) that defines the four workflow routing.The following analyzes the basic workflow routing structures.
Sequential routing structure is used to execute activities in one thread and to deal with causal relationships between activities.Each transition in this routing has an obvious order.In conditional routing, routes of different instances in workflow execution may be different.The route of an instance depends on the workflow instance attribute, the behavior of the environment, the organization, or other relevant factors, such as geospatial constraints.However, for one instance, the related activities only have one order.For iterative routing, the workflow executes the same activity repeatedly.If the activity is constrained by geospatial information, then the related geographic entities variables would be written multiple times.Because we have specified the expression r(t) ∩ w(t) = ∅ previously, the reading and writing conflict of geographic entities variables would not occur among activities.
Therefore, in these three GCWF-net routing structures, there would not be conflicts of reading and writing the same variable at the same time, and the GCWF-net and WF-net are consistent.
Parallel routing is used in situations where the order of execution is less strict.At the same time, there may be two or more activities being performed.Thus, there would be conflicts of reading and writing the same variables between activities.This conflicts are called E_conflicts.In addition, the conflict caused by insufficient tokens in the workflow place is called P_conflicts.The activities with neither P_conflict nor E_conflict can be concurrent.
If two transitions of GCWF-net have no reading and writing dependence, the formal expression is the following: Both t 1 and t 2 would not write the variables in the pre-sets or post-sets of each other and would not write the same variable.If t 1 and t 2 are enabled at (M T , M), but they have independent reading and writing, then t 1 and t 2 of GCWF-net have E_conflict at (M T , M).
If Transition t 1 and t 2 are enabled at (M T , M) and have neither P_conflict nor E_conflict, then t 1 and t 2 are concurrent at (M T , M), i.e., (M T , M)[t 1 , t 2 >, The successors of the concurrent of t 1 and t 2 could be derived from themselves, respectively.

Validity of GCWF-Net
Compared to WF-net, GCWF-net extends geospatial constraints and affects the concurrent and enabled situation only.In other respects, GCWF-net and WF-net are consistent.The following defines the validity of GCWF-net.
State o is the only end state.When a workflow instance finishes, only the place o has one token, and the others are empty: There is no dead transition in GCWF-net, i.e., every transition can be executed: ∀t ∈ T, if t is geospatial constrained transition, then M = (M P , M E ), M = (M P , M E ), otherwise M = M P , M = M P .

Implement of GCWF-Net
This section gives an example for GCWF-net modeling first, and then discusses the other three processes.The Figure 3 describes the implement process of GCWF-net.

GCWF-Net Modeling
Scenario Description: When a company's customer service center (CSC) receives a telephone for repair, if the repair request does not meet the acceptance conditions or could be settled on the phone, the process is over, else the CSC records the customer's address and other relevant information, and then hands this case over to the maintenance department; the maintenance department receives the task and assigns it to the nearest engineer to the customer; the engineer goes to inspect on-site, removes the damaged parts, and chooses the nearest maintenance station for repair; when the parts are repaired, the engineer installs the parts on-site, and then the maintenance department sends this case to another CSC; the CSC visits the customer by telephone; and the process is over.
In the repair process, the tasks with geospatial constraints are: the acceptance CSC could not be the return visit CSC; the on-site engineer assigned should be the nearest to the customer; parts repair should choose the nearest maintenance station.Figure 4 is the WF-net model of repair process.However, there are no descriptions about geospatial constraints in the model.Then, the important role of geographic information in the maintenance service process automation and optimization could not be seen.the repair request does not meet the acceptance conditions or could be settled on the phone; t 3 : repair engineer assignment; t 4 : on-site inspection; t 5 : on-site repair; t 6 : back to maintenance station for repair; t 7 : customer service center visit by telephone.
As is shown in Figure 5, GCWF-net model is designed to show the repair process with Geospatial Constraint Units, including E, G, B, R, W r .Then, the model could show the descriptions of geospatial constraints and could be analyzed with analysis methods of Petri Nets or WF-net.

Representation of GCWF-Net in PNML
Due to the flexibility and the rapid development of Petri Nets, there has been a lot of versions, variants and characteristics [16].These types and tools are different and incompatible to each other, so it is difficult to share and exchange the variant Petri Nets.In 2000, the International Conference on Theory and Application of Petri Nets began efforts on an exchange standardized format of Petri Nets, and PNML is one of the program [13].PNML is an XML (Extensible Markup Language)-based Petri Nets file exchange format, and its main purpose is to solve the problem of non-uniform exchange format due to the different types of Petri Nets [17,18].
The PNML metamodel has no restrictions on the label, so PNML metamodel may represent any type of Petri Net.For a specific type of Petri Net, a legal label definitions model which is called Petri Net Type Definition (PNTD) is needed to extend the PNML metamodel.ISO/IEC15909-2 defines the type of Petri Nets for P/T Net, high-level Petri Nets and Symmetric nets, respectively [13].
Then, after the GCWF-net modeling, we should use PNML to describe this model.

Conversion from PNML to BPEL
The Web Service Business Process Execution Language (BPEL) has become the de facto standard for implementing business process.It is designed for web services orchestration and composition, but its XML expression is incomprehensible and difficult for the untrained user.The modeling advantage of Petri Nets is the strict mathematical definition, the graphical representation and rich analytical methods.Therefore, for business processes applications, we can use Petri Nets as a process design and analysis language, then BPEL as the process execution language.
For the conversion of WF-net to BPEL, van der Aalst et al. has proposed a conversion algorithm based on component [19,20].Then, on this basis, GCWF-net adds geospatial constraints unit to WF-net.There are two aspects to pay attention to during the conversion process: (1) Variables in GCWF-net correspond to the variables in BPEL; the names of variables in BPEL are automatically generated according to the conventional way of naming.(2) G and B are the semantic expressions of guard function and operation methods set for geospatial constraint.The methods set corresponds to the geographic information services set, and spatial operation needs geographic information service combination.
According to the above aspects, we could develop a GCWF-net conversion tool.

Implementation of BPEL
Although the PNML of GCWF-net has converted to BPEL, only the main content of BPEL is converted successfully.BPEL should also include external services calls and some other content.All of these should to be improved, and then it needs to establish a demo system to verify the model.We use Oracle BPEL process manager (Oracle Corporation, Redwood Shores, CA, USA) as BPEL design and execution engine.According to the repair process, this paper established a web service providing system, mainly including the related web service and database table.In the process, the related web services are: repair reporting location web service; maintenance personnel dispatch web service; maintenance depot selection of web service; and the visit customer service center web service.
The web services and BPEL files could be configured in the Oracle BPEL process manager, and we can use maps as the main interface which can display geospatial information visually.

Conclusions
With the rapid development of mobile applications and spatial information technology, geographic information is more and more important to business processes.However, up to now, little research has been done about geospatial information impacts on workflow modeling.The existing research only focuses on geographic location and has not extended to the geospatial information.This paper discussed the geospatial constraints on workflow modeling, specified geospatial constraints content from several aspects-the levels, subjects, objects, methods, rules, states-put forward the concept of geospatial constraint unit, and established geospatial constraints net(GCNet) based on Petri Nets.Then, this paper combined the GCNet and workflow net, established geospatial constrained workflow model, and analyzed transition rules, and workflow routing.According to the standard of PNML, this paper used PNML to express GCWF-net and then converted the PNML to BPEL.Finally, the implementation process of the GCWF-net model was described.

Figure 1 .
Figure 1.Semantic description of spatial relationships and basic analysis in workflow modeling.

Figure 4 .
Figure 4. WF-net model of repair process.t 1 : customer service center receives the telephone repair; t 2 : the repair request does not meet the acceptance conditions or could be settled on the phone; t 3 : repair engineer assignment; t 4 : on-site inspection; t 5 : on-site repair; t 6 : back to maintenance station for repair; t 7 : customer service center visit by telephone.
2) t is enabled by M P , i.e., (M T , M P )[t >, if t is enabled as the transition in WF-net.(3)t is enabled by (M T , M), i.e., (M T , M)[t >, if t is enabled by (M T , M E ) and is enabled by M P , i.e., (M T M E ) is true, and the geographic entities in G(t) are provided by M E , and the geographic entities in B(t, M E ) are provided by M E too.The geospatial operation of methods in B can satisfy the geospatial constraints rules.(

Definition 7 .
Validity of GCWF-net: GCWF-net is validity, if and only if: for every reachable state M of i, there are trigger sequences from state M to state o: