<!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>A Process Scripting and Execution Environment</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Maxim Vidgof</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Philipp Waibel</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jan Mendling</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Schimak</string-name>
          <email>martin.schimak@plexiti.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexander Seik</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peter Queteschiner</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute for Information Business</institution>
          ,
          <addr-line>WU Wien</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Phactum</institution>
          ,
          <addr-line>Vienna</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Plexiti</institution>
          ,
          <addr-line>Vienna</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <fpage>173</fpage>
      <lpage>177</lpage>
      <abstract>
        <p>Many companies rely on business process management systems for their digital transformation initiatives. Beyond visual modeling languages, there is a need for an executable modeling language with data processing support and powerful abstractions for development. To overcome this gap, we developed a process scripting language called Factscript. In this paper, we present the Factscript language environment and showcase its application.</p>
      </abstract>
      <kwd-group>
        <kwd>Process Modelling</kwd>
        <kwd>DSL</kwd>
        <kwd>Kotlin</kwd>
        <kwd>Factscript</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Business Process Management Systems (BPMS) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] support the implementation
of speci c processes. Several BPMS solutions and languages have been proposed
in the past, e.g., BPMN [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], BPEL [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], Net ix Conductor or Uber Cadence,
each with strengths and weaknesses. While BPMN supports important control
ow patterns, it does not support proper data processing on the visual level.
On the other hand, languages like Net ix Conductor are process programming
languages with data processing support but are missing important abstractions.
      </p>
      <p>
        In order to overcome the mutual weaknesses of the di erent languages, we
developed a process scripting language, called Factscript [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and supportive tools.
Factscript is an executable, code-e cient, domain-speci c language (DSL) that
builds on the strengths of di erent process languages.
      </p>
      <p>In this paper, we present the language environment of Factscript. The
language environment supports the user during the design of the processes in
Factscript, deploys the processes to an external execution engine, and executes
the processes. Furthermore, we present a real-world application scenario,
composed of two interconnected processes, for Factscript and the language
environment.
In the following, we discuss the features of our scripting language and introduce
the language environment.</p>
      <p>IntelliJ
Editor Factscript Modeler</p>
      <p>Factscript Process Model</p>
      <p>Get Constructs
Factscript
Construct
Definitions</p>
      <sec id="sec-1-1">
        <title>SeleOctn</title>
        <p>Execution
R Translate Process
Translator</p>
        <p>Event</p>
      </sec>
      <sec id="sec-1-2">
        <title>GateTwaasyk</title>
        <p>Execution Helper
Listeners Transition Listener Activity Start Listener</p>
        <p>External Task</p>
        <p>Deploy Model
Register Listener
R</p>
        <p>R
Execute</p>
        <p>Listener
Get Task</p>
        <p>Execution Engine</p>
        <p>Process Repository</p>
        <p>BPMN Process Model</p>
        <p>Read Model
Execution Engine</p>
        <p>Request Task</p>
        <p>Execution</p>
        <p>External Task Queue</p>
        <p>
          For the development of the Factscript, we identi ed four requirements [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]:
(R1) e cient syntax, (R2) extensive control ow support, (R3) support of data
processing, and (R4) support of event processing. We followed the seven phases
of DSL development [
          <xref ref-type="bibr" rid="ref2 ref5">2,5</xref>
          ], which helped us to generate an e cient syntax (R1).
For (R2) we analyzed process modeling languages and their control ow support.
For extensive control ow support [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], we refer to BPMN. For data processing
(R3), we identify type safe variables and their manipulation directly in the
process de nition as important. For (R4) we opted for BPEL as a basis with its
di erent message interaction possibilities [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Factscript, therefore, provides
different constructs that permit a similar message interactions as BPEL does.
        </p>
        <p>The language environment is composed of four top-level entities: editor,
translator, execution engine, and execution helper. The editor entity is used for
scripting a process in Factscript by using the Factscript constructs and syntax.
Depending on the editor, the scripting is supported by auto-completion and syntax
checking. After the process is de ned, the translator entity is used to transform
the Factscript process into a format that can be interpreted by the execution
engine. Eventually, the execution engine executes the process. Dependent on the
functionalities of the used execution engine, di erent execution helper functions
are required. The particular implementation of these entities is independent of
each other and can be based on di erent tools.</p>
        <p>
          At the current development state, the implemented language environment
for Factscript uses IntelliJ IDEA for the editor, translator, and execution helper
entities. These entities are implemented using Kotlin. Camunda BPM is used as
execution engine . Figure 1 depicts the architecture of the current
implementation. The language environment, as well as the Factscript construct de nitions
and example processes, can be accessed online4 and in [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>4https://github.com/factdriven (commit tag ER-2020-Demo).</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Application Scenario</title>
      <p>In the following, we present a real-world application scenario, supplementary to
the one presented in the screencast of the Factscript environment. The screencast
can be accessed at https://youtu.be/WBs-nC1S8OI.</p>
      <p>
        The application scenario is composed of two processes: The rst one is an
order process, and the second one a payment process that is used by the order
process. Listing 1.1 shows the order process and Listing 1.2 the payment process
de ned in Factscript. A description of the semantic and syntax of Factscript can
be found in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Figures 2a and 2b present the processes in BPMN 2.0.
      </p>
      <p>Listing 1.1: Order Process in Factscript
24 emit failure event { PaymentFailed ( orderId ) }
25 }
26 }
27 until (" Payment fully covered ?") condition { covered == total }
28 }
29 } or {
30 otherwise (" Yes ")
31 emit success event { PaymentRetrieved ( orderId ) }
32 }</p>
      <p>(a) Order Process in BPMN 2.0
