<!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>Petriflow language and Netgrif Application Builder</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Gabriel Juhás</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>Tomáš Kováčik</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>Jakub Kovář</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>Martin Kranec</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>Ľuboš Petrovič</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Electrical Engineering and Information Technology, Slovak University of Technology in Bratislava</institution>
          ,
          <addr-line>Ilkovičova 3, 812 19 Bratislava</addr-line>
          ,
          <country country="SK">Slovakia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>NETGRIF</institution>
          ,
          <addr-line>s.r.o., Slávičie údolie 106, 811 02 Bratislava</addr-line>
          ,
          <country country="SK">Slovakia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper summarizes the capabilities of the Petriflow language - a Petri net based modeling language for the creation of executable process-driven applications. Furthermore, the Netgrif Application Builder a tool for creating Petriflow models is presented. The Netgrif Application Builder (NAB) is the tool for building process-driven applications using the Petriflow language. NAB is a public web application available at https://builder.netgrif.com, where users can quickly design their own application process models or import models from any BPMN model. Petriflow is a high-level programming language for process-driven application development based on Petri nets.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Bussiness Process Design</kwd>
        <kwd>Petri nets</kwd>
        <kwd>Petriflow</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Petriflow language</title>
      <p>
        To model a control flow of a workflow process, place/transition Petri nets have been chosen.
