<!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>Making YAWL and SmartPM Interoperate: Managing Highly Dynamic Processes by Exploiting Automatic Adaptation Features</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andrea Marrella</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Massimo Mecella</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessandro Russo</string-name>
          <email>arussog@dis.uniroma1.it</email>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Arthur H.M. ter Hofstede</string-name>
          <email>a.terhofstede@qut.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sebastian Sardina</string-name>
          <email>sebastian.sardina@rmit.edu.au</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Eindhoven University of Technology</institution>
          ,
          <country country="NL">the Netherlands</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Queensland University of Technology</institution>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>RMIT University</institution>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Sapienza Universita di Roma</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In the last years, the trade-o between exibility and support has become a leading issue in work ow technology. In this paper we show how an imperative modeling approach used to de ne stable and well-understood processes can be complemented by a modeling approach that enables automatic process adaptation and exploits planning techniques to deal with environmental changes and exceptions that may occur during process execution. To this end, we designed and implemented a Custom Service that allows the Yawl execution environment to delegate the execution of subprocesses and activities to the SmartPM execution environment, which is able to automatically adapt a process to deal with emerging changes and exceptions. We demonstrate the feasibility and validity of the approach by showing the design and execution of an emergency management process de ned for train derailments.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Process Management Systems (PMSs, a.k.a. Work ow Management Systems)