(b) Payment Process in BPMN 2.0
The order process (Listing 1.1) performs the following steps: (1) The execution
is triggered by a ful ll order event (lines 1-4). (2) At the beginning of the process
execution, an order ful llment started event is emitted (line 5). (3) Subsequently,
the ordered goods are fetched from the inventory, and, in parallel, the payment
is retrieved via the separate payment process (lines 6-20). If the payment fails, a
compensation is triggered that returns the goods to the inventory (lines 16-19).
(4) After the goods are available and the payment is fully covered, an order
ready to ship event is triggered, and the goods are shipped (lines 21-22). (5) The
process ends with a Order ful lled event (line 23).</p>
      <p>The payment process (Listing 1.2) performs the following steps: (1) The
execution is triggered by a retrieve payment event, which is emitted by the
Retrieve payment activity of the order process (lines 1-4). (2) After the execution
is triggered, the money is withdrawn from the customer's account (lines 5-12).
(3) If not all of the money can be withdrawn (line 13), the customer's credit
card is charged (lines 14-29). (4) If the credit card of the customer is expired
(line 19), the customer has two weeks to update the credit card details. After
the two weeks, the payment process fails, and the already withdrawn money is
credited to the customer's account (lines 18-26). (5) After charging the credit
card, it is checked if the payment is fully covered (lines 13). If not, the credit card
is charged again. (6) If the payment is fully covered (lines 29-32), the process
signalizes its end with a payment retrieved event.</p>
      <p>This application scenario shows a part of the rich spectrum of constructs
that the Factscript language provides and the possibility to create real-world
scenarios with them.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>In this paper, we presented the language environment for Factscript. The
language environment provides the means to script processes by using the Factscript
constructs, then deploys the processes to an external execution engine that is
then used to execute the process. At the current level of maturity, the Factscript
already ful lls all four requirements discussed in Section 2. Furthermore, the
language environment, with Camunda BPM as an execution engine, fully supports
all Factscript constructs. Since the Factscript and execution engine are
independent of each other, the execution engine can easily be exchanged. As future
work, we integrate Factscript with Amazon AWS Step Functions as a process
execution engine.</p>
      <p>Acknowledgement The concept and design of the Factscript as well as its
implementation in Kotlin was done by Martin Schimak, plexiti GmbH.</p>
      <p>This research is partially funded by FFG (ref. no. 876062).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <article-title>Business process model and notation (bpmn) version 2.0</article-title>
          . Tech. rep. (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Ceh</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crepinsek</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kosar</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mernik</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Ontology driven development of domain-speci c languages</article-title>
          .
          <source>Comp. Sci. Inf</source>
          . Syst.
          <volume>8</volume>
          (
          <issue>2</issue>
          ),
          <volume>317</volume>
          {
          <fpage>342</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Mendling</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Reijers</surname>
          </string-name>
          ,
          <string-name>
            <surname>H.A.</surname>
          </string-name>
          :
          <article-title>Fundamentals of Business Process Management</article-title>
          ,
          <source>Second Edition</source>
          . Springer (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Jordan</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Evdemon</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alves</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arkin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Askary</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barreto</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bloch</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Curbera</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ford</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goland</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          , et al.:
          <article-title>Web services business process execution language version 2.0</article-title>
          . Tech. rep. (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Mernik</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hrncic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bryant</surname>
            ,
            <given-names>B.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Javed</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Applications of Grammatical Inference in Software Engineering: Domain Speci c Language Development</article-title>
          .
          <source>In: Scienti c Applications of Language Methods</source>
          , vol.
          <volume>2</volume>
          , pp.
          <volume>421</volume>
          {
          <issue>457</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Vidgof</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Waibel</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schimak</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seik</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Queteschiner</surname>
            ,
            <given-names>P.:</given-names>
          </string-name>
          <article-title>A Code-e cient Process Scripting Language</article-title>
          .
          <source>In: ER Conference Proceedings)</source>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Weidlich</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Decker</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <article-title>Gro kopf, A</article-title>
          .,
          <string-name>
            <surname>Weske</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>BPEL to BPMN: the myth of a straight-forward mapping</article-title>
          .
          <source>In: On the Move to Meaningful Internet Systems: OTM. Lecture Notes in Comp. Sci.</source>
          , vol.
          <volume>5331</volume>
          , pp.
          <volume>265</volume>
          {
          <fpage>282</fpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Wohed</surname>
            , P., van der Aalst,
            <given-names>W.M.P.</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.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Russell</surname>
          </string-name>
          , N.:
          <article-title>On the suitability of bpmn for business process modelling</article-title>
          .
          <source>In: Int. Conf. on business process management</source>
          . pp.
          <volume>161</volume>
          {
          <fpage>176</fpage>
          . Springer (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>