<!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>CPN Tools 4: A Process Modeling Tool Combining Declarative and Imperative Paradigms</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Michael Westergaard</string-name>
          <email>m.westergaard@tue.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tijs Slaats</string-name>
          <email>tslaats@itu.dk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Mathematics and Computer Science, Eindhoven University of Technology</institution>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Exformatics A/S</institution>
          ,
          <addr-line>Lautrupsgade 13, 2100 Copenhagen</addr-line>
          ,
          <country country="DK">Denmark</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>IT University of Copenhagen Rued Langgaardsvej 7</institution>
          ,
          <addr-line>2300 Copenhagen</addr-line>
          ,
          <country country="DK">Denmark</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>National Research University Higher School of Economics</institution>
          ,
          <addr-line>Moscow, 101000</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>CPN Tools is a tool for modeling, simulating, and analyzing colored Petri nets. The latest iteration of the tool, CPN Tools 4, extends this with constraints known from declarative languages such as Declare and DCR Graphs. Furthermore, this version introduces an explicit process perspective, powerful extensibility allowing third parties to extend the tools capabilities, and a visualization perspective making it possible to make high-level visualizations of executions directly in the tool. In our demonstration, we show how it is possible to create models incorporating declarative and imperative constructs and how to use these models to generate simulation logs that can be directly imported into ProM. We show off the new process perspective on top of colored Petri nets, exemplify the use of the perspective to generate readable Java code directly from models, and show how the visualization perspective makes it possible to show the formal underlying model alongside an easier-tograsp for non-experts high-level visualization. Our intended audience comprise current users of CPN Tools interested in recent developments and practitioners interested in colored Petri nets and hybrid models. We expect to tailor each demonstration to the wishes of the audience.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        and less matured approach which has so far not found widespread application