This choice was motivated by comparisons of Petri nets to other formalisms, such as BPMN,
that are beyond the scope of this paper. Such comparisons have been done in the past, by many
authors, such as [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] or [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        To make the reflection of reality more accurate, Petriflow combines place/transition Petri
Nets and some of their extensions:
• reset arcs [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], inhibitor arcs [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and read arcs [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] were used to increase the expressiveness
of place/transition Petri nets;
• roles were added to define who can assign an enabled transition and who can execute a
transition of the net;
• data variables were added to Petriflow to model attributes of the process instances, they
can be associated with any task;
• actions were introduces to specify reactions to various events on the process model and
data variables;
These extensions were introduced over time to enable the specification of executable enterprise
applications, starting from place/transition Petri nets [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        Importantly for transitions in Petri nets modelling a process, we use interval semantics, which
defines the start and finish of a transition [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In this way, transitions can in a natural way model
tasks. A state of a Petriflow process is given by the marking of places, a function indicating
for each transition whether it is being executed and by which actor, and the values of the data
variables.
      </p>
      <p>The complex behaviour of a task, including the locking of data variables and the efects of
the required property on the ability to finish a task, can be modelled by an underlying Petri net
as seen in figure 1. The required property is modelled by a variable arc weight determined by a
place reference - the weight is equal to the marking of the referenced place. The finish event
can therefore happen only if the referenced required data variable has some value set.</p>
      <p>
        While many of the aspects of the Petriflow language (such as data, or roles) could be formalised
in a rigorous way, we chose to forgo this purity in formalisation and chose instead to define the
language as an XML notation, similarly to BPMN. A Petriflow process can be understood as
a class (in the context of object-oriented programming) enriched by a workflow process that
defines a life cycle of the class instances - cases [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Netgrif Application Builder</title>
      <p>NAB is composed of several modules that help in diferent stages of application development:
• Process modeler - an editor for modeling processes based on Petri nets
• Role editor - an editor for creating and editing roles as well as specifying the permissions
associated with them for individual tasks or the entire process instance
• Data editor - an editor for creating and editing data variables
• Form builder - an editor for creating and editing forms of specific tasks
• Actions editor - an editor for creating and editing actions (pieces of code in the Groovy
scripting language)
• Simulation mode - simulation of the modeled Petri net either task by task or event by
event
• BPMN model import - a utility that transforms BPMN files into executable Petriflow
applications
• Petriflow model export - transforms the Petriflow model into its XML representation,
which can be deployed into the Application Engine</p>
      <sec id="sec-3-1">
        <title>3.1. Process Modeler</title>
        <p>
          In the Process Modeler you can model business processes by defining tasks and their routing
and simulate the modeled processes by executing sequences of tasks. As a modeling formalism
for processes, Petriflow language uses Petri nets that consist of state variables represented by
places, tasks represented by transitions and their interconnections, that define rules for the
executability of the various tasks based on the state variables [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Role Editor</title>
        <p>The role editor can be used to enrich the Petriflow processes with permission granting or
permission revoking roles. Roles can be understood as sets of application users, shared between
all instances of the same process model. The role can then be associated with any of the Petriflow
events with a positive or a negative relation. When a role is associated with an event, such as
the assign event of some task, in a positive way, then only members of the role are allowed to
perform this event, in our example, this means that only these users would be able to assign the
specific task. If the roles are associated in a negative way, only the users that are not members
of the specified role will be able to trigger the associated event.</p>
        <p>An instance scoped variant of roles exists - the users list data variable. This data variable also
contains a set of users but its value can difer for each process instance. The role editor can be
used to assign permissions to roles, as well as users list data variables.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Data Editor</title>
        <p>The data editor manages data variables used in the processes. The Petriflow language supports
all the basic types of data variables, including text, numbers, date, date-time, enumerations and
choices, files, images and many others. The data variables are an important part of the Petriflow
language as they hold valuable business-specific data, or are used to control the direction of the
workflow with features such as variable arc weights or inter-process communication.</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Form Builder</title>
        <p>The Form Builder is used to associate existing or new data variables with the individual tasks of
the model. The association creates a form that the user then interacts with when they execute the
appropriate task. Associating the data variables with the task is done by drag-and-dropping the
variables into a grid to specify their layout and it can then be further customized by specifying
diferent attributes, such as placement in the form grid layout, choosing the appropriate view,
such as diferent types of check-boxes, and determining, whether the data fields are editable,
visible, required or hidden.</p>
        <p>A special type of data variable - the task reference, can be used to transparently embed forms
of one transition into another, allowing us to create highly structured, nested and reusable
forms which enhance the functionality of the application.</p>
      </sec>
      <sec id="sec-3-5">
        <title>3.5. Actions Editor</title>
        <p>
          In the Action Editor we can define reactions to events of the process instances, their tasks, and
data variables. Actions are based on the Groovy programming language extended with various
methods that grant the programmers access to the Petriflow actions API. [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]
        </p>
        <p>
          The various types of events that we can react to include creation of the process instance,
assignment of a task to a user, cancellation of a task, completion (finish) of a task, and the
change of a data field value. Actions can be used to create new process instances, assign tasks
to users, recalculate data variable values, or to hide/show data fields in task forms. These efects
are themselves events and can therefore trigger other actions in turn. [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]
        </p>
        <p>Furthermore, actions have access to the entire Application Engine, so they can also use
integrations to third-party web services, send emails or dynamically create files for the users of
the application to download.</p>
      </sec>
      <sec id="sec-3-6">
        <title>3.6. Simulation Mode</title>
        <p>In order to test the model and to visualize the workflow, the Netgrif Application Builder contains
a simulation mode. It allows us to see the Petri net model, to step through it, by executing the
individual transitions or the their events and to see the changes this causes to the marking of
the net.</p>
        <p>The simulation does not encompass all the aspects of the Petriflow language and is limited
only to simulating the Petri net model. A complete simulation including roles, actions and data
variables can be performed on a deployed model in a test environment of an Application Engine.</p>
      </sec>
      <sec id="sec-3-7">
        <title>3.7. BPMN Model Import</title>
        <p>The Netgrif Application Builder includes the functionality of importing BPMN models using a
modification of an existing algorithm, taking into consideration the interval semantics of tasks,
to convert the BPMN language to the formalism of Petri nets.</p>
      </sec>
      <sec id="sec-3-8">
        <title>3.8. Petriflow Model Export</title>
        <p>The Petriflow language has an XML based syntax and the Application Builder aims to be
fully functional visual based IDE for the Petriflow language. Our goal is to achieve tool
crosscompatibility where any builder can open any Petriflow model, that can be interpreted and
executed by any engine, regardless of the models origin.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Materials</title>
      <p>This video demonstration of all the core aspects of the Petriflow platform can be used as a
good starting point for designing and deploying your first process-driven application https:
//www.youtube.com/watch?v=iU1QGPUnXUs.</p>
      <p>Alternatively we have a website dedicated to on-boarding materials and examples, that you
can find inspiration and guidance on https://netgrif.com/started/.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>W. van der Aalst</surname>
          </string-name>
          ,
          <article-title>On the representational bias in process mining, in: 2011 IEEE 20th International Workshops on Enabling Technologies: Infrastructure for Collaborative Enterprises</article-title>
          , IEEE,
          <year>2011</year>
          . URL: https://doi.org/10.1109/wetice.
          <year>2011</year>
          .
          <volume>64</volume>
          . doi:
          <volume>10</volume>
          .1109/wetice.
          <year>2011</year>
          .
          <volume>64</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Koschmider</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Oberweis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Stucky</surname>
          </string-name>
          ,
          <article-title>A petri net-based view on the business process life-cycle, Enterprise Modelling and Information Systems Architectures (</article-title>
          <year>2018</year>
          ) Vol
          <volume>13</volume>
          (
          <year>2018</year>
          ). URL: https://www.emisa-journal.org/emisa/article/view/192. doi:
          <volume>10</volume>
          .18417/EMISA.SI.
          <source>HCM.4.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Business process management as the “killer app” for petri nets</article-title>
          ,
          <source>Software &amp; Systems Modeling</source>
          <volume>14</volume>
          (
          <year>2014</year>
          )
          <fpage>685</fpage>
          -
          <lpage>691</lpage>
          . URL: https://doi.org/10.1007/ s10270-014-0424-2. doi:
          <volume>10</volume>
          .1007/s10270-014-0424-2.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Desel</surname>
          </string-name>
          , G. Juhás, “
          <article-title>what is a petri net?” informal answers for the informed reader</article-title>
          ,
          <source>in: Unifying Petri Nets</source>
          , Springer Berlin Heidelberg,
          <year>2001</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>25</lpage>
          . URL: https://doi.org/10. 1007/3-540-45541-
          <issue>8</issue>
          _1. doi:
          <volume>10</volume>
          .1007/3-540-45541-
          <issue>8</issue>
          _
          <fpage>1</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Lorenz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Desel</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Juhás, Models from scenarios</article-title>
          ,
          <source>in: Transactions on Petri Nets and Other Models of Concurrency VII</source>
          , Springer Berlin Heidelberg,
          <year>2013</year>
          , pp.
          <fpage>314</fpage>
          -
          <lpage>371</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -38143-
          <issue>0</issue>
          _9. doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>642</fpage>
          -38143-
          <issue>0</issue>
          _
          <fpage>9</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>G.</given-names>
            <surname>Juhás</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Lorenz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mauser</surname>
          </string-name>
          ,
          <article-title>Complete process semantics for inhibitor nets</article-title>
          ,
          <source>in: Petri Nets and Other Models of Concurrency - ICATPN 2007</source>
          , Springer Berlin Heidelberg,
          <year>2007</year>
          , pp.
          <fpage>184</fpage>
          -
          <lpage>203</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>540</fpage>
          -73094-1_
          <fpage>13</fpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>540</fpage>
          -73094-1_
          <fpage>13</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Mladoniczky</surname>
          </string-name>
          , G. Juhás,
          <string-name>
            <given-names>J.</given-names>
            <surname>Mazári</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Gazo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Makán</surname>
          </string-name>
          , Petriflow:
          <article-title>Rapid language for modelling petri nets with roles and data fields</article-title>
          ,
          <source>Algorithms and Tools for Petri Nets</source>
          <volume>45</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Alqarni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Janicki</surname>
          </string-name>
          ,
          <article-title>On interval process semantics of petri nets with inhibitor arcs</article-title>
          ,
          <source>in: Application and Theory of Petri Nets and Concurrency</source>
          , Springer International Publishing,
          <year>2015</year>
          , pp.
          <fpage>77</fpage>
          -
          <lpage>97</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -19488-
          <issue>2</issue>
          _4. doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>319</fpage>
          -19488-
          <issue>2</issue>
          _
          <fpage>4</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>G.</given-names>
            <surname>Juhás</surname>
          </string-name>
          , Process-driven programming,
          <year>2021</year>
          . URL: https://netgrif.com/ process-driven-programming/.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>J.</given-names>
            <surname>Mazári</surname>
          </string-name>
          , G. Juhás,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mladoniczky</surname>
          </string-name>
          ,
          <article-title>Petriflow in actions: Events call actions call events, Algorithms and Tools for Petri Nets (</article-title>
          <year>2018</year>
          )
          <fpage>21</fpage>
          -
          <lpage>26</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>