<!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>Unicorn meets Chimera: Integrating External Events into Case Management</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jonas Beyer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Patrick Kuhn</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marcin Hewelt</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sankalita Mandal</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mathias Weske</string-name>
          <email>Mathias.Weskeg@hpi.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Hasso Plattner Institute, University of Potsdam</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <fpage>67</fpage>
      <lpage>72</lpage>
      <abstract>
        <p>Case management allows knowledge workers to model and enact exible, knowledge-intensive business processes. Such processes occur in many domains, e.g. logistics or healthcare, and the exact course of a case can not be pre-speci ed, because it heavily depends on case data, user decisions, and external events, which take place during runtime. This work extends our case management engine Chimera with the capability to incorporate external events. To this end we integrate Chimera with the event processing platform Unicorn, with the result that external events can now trigger new cases, provide case data, or abort activities. This demo is aimed at practitioners and academics in the eld of exible business processes and case management.</p>
      </abstract>
      <kwd-group>
        <kwd>Case Management</kwd>
        <kwd>Business Process Management</kwd>
        <kwd>Complex Event Processing</kwd>
        <kwd>Case Execution</kwd>
        <kwd>exible Business Processes</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Case Management is an approach suitable for the modeling and execution of
knowledge-intensive business processes that center around a case. When
executing a case, competent knowledge workers try to achieve the speci c case goal,
by aligning their activities with the emergent requirements of the case. However,
the sequence of activities executed towards the goal, depends on the speci c
circumstances of the case, which only become apparent during case execution,
and hence can not be pre-speci ed.</p>
      <p>
        When dealing with highly exible processes, integrating external events is
necessary to enable case workers to react e ciently and adapt their work to
the current situation. Complex event processing is an already proven mean to
provide high level events relevant to the course of the process [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], eventually
cases. While process modeling languages like BPMN 2 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] allow to model several
kinds of events, process engines like Camunda or Activiti1 are limited to their
engine-internal events.
      </p>
      <p>
        This work builds on the case management engine Chimera2 that was
presented at last year's BPM demo under the name JEngine [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Here we
extend Chimera with capabilities to deal with external events by registering event
queries with the event processing platform Unicorn3, and reacting on received
event noti cations. Furthermore, we present the case modeling tool Gryphon. It
allows knowledge workers to model event types as part of the domain model of a
case model, as well as process fragments that are annotated with event queries.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Fragment-based Case Management</title>
      <p>
        In our project, we consider the fragment-based case management approach (fCM)
by [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ], where a business scenario is represented by a case model consisting of
a set of fragments, a domain model, and a set of life cycles. Each fragment is a
process model that contains control ow necessary to describe how to handle a
subsection of the case. Upon execution, the fragment instances are dynamically
combined based on their data dependencies. The data classes and their
associations, as well as their domain speci c attributes are de ned in the domain model.
Each data class has a corresponding object life cycle that speci es possible state
transitions a data object of that class can undergo during case execution. The
Chimera approach uses BPMN for the fragments, UML for the domain model,
and state transition graphs for the life cycles. The semantics of fragment-based
case management has been formally de ned in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Event Integration into fCM</title>
      <p>We explain the concept of integrating events with the usecase of asparagus
harvest. External factors like temperature and weather prediction in uence the
harvesting process. One important aspect of the usecase is depicted in Fig. 1 that
shows one of several process fragments contained in the case model of our
usecase. In order to balance supply and demand for asparagus the harvest date
needs to be coordinated with other asparagus farmers in the region.</p>
      <p>The fragment in Fig. 1 is enabled once the Harvest Plan has been [created].
The farmer then starts preparing resources and equipment for the harvest. But
as depicted by the event-based-gateway, if the Market price dropped event
occurs before the harvest date, the Market Situation data object is updated and
the harvest has to be postponed.</p>
      <p>In the remaining part of the section, the work ow for implementing the use
case in our execution environment is discussed. Figure 2 provides an overview of
all components and their interactions.</p>
      <sec id="sec-3-1">
        <title>2 see https://bpt.hpi.uni-potsdam.de/Public/ChimeraDoc</title>
      </sec>
      <sec id="sec-3-2">
        <title>3 see http://bpt.hpi.uni-potsdam.de/UNICORN</title>
        <p>Case model creation. In order to include external events in the execution of a
case, they rst have to be modelled. It is possible to de ne event types that
describe the domain and the attributes of events. Speci c events triggering
actions in the case can be modelled using event queries. Event queries are similar
to database queries, the di erence being that they operate on event streams
instead of persistent data. If an event from the stream matches the query, the
event is then sent to the execution engine. We chose the Event Processing
Language (EPL) provided by Esper4, as language to express those event queries.
We decided to reuse the catching message event to model enabled events as
noti cations can be considered as receiving messages.</p>
        <p>To model the case, we used Gryphon, a web-based tool built around bpmn.io5
