<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>EWFN - A Petri Net Dialect for Tuplespace-based Work ow Enactment*</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Daniel Martin</string-name>
          <email>martin@iaas.uni-stuttgart.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Wutke</string-name>
          <email>wutke@iaas.uni-stuttgart.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Frank Leymann</string-name>
          <email>leymann@iaas.uni-stuttgart.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Architecture of Application Systems University of Stuttgart Universitatsstrasse 38</institution>
          ,
          <addr-line>70569 Stuttgart</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Petri nets are a formalism for describing systems where interactions between active components { so-called transitions { are modeled as exchanges of tokens over passive places. Whether a transition may re is solely dependent on the availability of tokens in its incoming places; similarly a transition forwards control to subsequent transitions by storing tokens in their respective input places. This interaction model of strong decoupling through local actions and local e ects makes distributed systems modeled via Petri nets highly extensible. In this paper, we present the syntax and semantics of a model that leverages the extensibility provided by Petri nets for representing BPEL processes in a way that enables their distributed and decentralized execution using tuplespace middleware. Said middleware implements the proposed Petri net dialect and therefore allows for direct, distributed execution of the modeled processes.</p>
      </abstract>
      <kwd-group>
        <kwd>Petri nets</kwd>
        <kwd>Tuplespaces</kwd>
        <kwd>Work ow</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Petri nets were originally designed as a model for arbitrary extensible computer
architectures i.e. machines that consist of many individual modules, each of them
responsible for a particular task of the overall system. Adding a new module has
no impact on the existing ones, their performance characteristics for instance do
not change at all. Three underlying design principles [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] facilitate this behavior: (i)
there is no central point of control, especially, there is no central clock. Moreover,
synchronizing clocks between modules is considered bad design and should be
avoided in any case. (ii) Each action is triggered locally, and has only local e ect;
i.e. enabling of a transition only depends on its input places, ring of a transition
only e ects its output places. There is no way to access the global state of the
system. (iii) Petri nets are inherently asynchronous in nature, communication
solely happens over local interfaces in a peer to peer like manner.
* This work is supported by the EU funded project TripCom (FP6-027324)
      </p>
      <p>
        These principles build the foundation for our model, that is naturally based
on Petri nets. In their spirit, we de ne a set of individual components and the
communication between them. The communication middleware that facilitates
component interaction during execution of the model is based on tuplespaces,
since (i) they closely resemble the design properties of petri nets in terms of loose
coupling and asynchronous communication [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and (ii) each element of a Petri
net can be directly mapped to an entity in a tuplespace based system (either a
component, a tuple or a tuplespace).
      </p>
      <p>
        Tuplespace technology has its origin in the Linda coordination language,
de ned in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] as a parallel programming extension for programming languages for
the purpose of separating coordination logic from program logic, i.e. the actual
application code. The Linda concept is built on the notion of a tuplespace, a
piece of memory that is shared among all interacting parties. A user interacts
with the tuplespace by storing and retrieving tuples (i.e. an ordered list of typed
elds) via a simple interface: tuples can be (i) stored (using the write operation),
(ii) retrieved destructively (take) and (iii) non-destructively (read ). Tuples are
retrieved using a template mechanism, e.g. by providing values of a subset of the
typed elds of the tuple to be read, similar to query by example [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] (\associative
addressing"). Using tuplespace-based coordination, execution of a component's
computational logic is triggered when tuples matching the templates registered
by the respective component are present in the tuple space. Thus, the templates
a component uses to consume tuples and the tuples it produces represent its
coordination logic.
      </p>
      <p>
        In this paper, we de ne a variant of Petri nets, called Executable Work ow
Networks (EWFN), speci cally designed to represent BPEL work ows and being
executed \natively" on an extended, Linda-like tuplespace system. The basis
for our model are colored, non-hierarchical Petri nets (CPN) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and Boolean
networks [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We present an extension of the model presented in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], building
upon the syntax and concentrate on the description of the semantics.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Syntax</title>
      <p>De nition 1 (EWFN). An EWFN is a directed, bipartite graph</p>
      <p>
        EWFN = ( ; P; T; F; X; A; M0; Lw)
= fCF; DATA N; DATA N String; : : : ; g denotes the set of tokens
(tuples). Note that comprises two di erent categories of tokens: (i) control
ow tokens CF = (\CF" S N N N) with S = f\POS"; \NEG"; \FAIL"g
denoting either \positive", negative (a.k.a dead path, a special form of \negative"
control ow necessary for dead path elimination in WS-BPEL) or control ow
initiated by a failure, and (ii) data tokens representing BPEL variables and
process meta-data. The three integer elds represent processID, instanceID and
scopeID in order to be able to distinguish between process models, process
instances and scopes that were initiated by event-handlers. Data tokens consist of
the generic data tuple (denoted as DATA = (\DATA" N N)) concatenated
with variable de nitions (in tuple form) from the respective process. We represent
arbitrary structured data by serializing its tree-based representation (e.g. in
the form of an XML-DOM [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]) into nested tuples. Furthermore, contains the
\empty" tuple used to denote that actually no tuple is produced.
      </p>
      <p>Note that like most other formalizations of Petri nets, our description is
based on multi-sets, we therefore de ne the operators +, , etc. to be de ned on
multi-sets as well.</p>
      <p>P is a nite set of places and T a nite set of transitions such that P \ T = ;.</p>
      <p>
        F (T P ) [ (P T R), with R = fread; takeg is a set of arcs known as
ow relation. The set F is subject to the constraint that no arc may connect two
places or two transitions. The arc types correspond to classical Linda operations
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]: write (a.k.a out ) arcs go from transitions to places (i.e. are member of the
set (T P )), whereas read (a.k.a rd ) and take (a.k.a in) arcs go from places to
transitions, with arc inscription R denoting the type of arc. Take arcs are known
from classical Petri nets (i.e. they destructively consume tokens from places).
Read arcs (a.k.a test arcs) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] in contrast allow a transition to non-destructively
read a token from a place.
      </p>
      <p>X is a set of templates in tuple form, that may either contain a wildcard (?)
or a concrete value as element.</p>
      <p>A : (P T R) ! X is a function that assigns templates to incoming arcs of a
transition such that 8(p; t; r) 2 F \ (P T R) : A((p; t; r)) 2 X. Sometimes, we
use A without the last parameter, as a shortcut to access the template assigned
to an arc pointing to a transition. In these cases, it is not important whether the
template is used in a read or a take operation.</p>
      <p>M0 : P ! MS is an initialization function that assigns a multi-set over
to places such that 8p 2 P : M0(p) 2 MS This function initializes the network
by assigning a multi-set of colored tokens to each place. It is also allowed that
the expression is missing, i.e. a place is initialized with the empty color multi-set.</p>
      <p>Lw : (T P ) ! is the Linda write function that determines the token
to be written by each outgoing arc of a transition. Writing an empty tuple ( )
means that no tuple is written at all.</p>
      <p>
        De nition 2 (tuple element). A tuple element T E is a tuple (p; tu), p 2 P ,
tu 2
De nition 3 (marking). A marking M 2 T EMS is a multi-set (denoted as
MS ) over tuple elements. Each place may contain one or more equal tuple elements,
thus the marking is de ned as a multi-set. Note that we may also use M as a
function such that 8p 2 P : M (p) 2 MS
De nition 4 (Lr). Linda read operations (destructive and non-destructive) are
formalized as a function Lr : X MS ! . According to Linda's semantics
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], only one tuple is returned regardless the number of matching tuples. It is not
determined which tuple of the set of matching tuples is returned: Lr(te; tuMS ) =
tu 2 tuMS jtu te.
      </p>
      <p>is a binary relation over the sets
a tuple: X.</p>
      <p>and X, specifying if a template matches
(tu; te) 2
i
jtuj = jtej ^ (8n 2 1:: jtej : n(te) =
n(tu) _ n(te) = ?)
i(t) returns a projection to the ith component of a tuple tu, jtuj denotes the
size of a tuples, i.e. the number of elements it contains.</p>
      <p>A template therefore is a tuple that has either a wildcard (denoted by the ?
character) or a concrete value on each position. A template matches a tuple i
(i) both have the same number of elements and (ii) each concrete value in the
tuple equals the value on the same position in the template, or (iii) the template
has a wildcard on this position.</p>
      <p>
        De nition 5 (strongly connected). An EWFN is called strongly connected
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] i for every pair of nodes (places and transitions) x and y there is a ring
sequence leading from x to y.
      </p>
      <p>
        Similar to WF-nets [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], an EWFN has two special kinds of transitions: ta
and to. There is no arc pointing to ta, i.e. ta = ;, similarly, to has no outgoing
arcs, i.e. to = ;. If we add a place p? to the EWFN to connect transition to with
ta (i.e. p? = ftog and t? = ftag), then the resulting net is strongly connected.
Transitions of type ta do not have a precondition, i.e. are formally allowed to re
any time. We use such transitions to create process instances (i.e. create a CF
tuple with new instance id) in our model. Similarly, to does not have outgoing
transitions, this transition only consumes tokens from the EWFN and is used to
log process instance termination.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Semantics</title>
      <p>A transition t 2 T that executes a destructive read operation (a.k.a take) changes
marking M1 to M2 as follows:
8p 2 t : M2(p) = M1(p)</p>
      <p>Lr(A((p; t; \take")); M1(p))</p>
      <p>A transition t 2 T that executes a non-destructive read operation in contrast,
does not have any e ect on the marking:</p>
      <p>8p 2 t : M2(p) = M1(p)</p>
      <p>The set of places that have arcs pointing to transition t is denoted as t =
fpjpF tg, the set of transitions that have arcs pointing to place p is denoted as
p = ftjtF pg, with F being the ow relation. t and p are de ned accordingly.
De nition 6 (enabled). A transition t 2 T is called enabled in marking M i
8p 2 t : Lr(A((p; t)); M (p)) 6= ;</p>
      <p>
        It is important to notice that the templates of read operations may overlap,
i.e. if two di erent transitions destructively read from the same place with
templates that (partially) match the same tuple, a con ict is created. According
to Linda semantics [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], this con ict is resolved non-deterministically. Clearly,
non-deterministic decisions are not suitable for work ow de nitions. That is why
we extend the enablement rule of a transition in EWFNs to be \con ict free"
enabled. If there are transitions in an EWFN that cause con icts, the EWFN is
not valid.
      </p>
      <p>De nition 7 (con ict-free enabled). A transition t 2 T is called con ict-free
enabled in marking M i
t is enabled ^
8t0 2 ( t) n ftg : t0 is not enabled _
8p 2 t \ t0 : Lr(A((p; t)); M (p)) 6= Lr(A((p; t0)); M (p)) _
(8p 2 t \ t0 : Lr(A((p; t)); M (p)) = Lr(A((p; t0)); M (p)) ^</p>
      <p>(p; t; \read") 2 F ^ (p; t0; \read") 2 F )</p>
      <p>
        Intuitively, a transition t is con ict free enabled if all other transitions t0
that share an input place with this transition are not enabled, they do not read
the same tuple or they read the same tuple but all issue non-destructive read
operations only on the place in question. Since we describe executable work ows,
con ict situations where the actual decision is not-determined and ultimately
lead to \confusion" [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] are not desired in our model.
      </p>
      <p>The property of con ict-freeness however is de ned on enablement of a
transition, i.e. it can only be checked during runtime. The following, alternative
de nition de nes con ict-freeness of a transition based on the templates of the
read operations it issues, thus allows to check for con ict-freeness of an EWFN
on the syntactical level, i.e. check an EWFN after transformation from BPEL.
De nition 8 (con ict-free transition). A transition t 2 T is called con
ictfree i
8p 2 t 8t0 2 p
n ftg : A((p; t)) \ A((p; t0)) = ; _</p>
      <p>((p; t; \read") 2 F ^ (p; t0; \read") 2 F )</p>
      <p>A transition t is con ict-free i the intersection of templates of the read
operations from di erent transitions reading from shared places with t is empty,
or every transition in question issues only non-destructive read operations. For
the reasons mentioned before, we enforce all transitions in an EWFN to be
con ict free.</p>
      <p>De nition 9 (satis ed). A template te 2 X is called satis ed on multi-set
tuMS i Lr(te; tuMS ) 6= ;. This can also be written as function Sat : X MS !
B.</p>
      <p>Sat(te; tuMS ) =</p>
      <p>true; if Lr(te; tuMS ) 6= ;
false; otherwise
De nition 10 ( re). A transition t 2 T that is enabled in marking M1 may
re and change marking M1 to M2 as follows:
8p 2 t [ t : M2(p) = M1(p)</p>
      <p>X Lr(A((pn; t)); M1(pn)) +</p>
      <p>X Lw(t; pn)
Note that in this de nition, the operators +, and P are de ned on multi-sets,
removing and adding tuples from the multi-set respectively.</p>
      <p>We extend the template matching from De nition 4 to be able to understand
join variables as elds in a template tuple. Join variables allow to express a
restriction on the enablement of a transition such that it is only enabled if every
template of its read/take operations that use a join variable is satis ed and the
tuple elements on the position of the join variable are equal for each join variable.
Note that for the matching itself a join variable is treated as wildcard (?).</p>
      <p>Consider the join of two threads of control ow of the same work ow instance
and process model, identi ed by the ids iid and pid respectively:
te1 = (\CF"; ?pid; ?iid)
te2 = (\CF"; ?pid; ?iid)
The transition using two separate take operations with te1 and te2 as templates
is only enabled if there are tuples available in both incoming places that have
equal values on their second and third position.</p>
      <p>De nition 11 (join matching). A transition t 2 T that uses join variables in
its template operations is enabled in marking M i
8p 2 t : Lr(A((p; t))[? =?]; M (p)) 6= ; ^
8p1; p2 2 t 9n 2 N : n(A((p1; t))) is join variable ^
n(A((p2; t))) is join variable ^
n(A((p1; t))) =
n(A((p2; t))) ^
n(Lr(A((p1; t)); M (p1))) =
n(Lr(A((p2; t)); M (p2)))</p>
      <p>The treatment of join variables for the actual matching is expressed as [? =?],
meaning that every variable that starts with a ? is replaced by a wildcard (?).</p>
      <p>
        For space reasons, we omit the usual de nitions for ring sequence, reachability,
liveness, boundedness, safeness well structuredness and well-formedness [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] for
EWFNs.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion and Future Work</title>
      <p>In this paper, we presented a tuplespace-based Petri net dialect that is natively
executable on a tuplespace system, i.e. each element of the Petri net has an
equivalent element or operation on a tuplespace. An EWFN therefore is a kind of
\byte code" for tuplespace-based applications; they can be designed using EWFNs
and then directly transformed to a running application.</p>
      <p>The main idea behind the development of EWFNs however is their use
in decentralized work ow enactment. We are working on a BPEL engine that
transforms BPEL les to EWFNs and then executes them based on tuplespaces.
Each tuplespace can reside on a di erent machine in the network, thus the engine
and even the execution of a single process instance may be arbitrarily distributed.
The key enabler for this architecture are Petri nets and their inherent properties
such as: no central point of control, local actions, local e ects, asynchronous
interaction.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Reisig</surname>
          </string-name>
          , W.:
          <source>Petri nets: An Introduction</source>
          . Springer-Verlag New York, Inc. New York, NY, USA (
          <year>1985</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Aldred</surname>
          </string-name>
          , L.,
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.,
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ter Hofstede</surname>
          </string-name>
          , A.:
          <article-title>On the Notion of Coupling in Communication Middleware</article-title>
          .
          <source>Proc. of Intl. Symposium on Distributed Objects and Applications (DOA)</source>
          (
          <year>2005</year>
          )
          <volume>1015</volume>
          {
          <fpage>1033</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Gelernter</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Generative Communication in Linda</article-title>
          .
          <source>ACM Transactions on Programming Languages and Systems</source>
          <volume>7</volume>
          (
          <year>1985</year>
          )
          <volume>80</volume>
          {
          <fpage>112</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Zlo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Query by Example</article-title>
          .
          <source>AFIPS Conference Proceedings, 1975 National Computer Conference 44</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Jensen</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <source>Coloured Petri Nets</source>
          , Vol.
          <volume>1</volume>
          :
          <string-name>
            <given-names>Basic</given-names>
            <surname>Concepts</surname>
          </string-name>
          .
          <source>EATCS Monographs on Theoretical Computer Science</source>
          . Berlin, Heidelberg, New York: Springer-Verlag (
          <year>1992</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Langner</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wehler</surname>
          </string-name>
          , J.:
          <article-title>Prozessmodellierung mit ereignisgesteuerten Prozessketten (EPKs) und Petri-Netzen</article-title>
          .
          <source>Wirtschaftsinformatik</source>
          <volume>39</volume>
          (
          <issue>5</issue>
          ) (
          <year>1997</year>
          )
          <volume>479</volume>
          {
          <fpage>489</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Wutke</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martin</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leymann</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Model and infrastructure for decentralized work ow enactment</article-title>
          .
          <source>Proceedings of the 23rd ACM Symposium on Applied Computing (SAC'08)</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Le</given-names>
            <surname>Hors</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          , et al.:
          <article-title>Document Object Model (DOM) Level 3 Core Speci cation</article-title>
          .
          <source>W3C Recommendation</source>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Vogler</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Semenov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yakovlev</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Unfolding and Finite Pre x for Nets with Read Arcs</article-title>
          .
          <source>Proceedings of the 9th International Conference on Concurrency Theory</source>
          (
          <year>1998</year>
          )
          <volume>501</volume>
          {
          <fpage>516</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.:
          <article-title>The Application of Petri Nets to Work ow Management</article-title>
          .
          <source>The Journal of Circuits, Systems and Computers</source>
          <volume>8</volume>
          (
          <issue>1</issue>
          ) (
          <year>1998</year>
          )
          <volume>21</volume>
          {
          <fpage>66</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>