<!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>BPMN2Constraints: Breaking Down BPMN Diagrams into Declarative Process Query Constraints</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Arvid Bergman</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Adrian Rebmann</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Timotheus Kampik</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>SAP Signavio</institution>
          ,
          <addr-line>Berlin</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Umeå University</institution>
          ,
          <addr-line>Umeå</addr-line>
          ,
          <country country="SE">Sweden</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Mannheim</institution>
          ,
          <addr-line>Mannheim</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents BPMN2Constraints, a tool that compiles BPMN diagrams into sets of declarative constraints that can then, for example, be used for conformance checking. Notably, BPMN2Constraints does not rely on Petri net replay for generating the constraints; by generating constraints directly from a control flow graph extracted from the BPMN model, the tool avoids indirection. BPMN2Constraints can generate constraints in several languages: DECLARE, finite-trace linear temporal logic, and SIGNAL, a proprietary process querying language.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Business process management</kwd>
        <kwd>Declarative constraints</kwd>
        <kwd>Conformance checking</kwd>
        <kwd>Process querying</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Instead, it is preferable to extract declarative constraints from the models. These constraints
can then be filtered to exclude the ones that do not carry any relevant business meaning. Also,
constraints of several models can be aggregated, e.g., to identify the most prevalent constraints
across several business process landscapes or collections of best practice models. An additional
advantage of compiling declarative constraint sets without an additional Petri net replay step,
but directly from imperative process models, is that at least some industry-scale process querying
languages use regular expression-based matching as the central abstraction for reasoning about
control flow, which is closer to declarative temporal reasoning. Considering the prevalence
of declarative approaches in large-scale industry applications outside of the process domain,
e.g., in distributed systems [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], this allows for the application of well-established reasoning
approaches that engineers are familiar with.
      </p>
      <p>
        To achieve our goal of moving from business-level imperative process models directly to
declarative conformance checking constraints, this demonstration paper presents BPMN2Constraints,
a software library that compiles the control flow of BPMN models to constraints in several
declarative languages: finite-trace linear temporal logic (   ), DECLARE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] (which
provides somewhat user-friendly abstractions on top of   ), and SIGNAL [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which is a
proprietary process querying language used in industry. The tool is available as a Python
module. The source code alongside usage instructions and a (video) tutorial are available at
https://github.com/signavio/bpmn2constraints. To highlight BPMN2Constraints’s robustness
(as well as robustness limitations), the tool is applied to thousands of openly available process
models, as well as to a collection of thousands of proprietary best practice process models.
2. Mapping BPMN to Declarative Process Query Constraints
In order to illustrate how BPMN2Constraints compiles BPMN-like process models to declarative
constraints, let us introduce a simple (happy path) example BPMN model (Figure 1). The process
starts when a credit is requested (). Subsequently, the request is reviewed (). If standard
terms are applicable to the request, the terms are calculated (); else, special terms are prepared
() and then, the contract is prepared (). In parallel to either  or  and , the risk of
fulfilling the request is assessed ( ). Finally the quote is sent (), triggering the end event .
      </p>
      <p>Given the BPMN model, we can observe the following constraints, for example: i) 
precedes  (DECLARE: (, )); ii) Assuming transitivity,  precedes  as well
((, )); iii) Either  and  occur, but not both (ℎ(, ));</p>
      <sec id="sec-1-1">
        <title>BPMN</title>
      </sec>
      <sec id="sec-1-2">
        <title>Description</title>
        <p>Starts with 
Ends with</p>
        <p>DECLARE
()
()
 leads to</p>
        <p>(, )
 OR 
ℎ(, )</p>
        <p>(b | c )
 AND</p>
        <p>(, )
 XOR</p>
        <p>ℎ(, )
Loop
(, )</p>
        <p>SIGNAL
^a
a$
(^NOT(a|b)*(a~&gt;b)
*NOT(a|b)*$)
(^NOT('b'|'c')
(('b'ANY'c'ANY*)|
('c'ANY*'b'ANY*))
NOT('b'|'c')$)
(^(((NOT('c')*)
('b'NOT('c')*)*) |
((NOT('b')*)
('c'NOT('b')*)*))$)
(^NOT('b'|'c')*
('b'NOT('b'|'c')*
'c'NOT('b'|'c')*)*
NOT('b'|'c')* $)
iv)  and  occur together, but are not constrained regarding their temporal order
((, )).</p>
        <p>To generate the constraints, we parse the BPMN diagram, extract activity relations based
on the control flow and instantiate the constraints based on templates that follow DECLARE
semantics. Note that we exclude negative constraint templates as well as existence templates
to improve readability of the output. Implicitly, there is an (, 1)) constraint for each
 ∈/ , where  is the set of the task labels that occur in the model at hand, which means
that we exclude any tasks that are not part of the model1. We treat events and tasks/collapsed
sub-processes equally as propositional variables and handle sequence flows, OR, XOR, AND,
and event-based gateways for operator generation (interpreting event-based gateways as XORs).
All other element types are ignored.
1The full list of DECLARE templates we use as a basis can be found in our repository.
3. Evaluation on Large Process Model Collections
In order to assess the robustness of BPMN2Constraints and demonstrate its maturity, we
compiled thousands of BPMN models from two large process model collections into DECLARE
and SIGNAL constraints and analyzed the results with respect to the following properties.
Ability to parse and compile. We check whether the parsing/compilation procedure fails and
whether all control flow-relevant elements (events, activities, sequence flows) can be parsed
and appear in the output.</p>
        <p>Output similarity relative to a Petri net replay-based approach. We compare the
