07.03.2014 Views

BPMN and Beyond Business process modelling notation, workflow ...

BPMN and Beyond Business process modelling notation, workflow ...

BPMN and Beyond Business process modelling notation, workflow ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The <strong>BPMN</strong> st<strong>and</strong>ard forsees also that in each round a loopCounter is updated, which can be used<br />

in the loopCond (as well as a loopMaximum location). The st<strong>and</strong>ard document does not explain<br />

however whether the input is taken only once, at the entry of the iteration, or at the beginning<br />

of each iteration step. There are reasonable applications for both interpretations, so that the issue<br />

should be clarified. This is partly a question of whether the function inputs, which is applied to<br />

the selected input set currInput(node) to provide the input for the iterBody of the to be iterated<br />

activity, is declared to be a static or a dynamic function.<br />

The preceding discussion is summarized by the following rule for nodes with loopType(node) =<br />

St<strong>and</strong>ard. For a natural definition of while <strong>and</strong> until in a way that is compatible with the synchronous<br />

parallelism of ASM execution see [12, Ch.4]. We use an abstract function loopToken to<br />

denote how (if at all) the information on loop instances <strong>and</strong> incoming tokens is elaborated during<br />

the iteration.<br />

LoopTransition(node) = [if Enabled(in) then]<br />

let t = firingToken(in)<br />

LoopEntry(node, t)<br />

seq<br />

if testTime(node) = before then<br />

while loopCond(node, t) LoopBody(node, t)<br />

if testTime(node) = after then<br />

until loopCond(node, t) LoopBody(node, t)<br />

[seq LoopExit(node, t)]<br />

where<br />

LoopBody(n, t) =<br />

loopCounter(node, t) := loopCounter(node, t) + 1<br />

iterBody(node, loopToken(t, loopCounter(node, t) + 1)[, inputs(currInput(node))])<br />

The auxiliary machines LoopEntry <strong>and</strong> LoopExit are defined as follows (the possibly missing<br />

parts, in case there is no incoming/outgoing sequence flow or no input/output, are in square<br />

brackets). Note that the predicate LoopCompleted(n) is not defined in the st<strong>and</strong>ard document. It<br />

seems that the st<strong>and</strong>ard permits to exit a loop at any place, for example by a link intermediate<br />

event (Fig.10.46 p.126) or by a so-called Go To Object (Fig.10.45 ibid.), so that the question has<br />

to be anwered whether this is considered as completion of the loop or not (see the example for<br />

“improper looping” in Fig.10.51 p.129).<br />

LoopEntry(n, t) =<br />

loopCounter(n, t) := 0<br />

[Consume(t, in)]<br />

[currInput(n) := select InputSets (SomeAvail(inputSets(n)))]<br />

LoopExit(n, t) =<br />

if Completed(n, t) then<br />

[ProduceOutput(outputSets(n), currInput(n))]<br />

[Produce(loopExitToken(t, loopCounter(n, t)), out)]<br />

Completed(n, t) = LoopCompleted(n, t) if n ∈ Loop(t)<br />

Multi-Instance Loops The iteration condition of activities in the set MultiInstance of multiinstance<br />

loops is integer-valued, an expression (location in ASM terms) denoted miNumber, called<br />

MI-Condition in the st<strong>and</strong>ard document. A miOrdering for the execution of the instances is defined,<br />

which is either parallel or sequential. In the latter case the order seems to implicitly be understood<br />

as the order of integer numbers, so that we can use for the description of this case the ASM construct<br />

foreach (for a definition see the appendix Sect. 10) followed by the submachine LoopExit defined<br />

above. Also in this case a loopCounter is “updated at runtime”, though here it is allowed to<br />

only be “used for tracking the status of a loop” <strong>and</strong> not in miNumber, which is assumed to<br />

be “evaluated only once before the activity is performed” [15, Sect.9.4.1]. We reflect in the rule<br />

26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!