Page 192 -
P. 192

6  Declarative Workflow                                          183
                           executed between the first A and the subsequent B. The template precedence speci-
                           fies that task B can be executed only after task A is executed. Just like in the response
                           template, other tasks can be executed between tasks A and B. The combination of
                           the response and precedence templates defines a bi-directional execution order of
                           two tasks and is called succession. In this template, both response and precedence
                           relations have to hold between the tasks A and B. Template alternate precedence
                           strengthens the precedence template: tasks A and B have to alternate. The not coex-
                           istence template specifies that tasks A to B cannot both be executed in the same
                           instance. The 1of 4 template specifies that at least one of the three tasks A, B, C,
                           and D has to be executed, but all four tasks can be executed an arbitrary number of
                           times as long as one of them occurs at least once.



                           6.2.3 Branching of Templates


                           The behavior of models containing multiple constraints is given by the conjunction
                           of all constraints. In some cases it might be necessary to specify the disjunction
                           of constraints. This can be done by assigning more than two tasks to one parame-
                           ter in a template. When a template parameter is replaced by more than one task in
                           a constraint, then we say that this parameter branches. An example of a branched
                           precedence constraint is shown in Fig. 6.6, where parameter A has been replaced by
                           the task bill and parameter B is branched on tasks pickup and delivery. In case of
                           branching, the parameter is replaced (1) by multiple arcs to all branched tasks in
                           the graphical representation and (2) by a disjunction of branched tasks in the LTL
                           formula. The semantics of branching can vary from template to template, depending
                           on the LTL formula of the template. For example, the branched constraint in Fig. 6.6
                           specifies that each occurrence of bill must be preceded by at least one occurrence
                           of the task pickup or the task delivery. Note that it is possible to branch all parame-
                           ters, one parameter, or none of the parameters. The number of possible branches in
                           constraints is unlimited. For example, it is possible to branch the parameter B in the
                           response template to N alternatives, as shown in Fig. 6.6.
                              Another way of branching templates are choice templates, which can be used to
                           specify that one must choose between tasks. An example of such a template is the
                           1of 4 template (see Fig. 6.5), which is used to specify that at least one of the four
                           given tasks has to be executed.




                           6.2.4 An Example Language: ConDec


                           As explained before, we use LTL as a basis to define constraint templates. The
                           template is defined by specifying the corresponding LTL formula and graphical
                           representation. This makes it easy to create various languages, as any collection
                           of constraint templates forms a language. In this chapter, the focus is on the
   187   188   189   190   191   192   193   194   195   196   197