are applied to support and automate the enactment of processes with the aim to
increase their e ciency and e ectiveness. Classical PMSs o er adequate process
support as long as the processes are structured and do not require much
exibility. In the last years, the trade-o between exibility and support has become
a leading issue in work ow technology [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. An important aspect of exibility is
the ability to react to exceptions that may occur during runtime by dynamically
adapting the process.
      </p>
      <p>
        A PMS that supports automatic adaptivity is able to automatically change
the schema of a ected instances in such a way that they can still be completed,
according to the exceptions that have been raised. Process schemas are designed
in order to cope with potential exceptions, i.e., for each kind of exception that
is envisaged to occur, a speci c contingency process (a.k.a. exception handler
or compensation ow) is de ned, with the challenge that in many cases such a
compensation cannot be performed by simply undoing and then redoing certain
actions. Such an exception handler can be compared to the try-catch approach
used in some programming languages such as Java; the catch is the de nition
of the possible exception and the speci cation, de ned at design-time by the
process engineer, of how to deal with it. An interesting example is provided
by the exception handling capabilities of the Yawl system [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], that is among
the most well-known PMSs coming from academia. For each exception that can
be anticipated, it is possible to de ne an exception handling process, referred
to as an exlet, which includes a number of exception handling primitives (for
removing, suspending, continuing, completing, failing and restarting a workitem)
and one or more compensatory processes in the form of further Yawl processes
or in the form of worklets (i.e., self-contained Yawl speci cations executed as a
replacement for a workitem or as compensatory processes).
      </p>
      <p>
        Taken Yawl's exception handling framework as a starting point, the
innovation of this work is the automatic construction of exception handlers at run
time, i.e. the automatic synthesis of the catch blocks. Currently, exception
handlers for exceptions that have not occurred before and have not been anticipated
beforehand have to be de ned by a process administrator and this is a manual
activity. The proposed demo shows how an imperative modeling approach used
to de ne stable and well-understood processes (we will illustrate this by
extending the Yawl environment as it provides strong support for plugging in external
tools and services) can be complemented by a modeling approach that enables
automatic process adaptation and exploits planning techniques to deal with
environmental changes and exceptions that may occur during process execution. To
this end, we designed and implemented a Custom Service that allows the Yawl
execution environment to delegate the execution of subprocesses and activities
to the SmartPM execution environment [
        <xref ref-type="bibr" rid="ref4 ref5">5, 4</xref>
        ], which is able to automatically
adapt a process to deal with emerging changes and exceptions. We demonstrate
the feasibility and validity of the approach by showing the design and execution
of an emergency management process de ned for train derailments. The high
dynamism of the operating environment requires some activities to be executed
by the SmartPM subsystem and we show how it is able to automatically build
and execute recovery plans in response to environmental changes and external
events.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>The SmartPM Execution Environment</title>
      <p>
        SmartPM (Smart Process Management) [
        <xref ref-type="bibr" rid="ref4 ref5">5, 4</xref>
        ] is a model and a proof-of-concept
PMS featuring a set of techniques providing support for automatic adaptation
of processes. Such techniques are able to automatically adapt processes
without explicitly de ning handlers/policies to recover from exogenous events and
without the intervention of domain experts. SmartPM adopts a service-based
approach to process management, that is, tasks are executed by services (that
could be software applications, human actors, robots). The environment, services
and tasks are grounded in domain theories described in Situation Calculus [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
Situation Calculus is speci cally designed for representing dynamically changing
worlds in which all changes are the result of the tasks' execution. Each task is
described in terms of its preconditions and e ects, and can be considered as
a single step that consumes input data and produces output data. Data are
represented through process variables whose de nition depends strictly on the
domain of interest of the process involved. The model allows to de ne logical
constraints based on process variables that can be used to constrain task
assignment (through task preconditions), to assess the outcome of a task (through
task e ects) and as guards in expressions at decision points (e.g., for cycles
or conditional statements). Processes are represented as IndiGolog programs.
IndiGolog [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] allows for the de nition of programs with cycles, concurrency,
conditional branching and interrupts that rely on program steps that are actions
of some domain theory expressed in Situation Calculus. More details about the
SmartPM general framework and the formalization of processes can be found
in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        SmartPM provides mechanisms for adapting process schemas that require
no pre-de ned handlers. To this end, we use a specialized version of the
concept of adaptation from the eld of agent-oriented programming [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Speci cally,
adaptation in SmartPM can be seen as reducing the gap between the expected
reality, the (idealized) model of reality that is used by the PMS to reason, and
the physical reality, the real world with the actual values of conditions and
outcomes. Exogenous events and tasks' termination may lead to a deviation of the
physical reality from the expected reality. An execution monitor is responsible
for detecting whether the gap between the expected and physical realities is such
that the original process 0 cannot progress its execution. In that case, the PMS
has to nd a recovery process h that repairs 0 and removes the gap between the
two kinds of reality. Currently, the adaptation algorithm deployed in SmartPM
synthesizes a linear process h (i.e., a process consisting of a sequence of tasks)
and inserts it at a given point of the original process - speci cally, that point of
the process where the deviation was rst noted. To provide more details, let us
assume that the current process is 0 = ( 1; 2) in which 1 is the part of the
process already executed and 2 is the part of the process which remains to be
executed when a deviation is identi ed. The adapted process is 00 = ( 1; h; 2).
However, whenever a process needs to be adapted, every running task is
interrupted, since the \repair" sequence of tasks h = [t1; : : : ; tn] is placed before
them. Thus, active branches can only resume their execution after the repair
sequence has been executed. This last requirement is fundamental to avoid the
risk of introducing data inconsistencies during a repair.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>The SmartPM Service</title>
      <p>
        The service-oriented approach that characterizes the architecture of Yawl makes
the system easily extendable and provides direct support for implementing the
Flexibility as a Service approach [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In Yawl the engine manages running cases,
but is not directly responsible for task executions. Resources, entities and
systems able to execute tasks are abstracted as services that interact with the Yawl
engine via a set of interfaces. Speci cally, the interaction between the engine and
the Custom Services mainly occurs through Interface B, which provides an API
de ning endpoints for services to establish a session with the engine, launch
process instances, check work items in and out of the engine, and retrieve process
data and state information. At design-time each atomic task in a Yawl
specication can be associated with a so-called Custom Service [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] (e.g., the Default
Worklist Handler/Resource Service, the Worklet Service [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], the Declare
Service [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], etc.) that at run-time is responsible for task execution according to its
internal logic.
      </p>
      <p>A complete integration between Yawl and SmartPM has thus been
achieved by designing and implementing a Yawl Custom Service, named
SmartPM Service, that enables the interaction between the two environments.
The SmartPM Service enables the decomposition of Yawl tasks into processes
to be executed by SmartPM. At design-time, the process designer is thus able
to associate atomic tasks in the Yawl speci cation with the SmartPM Service.
The service requires as input variable a process to be performed by SmartPM,
de ned according to the formalism introduced in the previous section. If the
SmartPM process is already available at design-time, it can be directly
associated with the input variable required by the service. However, a process to be
delegated to SmartPM can also be built starting from an available template,
which is con gured and nalized by exploiting data produced as output by other
tasks in the main Yawl process. In this case, the executable SmartPM process
has to be produced as output by a Yawl task that precedes the task
associated with the SmartPM Service. The domain-dependent con guration of a
SmartPM template can be done either manually by a process designer or
automatically by a dedicated service. As any other Custom Service, the SmartPM
service implements the service-side of Interface B and is thus able to receive
noti cations from the Yawl engine when a new work-item is created and
delegated to the service for execution. Invoking the speci c methods provided by
the engine-side of Interface B, the SmartPM Service is then able to check-out
a work-item (i.e., notify the engine that the work-item is going to be executed)
and execute the corresponding SmartPM input process. Once the execution of
the subprocess has been completed, the service can check-in the work-item (i.e.,
notify the engine of execution completion), again via Interface B, along with the
corresponding output. Speci cally, the SmartPM Service produces as output,
among other possible values, a boolean one that indicates whether the input
subprocess was successfully completed or not. Control is then passed back to the
Yawl environment, which can continue to carry out the main process.
4</p>
    </sec>
    <sec id="sec-4">
      <title>A Demonstration Scenario</title>
      <p>As an application scenario, we consider an emergency management process
dened for train derailments and inspired by a real process used by the main
Italian Railway Company (that is \Reti Ferroviarie Italiane"). The
corresponding Yawl process to be executed is shown in Figure 1. The process starts when
the railway tra c control center receives an accident noti cation from the train
driver and collects some information about the derailment, including the train
ID code, the GPS location and the number of wagons and passengers. Then it
could be required to cut o the power in the area and to interrupt the railway
tra c near the derailment scene. In parallel, after having collected additional
information about the train (e.g., security equipment) and about emergency
services available in the area, an emergency response team can be sent to the
derailment scene. The information collected so far are then used for de ning
and con guring an incident response plan, which is de ned by the set of
activities to be executed directly on the eld by rst responders. Such activities
can instruct rst responders to act on location for evacuating people from train
wagons, to take pictures and to assess the gravity of the accident. The high
dynamism of the operating environment requires that such activities are executed
by the SmartPM subsystem. We assume that operators are equipped with
mobile devices and coordinate themselves through the SmartPM process execution
environment. Here, context-awareness and managing frequent exogenous events
(e.g., bad connections between devices and operators) is crucial. Let us suppose,
for example, that a re breaks out in one of the wagons. From the SmartPM
point of view, it means that an exogenous event changes asynchronously the
value of the current physical reality, by turning the variable that represents the
status of the red wagon from \safe" to \ red". Since in the expected reality it is
forecast that every wagon is safe after passengers evacuation, the SmartPM
execution monitor senses that the discrepancy between the two realities is relevant
and starts reasoning on the basis of the available tasks and of the capabilities
provided by rst responders. The target is to nd a recovery process that
reduce the above gap. In this case, SmartPM automatically builds a recovery
process that concerns reaching the location of the red wagon and starting
extinguishing re. Such a couple of tasks is assigned to that rst responder that
provides all the capabilities needed to execute them. When every wagon is
evacuated and the situation is turned to the normality, the process control comes
back again to Yawl, that can execute the last task about the restoring of the
railway infrastructure. A screen-cast of the proposed demonstration is available
at http://www.dis.uniroma1.it/~marrella/public/DemoBPM2011.zip.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>In this demonstration paper we outlined how an imperative modeling approach
used to de ne stable and well-understood processes can be complemented by
a modeling approach that enables automatic process adaptation. To this end,
we designed and implemented a Custom Service that allows the Yawl
execution environment to delegate the execution of subprocesses and activities to
the SmartPM execution environment, which is able to automatically adapt a
process to deal with emerging changes and exceptions. We demonstrated the
feasibility and validity of the approach by showing the design and execution of
an emergency management process de ned for train derailments.
Acknowledgments. The work of Andrea Marrella, Massimo Mecella and
Alessandro Russo has been partly supported by the projects TESTMED, FARI
2010, SmartVortex and Greener Buildings.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Adams</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ter Hofstede</surname>
            ,
            <given-names>A.H.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Edmond</surname>
            , D., van der Aalst,
            <given-names>W.M.P.</given-names>
          </string-name>
          :
          <article-title>Worklets: A Service-Oriented Implementation of Dynamic Flexibility in Work ows</article-title>
          .
          <source>In: Proc. of the 14th Int. Conf. on Cooperative Information Systems (CoopIS)</source>
          ,
          <volume>291</volume>
          {
          <fpage>308</fpage>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. De Giacomo,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Lesperance</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Levesque</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.J.</given-names>
            ,
            <surname>Sardina</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.:</surname>
          </string-name>
          <article-title>IndiGolog: A HighLevel Programming Language for Embedded Reasoning Agents</article-title>
          .
          <source>In: Multi-Agent Programming: Languages, Platforms and Applications</source>
          ,
          <volume>31</volume>
          {
          <fpage>72</fpage>
          . Springer (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. De Giacomo,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Reiter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Soutchanski</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Execution Monitoring of High-Level Robot Programs</article-title>
          .
          <source>In: Proc. of the 6th International Conference on Principles of Knowledge Representation and Reasoning (KR)</source>
          ,
          <fpage>453</fpage>
          -
          <lpage>465</lpage>
          (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. de Leoni,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Marrella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Mecella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Sardina</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.:</surname>
          </string-name>
          <article-title>SmartPM { Featuring Automatic Adaptation to Unplanned Exceptions, SAPIENZA Universita di Roma</article-title>
          ,
          <source>DIS Technical Report 04-2011</source>
          . http://ojs.uniroma1.it/index.php/DIS_ TechnicalReports/article/download/9221/9141 (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. de Leoni,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Mecella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>De Giacomo</surname>
          </string-name>
          , G.:
          <article-title>Highly Dynamic Adaptation in Process Management Systems Through Execution Monitoring</article-title>
          .
          <source>In: Proc. of the 5th International Conference of Business Process Management (BPM)</source>
          ,
          <volume>182</volume>
          {
          <fpage>197</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Reiter</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Knowledge in Action: Logical Foundations for Specifying and Implementing Dynamical Systems</article-title>
          . The MIT Press (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Adams</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ter Hofstede</surname>
            ,
            <given-names>A.H.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pesic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schonenberg</surname>
          </string-name>
          , H.:
          <article-title>Flexibility as a Service. In: Proc. of Database Systems for Advanced Applications (DASFAA) International Workshops (</article-title>
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aldred</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ter Hofstede</surname>
            ,
            <given-names>A.H.M.</given-names>
          </string-name>
          :
          <article-title>Design and Implementation of the YAWL System</article-title>
          .
          <source>In: Proc. of the 16th International Conference on Advanced Information Systems Engineering (CAiSE)</source>
          ,
          <volume>142</volume>
          {
          <fpage>159</fpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pesic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schonenberg</surname>
          </string-name>
          , H.:
          <article-title>Declarative work ows: Balancing between Flexibility and Support</article-title>
          . In: Computer Science - R&amp;D,
          <volume>23</volume>
          , 99{
          <fpage>113</fpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>