Checking service compatibility via resource conformance
Ivan Romanov
Software Engineering School National Research University Higher School of Economics 33/5 Kirpichnaya, st. Moscow, Russian Federation Email: [email protected]
Scientific Advisor: Prof. Irina A. Lomazova
Software Engineering School National Research University Higher School of Economics 33/5 Kirpichnaya, st. Moscow, Russian Federation Email: [email protected]
Abstract — In this work we consider modeling of services with workflow modules, which are a subclass of Pstri nets. Service compatibility problem is studied. Quasi-regular expressions are used for checking service compatibility via resource conformance.
Keywords - service composition; service compatibility; workflow net; workflow module
I.
Introduction
Service-Oriented Computing [1] is an emerging computing paradigm that supports the modular design of (software) systems. Complex systems are designed by composing less complex systems, called services.
A service consists of a control structure describing its behavior and of an interface to communicate asynchronously with other services. Component interaction necessitates a mechanism of communication between services. An interface is a set of (input and output) channels. In order that two services can interact with each other, an input channel of the one service has to be connected with an output channel of the other service
There are a lot of algorithms for checking services compatibility. They allow, for example, to check deadlock freedom property, termination property, and others. Very often there methods have high computational complexity, affecting the speed of their implementation. It is assumed, that for service execution resources consumed from external environment are needed. In this paper a property of service compatibility via resource conformance is checked in the initial stage, it may help to avoid further verification because of evidently incompatible services.
In this work we consider modelling of services with workflow modules, which is a special subclass of Petri nets. Service compatibility problem is studied. Quasi-regular expressions are used for service compatibility via resource conformance analysis.
II. Formal Model For Services
While analyzing and verifying service compatibility, let us abstract from underlying technologies and implementations and consider formal model based on Petri nets.
Petri nets is a popular formalism for modeling and analysis of distributed systems. A Petri net N = (P; T; F) consists of a set of transitions , a set of places P, and a flow relation (P xflu( T X P). Graphically, a place is represented by a circle, a transition by a box, and the flow relation by directed arcs between them. Whilst transitions represent dynamic elements, for example, an activity of a service places represent static elements for example, a condition to perform an activity of a service. A state of a Petri net is represented by a marking, which is a distribution of tokens over the places. Graphically, a token is depicted by a black dot.
Workflow net (WF net) is a special Petri net. This formalism is used to model workflow systems [3]. A workflow net has one initial and one final place, and every place or transition in it is on a directed path from the initial to the final place.
Figure 1. Example ofworkflow net. Model ofa vending machine that sells, either a cup of tea, or coffee.
Modeling workflow [5] consists of modeling case management with the help of parallelism, sequential routing, conditional routing and iteration. To express it explicitly building blocks such as the AND-split, AND-join, OR-split and OR-join can be used. The AND-split and the AND-join are used for parallel routing. The OR-split and the OR-join are used for conditional routing. When we model an OR-split in terms of a Petri net, the OR-split corresponds to a number of transitions sharing the same set of input places. Other constructs also can be easily expressed in Petri net formalism.
To guarantee, that we get ’good’ workflows, we are to balance AND/OR-splits and AND/OR-joins. Clearly, two parallel flows initiated by an AND-split, should not be joined by an OR-join. Two alternative flows created via an OR-split, should not be synchronized by an AND-join. When we follow these rules we obtain structured WF nets (see [3] for more
details). It is shown there, that structured WF nets are sound by construction.
III. Service Compatibility via Resource
Conformance
A stateful service defines an internal process (i.e. activities building its internal structure), and an interface to communicate with other services. To model services we will use a special subclass ofPetri nets called workflow module.
A Petri net M = (P ; T ; F) is called workflow module
[2],[4] if the following conditions hold:
1) The set of places is divided into three disjoint sets: internal places Pw, input places P7 and output places P 0.
2) The flow relation is divided into internal flow Fw £ (Pw xT)u(TxPw) and communication flow Fc £ (P7 XT) U (T XP 0) .
3) The net PM = (Pw; T ; Fw) is a workflow net.
4) No transition is connected both to an input place and an output place.
Within a workflow module M, the workflow net P M is called the internal process of M and the tuple is
called its interface.
Figure 2. Example ofa workflow module.”Money”,’Tea”,”Coffee”are input places, “Beverage” is output place.
Denote structured workflow module (SWFM) as a workflow module, where the net is a
structured workflow net.
In this paper we consider the class of services, which can be modeled by SWFM.
Figure 3. Example of service composition
Figure 3 illustrates an example of service composition. It shows situation when customer wants to buy coffee.
Let S be a finite set. A multiset m over a set S is a mapping m : S — M, i.e. a multiset may contain several copies of the same element. By M (S) we denote the set of all finite multisets over .
Let N is structured workflow module with two disjoint sets P1 of input places and P0 of output places. Consider some run 5, states sequence from initial to final state, of the N. For each run pair of input and output resources (,R7;,R 0) , where £ M ( P1 ) and R0£M(P°) are defined. Denote p (5) = (,R/;,R0) as resource of N [2].
For the considered class of services, let us denote quasiregular expression defining a set of all possible resources for a service. For such type of resources, inner workflow net is structured, therefore, it becomes possible to identify the expression recursively by its structure:
1) Expression takes the form fl7 ° ,R0 for atomic net where transition consumes fl7 and produces ,R0 resources. Thus, rewrite this expression as
??! °?r2 ° ...°?rk ° ! rk+1 o ! rk+2 ° ... °\rk+m
where r1(.. .,rk - input resources; rk +1, . . ,,rk+m — output resources; If the transition does not produce/consume resources it is denoted as .
2) For sequentialrouting e1 ° e2
G-
O
el e2
Figure 4. Sequential routing.
3) For parallel routing ex ° e2
o
Figure 5. Parallel routing.
4) For selective routing e1 + e2
Figure 6. Selective routing. 5) For iteration e1 + (e7 ° e,)*
O—Q
□—O
Figure 7. Iteration.
Proposition 1. Let expressions el and e2 define a set of resources for two structured workflow modules and . Then after application of described operations deduced SWFM will possess the following resource sets: for sequential,
parallel routing, for selective routing and
for iteration.
Describe some properties of the algebra that we have:
1) e ° £ = e
2) £* = £
3) e ° e * = e +
4) (e*) * = e*
5) e i ° e 2 = e2 ° e 1
6) e 1 + e 2 = e2 + e 1
7) e 1 o (e2 + e3 ) = e1 o e2 + e1 ° e3
For this class of quasi-regular expressions, as opposed to regular languages, a sequence of producing/consuming resources does not matter. That is why property 5 is true for quasi-regular expressions, while it is false for regular ones.
Using rules described, we may similarly compose a quasiregular expression for the service investigated. To make representations more compact, we suppress interface conditions. Depicting a transition by a set of necessary resources is quite sufficient.
1—I ■'i 5 ■?
Figure 8. SWFN.
For example let us build quasi-regular expression for SWFN illustrated in Figure 8. We will consider resulted formula by parts Pl, P2, P3, P4.
PI: (? rl °? r2 ° (? r3 ° ! rl ° ! r2 ° ! r2) °? rl ° ! r4)
P2: (! rl +P1)
P3\ ! r2(?r2 °?r4 ° ! r3 ° ! r2)
P4: ? rO ° (P2 ° ! r3 ° P3 ° ! r5)
Expression for SWFN:
? rO ° ((! rl + (? rl °?r2 ° (?r3 ° ! rl ° ! r2 ° ! r2) °
? rl o ! r4)) ° ! r3 ° ! r2 (? r2 °?r4 ° ! r3 ° ! r2) ° ! r5)
To check services equivalence and other properties, we need a unified representation for services. In order to achieve this, it is necessary to develop an algorithm for expressions reduction to normal form.
Two resources with equal representation, which is symmetric about ‘?’ and ‘!’ we denote as complementary. For example, ! rl o ?r2o!r3 and ?rl o!r2o?r3 are complementary.
Two services we denote as compatible via resource conformance if their quasi-regular expressions contain two complementary resources.
Proposition 2. If service behaviors are compatible to each other, then two services are compatible via resource conformance.
Thus it is prerequisite condition for service compatibility.
IV. Conclusion
In this paper a service formal model is built and expression algebra for analyzing service compatibility via resource conformance, abstracting from underlying technologies and implementations is described. Detecting resource incompatibility in one of the first stages allows to avoid further verification consuming significant computing resources.
Further investigation in this field will be devoted to normal form construction for expressions, exploring new expression properties and compatibility proposition corroboration.
Besides, a piece of software is planned to be developed. Its main functions will concern service model and service expression construction, and compatibility checking by the properties described.
References
[1] C. Stahl. Service Substitution - A Behavioral Approach Based on Petri Nets Dissertation, Humboldt-Universitat zu Berlin, Mathematisch-Naturwissenschaftliche Fakult at II; Eindhoven University of T echnology, December 2009.
[2] V. A. Bashkin and I. A. Lomazova. Resource equivalence in workflow nets Proc. CS&P'2006. Vol.l. Informatik-Bericht 206. Humboldt-Universitat zu Berlin. Berlin, 2006, pp. 80-91.
[3] W. van der Aalst and K. van Hee. Workflow Management: Models, Methods and Systems MIT Press,2002.
[4] Axel Martens. Analyzing Web Service based Business Processes. In Maura Cerioli, editor, International Conference on Fundamental Approaches to Software Engineering (FASE 2005), volume 3442 of Lecture Notes in Computer Science, Edinburgh, Scotland, April 2005. Springer. [36, 40, 216, 217]
[5] I. A. Lomazova. Interacting Workflow Nets for Workflow Process ReEngineering. Fundamenta Informaticae, 2010. T.101. №1-2. C.59—70
[6] Peter Massuthe, Wolfgang Reisig, and Karsten Schmidt. An Operating Guideline Approach to the SOA. In 2nd South-East European Workshop on Formal Methods 2005 (SEEFM05), Ohrid, Republic of Macedonia, 2005.