DECLARE constraints BPMN2Constraints generates with the output of a Petri net
replaybased constraints, measuring: i) precision: how many of the constraints generated by
BPMN2Constraints are also generated by the Petri net replay-based tool? ii) recall: how
many of the constraints generated by a Petri net replay-based tool are also generated by
BPMN2Constraints? Here, it is crucial to note that the constraints generated by the Petri net
replay-based tool are not a proper ground truth. In particular, the imperfect definition of BPMN
execution semantics does not allow for an unambiguous transformation into Petri nets; the
complexity of the standard causes challenges even for mundane tasks such as model
interoperability, which is continuously improved by a dedicated working group2. Still, the results can
shed light on the extent to which the two approaches are aligned, thus indicating potential
directions for future work.</p>
        <p>For our evaluation, we used the following two process model collections.</p>
        <p>
          A collection of research and educational BPMN models (SAP-SAM). The SAP Signavio
Academic Models (SAP-SAM) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] contains around 550,0003 models that have been created by
researchers, students, and teachers for research and educational purposes. The dataset is very
large and diverse; however, most of the models it contains have not been created for real-world
process management purposes, i.e. it cannot be considered as representative of practice-oriented
process model collections. From the dataset we sampled 10,000 BPMN models.
A vendor-provided proprietary collection of reference BPMN models (VBPMN). To
mitigate the limitations of SAP-SAM, we extended the evaluation of BPMN2Constraints to the
SAP Signavio Process Explorer reference BPMN models4, a collection of around 7,000 BPMN
models that provide vendor-specific best practices.
        </p>
        <p>From both collections, we excluded models with any of the following properties (heuristics to
select diagrams that are either of too low quality or out-of-scope for BPMN2Constraints): i) the
model contains five elements or less; ii) the model does not have any task, any start event, or
2See: https://www.omgwiki.org/bpmn-miwg/doku.php, accessed at 10-06-2023.
3This number excludes vendor-provided example processes, duplications of which we excluded.
4See: https://www.signavio.com/products/process-explorer/, accessed at 02-05-2023.
any end event; iii) the model fails a syntax check (executed by a commercial process modeling
tool); iv) the model has more than one BPMN pool, i.e. it models a cross-organizational process.
After filtering, 3,960 SAP-SAM models and 2,196 VBPMN models remained.</p>
        <p>Our constraint generator managed to parse and compile 94.13% of the SAP-SAM models
and 99.9% of the VBPMN models. The total amount of constraints generated by the SAP-SAM
models where 149, 098 for the Petri net replay-based approach, and 142, 982 constraints were
generated by BPMN2Constraints. The VBPMN models generated 81, 043 constraints from
the Petri net replay-based approach and 81, 956 by our tool. The compiler achieves 64.46%
precision and 66.7% recall for the SAP-SAM models and 93.32% precision and 93.57% recall
for the VBPMN models. While the results indicate that there is still room for improvement and
deeper evaluation, let us highlight that this preliminary study is, to our knowledge unique in its
large scope. Also, we expect that many issues can be traced back to the ambiguity of the BPMN
standard and the quality of the models in the SAP-SAM dataset, which presumably contains –
despite the filtering – a substantial amount of incomplete or intuitively “wrong” models.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>4. Conclusion</title>
      <p>
        We have presented BPMN2Constraints, a tool for extracting control flow from BPMN-based
process models as declarative constraints. We hope that the work can make the relation between
imperative and declarative constraints more tangible. In the future, the tool can be extended,
e.g., to consider constraints beyond process control flow such as roles and responsibilities or to
support the output of additional process query languages such as the Process Query Language
(PQL) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Also, a future extension of the tool could support the translation of declarative
constraints from one language to another (e.g., from SIGNAL to DECLARE and back). Beyond
tool functionality, future work could study formal aspects and limitations of breaking down
“imperative” process models into declarative constraints.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Adriansyah</surname>
            ,
            <given-names>B. F. van Dongen</given-names>
          </string-name>
          ,
          <article-title>Replaying history on process models for conformance checking and performance analysis</article-title>
          ,
          <source>WIREs Data Mining Knowl. Discov</source>
          .
          <volume>2</volume>
          (
          <year>2012</year>
          )
          <fpage>182</fpage>
          -
          <lpage>192</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Lamport</surname>
          </string-name>
          ,
          <article-title>The temporal logic of actions</article-title>
          ,
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <volume>16</volume>
          (
          <year>1994</year>
          )
          <fpage>872</fpage>
          -
          <lpage>923</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>C.</given-names>
            <surname>Di Ciccio</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Montali</surname>
          </string-name>
          ,
          <source>Declarative Process Specifications: Reasoning</source>
          , Discovery, Monitoring, Springer International Publishing, Cham,
          <year>2022</year>
          , pp.
          <fpage>108</fpage>
          -
          <lpage>152</lpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>031</fpage>
          -08848-
          <issue>3</issue>
          _
          <fpage>4</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Kampik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Lücke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Horstmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wheeler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Eickhof</surname>
          </string-name>
          , Signal - the
          <source>sap signavio analytics query language</source>
          ,
          <year>2023</year>
          . arXiv:
          <volume>2304</volume>
          .
          <fpage>06811</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>T.</given-names>
            <surname>Kampik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Warmuth</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sola</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Schäfer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Axworthy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Ivarsson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Ouda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Eickhof</surname>
          </string-name>
          , Sap signavio academic models,
          <year>2022</year>
          . doi:
          <volume>10</volume>
          .5281/zenodo.6964944.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Polyvyanyy</surname>
          </string-name>
          ,
          <article-title>Process query language</article-title>
          , in: A.
          <string-name>
            <surname>Polyvyanyy</surname>
          </string-name>
          (Ed.),
          <source>Process Querying Methods</source>
          , Springer,
          <year>2022</year>
          , pp.
          <fpage>313</fpage>
          -
          <lpage>341</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>