based on a node.js6-stack. Gryphon allows to model process fragments, domain
model, life cycles, and termination conditions. The completed case model can
then be deployed to a running Chimera instance.</p>
      </sec>
      <sec id="sec-3-3">
        <title>4 see http://www.espertech.com/products/esper.php</title>
        <p>5 An open-source BPMN modeler implemented in Javascript http://bpmn.io</p>
      </sec>
      <sec id="sec-3-4">
        <title>6 see http://node.js</title>
        <p>(a) Modeling of data attribute bindings
(b) Modeling of event queries
Model deployment. Chimera is an engine for executing case models, consisting
of a web-based frontend and a backend communicating via a RESTful API.
Chimera parses the received case model and registers event types and case start
queries with Unicorn. The case can then be executed through the web UI, where
the user is presented with an overview of all case models.</p>
        <p>Chimera also supports incorporating events as case data. Events are received
in the form of JSON objects, where each attribute eld has a speci c value. Thus,
we can parse the JSON and set data object attributes according to the event
attribute values. This is implemented by evaluating JsonPath7 expressions. The
user can specify one JsonPath expression per attribute of the data object that
is used to persist the values, as seen in gure 3a.</p>
        <p>Event and query registration. Whenever an event is reached during execution
in Chimera, an event query is registered with Unicorn. Unicorn is an event
processing platform built around the Esper Event Processing Engine that allows
to manage event types, event queries, and noti cations both via a web-based
UI and a REST API. Events are sent to Unicorn either via a REST API or by
means of adapters, that periodically call webservices.</p>
        <p>A general overview of the event registration process is shown in Fig. 4. The
registered event queries can be divided into two groups. Case start queries have
to be registered when a new case model is deployed to Chimera and remain
registered until the case is deleted. All other event queries are registered as soon
as the respective event control node is reached. The annotation to register event
queries has been shown in Fig. 3b. Each query is registered with a speci c id,
which is used to correlate the event control node to the event query after it was
triggered. The queries are unregistered from Unicorn when the event is triggered
or skipped.</p>
        <p>Event generation. In our use case, events were produced by a sensor unit.
Because we did not have access to real \production elds", the sensor unit used
was the Bosch XDK developer kit8, a package with multiple integrated sensors
for prototyping of IoT applications. The unit sends measurement values over</p>
      </sec>
      <sec id="sec-3-5">
        <title>7 see http://goessner.net/articles/JsonPath/</title>
      </sec>
      <sec id="sec-3-6">
        <title>8 see http://xdk.bosch-connectivity.com</title>
        <p>wireless network to a gateway that parses the proprietary format of the received
data and forwards it to Unicorn using the REST API.</p>
        <p>Reactions to events. If the event is linked to a case start query, the case is
initiated. The speci ed data objects are created using the information given by
the start query | this includes the initial data object state and its attribute
values. Otherwise, the event control node associated to the query id is retrieved
and executed. If the control node has outgoing data objects that de ne data
bindings, the event data is evaluated with the help of the JsonPath expressions,
and the attribute values are saved.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we presented our prototypical adaption of a case management
execution engine to handle real life events sent by a sensor. To this end, we adapted
the modeling component Gryphon to allow event modeling and integrated the
event processing platform Unicorn and a Sensor Gateway into the architecture.
The case engine itself had to be adapted to parse and register event types and
event queries, as well as to react to received event noti cations.</p>
      <p>This contribution is part of an ongoing project to develop a highly usable
environment for knowledge workers to model and enact fragment-based case
models. Source code, documentation, and screencast of the Chimera case engine
are available at https://bpt-lab.org/fcm.</p>
      <p>Beyer et al.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>O.</given-names>
            <surname>Etzion</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Niblett</surname>
          </string-name>
          .
          <source>Event Processing in Action. Manning Publications</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>S.</given-names>
            <surname>Haarmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Podlesny</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hewelt</surname>
          </string-name>
          , A. Meyer, and
          <string-name>
            <given-names>M.</given-names>
            <surname>Weske</surname>
          </string-name>
          .
          <article-title>Production case management: A prototypical process engine to execute exible business processes</article-title>
          .
          <source>In Proceedings of the BPM Demo Session</source>
          , pages
          <volume>110</volume>
          {
          <fpage>114</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Hewelt</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Weske</surname>
          </string-name>
          .
          <article-title>A Hybrid Approach for Flexible Case Modeling and Execution</article-title>
          .
          <source>In BPM Forum, LNBIP</source>
          . Springer,
          <year>2016</year>
          .
          <article-title>(accepted for publication)</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. A. Meyer,
          <string-name>
            <given-names>N.</given-names>
            <surname>Herzberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Puhlmann</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Weske</surname>
          </string-name>
          .
          <article-title>Implementation framework for production case management: Modeling and execution</article-title>
          .
          <source>In Enterprise Distributed Object Computing (EDOC)</source>
          . IEEE,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Object Management Group.
          <source>Business Process Model and Notation (BPMN), Version 2.0.2</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>