in industry yet, however the two declarative languages Declare [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and DCR
Graphs [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ] have been studied extensively in academia over the last decade.
Declarative languages do not explicitly specify flow of control, but instead
specifies constraints between actions; examples of such constraints are init(A),
meaning that any execution has to start by executing A, and response(A, B), meaning
that after executing A, B has to be executed at some point. Other constraints
deal with choices and variations of the response constraint.
      </p>
      <p>
        Hybrid modeling. Recently interest has emerged in hybrid approaches, where
some aspects of a process are specified directly using imperative constructs and
other aspects declaratively. This is useful if part of the process is well-structured
and part is more free, or for going from an abstract, little-understood process,
often modeled more naturally using declarative constraints, to a more concrete
implementation which by nature is often more imperative. One such hybrid
approach is implemented in CPN Tools 4 [
        <xref ref-type="bibr" rid="ref5 ref7">5, 7</xref>
        ]. This approach combines the
places and transitions of colored Petri nets with the constraints of the Declare
and DCR Graphs languages. Fig. 1 shows an example of a mixed declarative and
imperative model. In the upper half of the screen we describe the registration of a
patient using an electronic patient record, which is basically form-filling and
wellsuited for an imperative approach. In the bottom half we describe the treatment
of the patient which is strongly knowledge-based, therefore more flexible and
hence modeled using a Declarative approach. While these two aspects could have
been modelled as separate processes (one imperative and the other declarative),
using the hybrid approach allows us to join the two and show how they interact.
Initially, only Receive Patient is required due to the declarative constraint init.
After executing Disinfect Wound, Stitch Wound has to be executed because of a
response between them. Registration and treatment can happen in parallel, but
prescription of antibiotics is dependent on the patient data.
      </p>
      <p>
        The model can be extended with time information and exercises to obtain
simulation-based performance information. It is also possible to obtain a
simulation log from CPN Tools, which can be imported directly into ProM 6.3
for analysis using a known process. CPN Tools also offers state-space analysis
for ensuring the absence of errors such as dead-locks in the process. For more
information about hybrid modeling, we refer the interested reader to [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
Domain-specific visualization. While colored Petri net models are graphical,
they are also complex to understand for non-experts. Previously, CPN Tools
supported visualizations of such models by means of an external tool, but with
version 4 such visualizations are internalized, making it possible to show model
and visualization side-by-side without requiring external tools. In Fig. 2, we see
two simple visualizations of the model from Fig. 1. The sequence diagram (left)
shows a single patient interaction and is updated when simulation is conducted.
The visualization is driven purely by the model, and as CPN Tools allows users
full control over the simulation, can be used to demonstrate complex scenarios
in a simple way. The bar chart (Fig. 2 (right)) shows aggregated statistics over
multiple simulations.
Process-partitioned colored Petri nets. Colored Petri nets allow modelers
a lot of freedom. Most importantly, it is very hard to separate the flow of data
from the flow of control, which makes models hard to understand and analyze.
Workflow Nets solved this problem for standard Petri nets, but some of the
restrictions are too severe for efficient use of the higher-level formalism. Colored
Workflow Nets [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] generalize Workflow Nets to colored Petri nets, but impose
some restrictions that make models unnatural. Instead, CPN Tools implements
Process-partitioned colored Petri nets (PP-CPNs) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which allow more
flexibility and more natural models. PP-CPNs explicitly separate the flow of control and
data, separating places into process places, local and shared places (for data),
resource places, and communication (buffer) places.
      </p>
      <p>PP-CPNs allow multiple instances of multiple process types to
communicate, and hence supports an artifact-centric modeling style. Of course, classical
Workflow Nets are recognized as PP-CPNs as one would expect. An example
PP-CPN model of a simple producer/consumer system can be seen in Fig. 3
(top). Here, we have two kinds of processes communicating over a buffer place;
producers produce items (integers), store them locally, and transmit them. They
use a mutex (a single resource) to prevent race conditions. Initially there are two
producers. Consumers receive data from producers, store it locally and dispatch
depending on the data.</p>
      <p>
        An advantage of PP-CPNs is that it is possible to generate them
automatically from code and to generate running Java code from such models; an example
of code generated from the model in Fig. 3 (top) is shown in Fig. 3 (bottom).
Maturity, availability, screencast. CPN Tools is a very mature tool and
has been in active use for over 10 years. It enjoyed approximately 5500
downloads in the period May 1, 2012–May 1, 2013. It is used in teaching in
several universities, used by companies, and a large number of case studies in
several fields are available from http://cs.au.dk/cpnets/industrial-use/
and on our own homepage we showcase models from industrial case studies at
http://cpntools.org/documentation/examples/. We are currently
conducting case studies using the new declarative constraints, but these are on-going
and not yet ready for publication. The implementation of the Declare language
is an optimized version of the Declare tool [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>CPN Tools is open source and available for free for everybody at
http://cpntools.org/. On this page, we also have a comprehensive getting
started guide including screencasts for beginners. In the future, we plan to
extend CPN Tools with timed and process-aware versions of Declare.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jørgensen</surname>
            ,
            <given-names>J.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lassen</surname>
            ,
            <given-names>K.B.</given-names>
          </string-name>
          :
          <article-title>Let's Go All the Way: From Requirements Via Colored Workflow Nets to a BPEL Implementation of a New Bank System</article-title>
          .
          <source>In: Proc. of OTM Conferences (1)</source>
          . LNCS, vol.
          <volume>3760</volume>
          , pp.
          <fpage>22</fpage>
          -
          <lpage>39</lpage>
          . Springer (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Hildebrandt</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mukkamala</surname>
            ,
            <given-names>R.R.</given-names>
          </string-name>
          :
          <article-title>Declarative event-based workflow as distributed dynamic condition response graphs</article-title>
          .
          <source>In: Post-proc.of PLACES</source>
          <year>2010</year>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Hildebrandt</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mukkamala</surname>
            ,
            <given-names>R.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Slaats</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Nested dynamic condition response graphs</article-title>
          .
          <source>In: Proc. of Fundamentals of Software Engineering (FSEN) (April</source>
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Kristensen</surname>
            ,
            <given-names>L.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Westergaard</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Automatic Structure-Based Code Generation from Coloured Petri Nets: A Proof of Concept</article-title>
          .
          <source>In: Proc. of FMICS</source>
          . pp.
          <fpage>215</fpage>
          -
          <lpage>230</lpage>
          . LNCS, Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Westergaard</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>CPN Tools 4: Multi-formalism and Extensibility</article-title>
          .
          <source>In: Proc. of ATPN. LNCS</source>
          , vol.
          <volume>7927</volume>
          , pp.
          <fpage>400</fpage>
          -
          <lpage>409</lpage>
          . Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Westergaard</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maggi</surname>
            ,
            <given-names>F.M.:</given-names>
          </string-name>
          <article-title>Declare: A Tool Suite for Declarative Workflow Modeling and Enactment</article-title>
          .
          <source>In: Business Process Management Demonstration Track (BPMDemos</source>
          <year>2011</year>
          ).
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>820</volume>
          .
          <string-name>
            <surname>CEUR-WS.org</surname>
          </string-name>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Westergaard</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Slaats</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Mixing Paradigms for More Comprehensible Models</article-title>
          .
          <source>In: Proc. of BPM. LNCS</source>
          , vol.
          <volume>8094</volume>
          . Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>