<!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>Intelligent Robotic Process Automation: Generating Executable RPA Scripts from Unsegmented UI Logs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Simone Agostinelli</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Marrella</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>Robotic Process Automation (RPA) is an automation technology that sits between the fields of Business Process Management (BPM) and Artificial Intelligence (AI) that creates software (SW) robots to partially or fully automate rule-based and repetitive tasks (or simply routines) performed by human users in their applications' user interfaces (UIs). RPA tools are able to capture in dedicated UI logs the execution of many routines of interest. A UI log consists of user actions that are mixed in some order that reflects the particular order of their execution by the user, thus potentially belonging to diferent routines. When considering state-of-the-art RPA technology in the BPM domain, it becomes apparent that the current generation of RPA tools is driven by predefined rules and manual configurations made by expert users rather than intelligent techniques. In this paper, we discuss our research targeted at injecting intelligence into RPA practices. Specifically, we present an approach to: (i) automatically understand which user actions contribute to which routines inside a UI log (this issue is known as segmentation) and (ii) automatically generate executable RPA scripts directly from the UI logs that record the user interactions with the SW applications involved in a routine execution, thus skipping completely the (manual) modeling activity of the flowchart diagrams.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Robotic Process Automation (RPA) is an emerging automation technology in the Business
Process Management (BPM) domain [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] that creates software (SW) robots to partially or fully
automate rule-based and repetitive tasks (or simply routines) performed by human users in
their applications’ user interfaces (UIs) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. While conducting a BPM project is often considered
too expensive because its “top-down” approach, RPA relies on an approach where, rather than
redesigning existing information systems (that remain unchanged), humans are replaced by SW
robots in the execution of those business processes (BPs) involving routine work.
      </p>
      <p>
        In the research literature, many case studies have shown that RPA technology can concretely
lead to improvements in eficiency for BPs involving routine work in large companies (e.g.,
Vodafone) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Moreover, the market of RPA solutions has developed rapidly. Today includes
more than 50 vendors developing tools that provide SW robots with advanced functionalities
for automating ofice tasks of diferent complexity [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        However, despite the growing attention around RPA, to achieve a widespread adoption in
the BPM domain, RPA needs to become “smarter” [
        <xref ref-type="bibr" rid="ref5 ref6 ref7">5, 6, 7</xref>
        ], i.e., RPA tools should employ AI
solutions to adapt and learn how to handle non-standard cases by observing human resolving
unexpected system behaviour (e.g., in case of system errors, etc.). In this direction, we discuss
in this paper three relevant research challenges in the RPA field and we present an approach to
increase their automated features making them less dependent by direct human involvement.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Background</title>
      <p>
        The traditional workflow to conduct an RPA project can be summarized as follows [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]: (1)
determine which process steps are good candidates to be automated; (2) model the selected
routines in the form of flowchart diagrams , which involve the specification of the actions, routing
constructs, data flow, etc. that define the behaviour of a SW robot; (3) record the mouse/key
events that happen on the UI of the user’s computer system; (4) develop each modeled routine
by generating the SW code required to concretely enact the associated SW robot on a target
computer system; (5) deploy the SW robots in their environment to perform their actions; and
(6) monitor the performance of SW robots to detect bottlenecks and exceptions.
      </p>
      <p>The majority of the previous steps, particularly the ones involved in the early stages of the
RPA life-cycle, require the support of skilled human experts, which need to: (i) understand the
anatomy of the candidate routines to automate through interviews, walk-troughs, and detailed
observation of workers conducting their daily work (cf. step 1); and (ii) define manually the
lfowchart diagrams representing the structure of such routines (cf. step 2), which will drive the
development of the SW code, often in the form of executable scripts (also called RPA scripts),
allowing the concrete enactment of SW robots at run-time (cf. steps 3 and 4).</p>
      <p>While this approach is efective to execute simple rules-based logic in situations where there is
no room for interpretation, it becomes time-consuming and error-prone in presence of routines
that are less predictable or require some level of human judgment. The issue is that in case
where the flowchart diagram does not contain a suitable response for a specific situation, e.g.,
because of an inaccurate modeling activity, then the associated RPA scripts would not properly
reflect the behaviour of the potential routine variant, forcing SW robots to escalate to a human
supervisor at run-time, in contrast with the RPA philosophy.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Approach</title>
      <p>
        Three major challenges arise from the above discussion [
        <xref ref-type="bibr" rid="ref5 ref9">5, 9</xref>
        ]: (C1) the automated identification
of the routine steps to robotize from a UI log (cf., the segmentation issue [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]), (C2) the automated
detection of all the routine variants that require some user input to proceed with their execution,
and (C3) the automated synthesis of executable RPA scripts for enacting SW robots at run-time.
To address these challenges, we have developed an approach and an implemented tool, called
SmartRPA [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ], which is able to: (i) interpret the UI logs recording the mouse/key events that
happen on the UI of the SW applications involved in many routine executions, (ii) automatically
identify and understand which user actions contribute to a particular routine inside a UI log
and cluster them into well-bounded routine traces, (iii) discover all the variants of the routine
under observation, and (iv) automatically combine them into an executable RPA script, which
can be reactively synthesized into a single SW robot.
User
      </p>
      <p>UI log</p>
      <p>UI log with delimiters
Action Logger
RPA Tool
filtering</p>
      <p>Generating
Segments
routine
traces
routine-based
log</p>
      <p>RPA
script
human-in-the-loop</p>
      <p>Segmentation of UI Logs</p>
      <p>
        To achieve these goals, as shown in Figure 1, starting from an unsegmented UI log previously
recorded with an RPA tool, the first stage of this research is to inject into the UI log the
enddelimiters of the routines under examination. An end-delimiter is a dummy action added to the
UI log immediately after the user action that is known to complete a routine execution. The
knowledge of such end-delimiters is crucial to make the approach works, as discussed in [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>
        For tackling C1, we rely on three main steps: (i) a frequent-pattern identification technique
[
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] (customized on a ad-hoc basis) to automatically derive the routine segments from a UI log
(i.e., routine segments describe the diferent behaviours of the routine(s) under analysis, in terms
of repeated patterns of performed user actions), (ii) a human-in-the-loop interaction to filter
out those segments not allowed (i.e., wrongly discovered from the UI log) by any real-world
routine execution by means of declarative constraints [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], and (iii) a routine traces detection
component that leverages trace alignment in Process Mining [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] to cluster all user actions
belonging to a specific routine segment into well-bounded routine traces (i.e., a routine trace
represents an execution instance of a routine within a UI log). Such traces are finally stored in a
routine-based log, which captures all the user actions happened during many routine executions.
      </p>
      <p>Commercial RPA tools can employ routine-based logs to synthesize executable scripts in
the form of SW robots without the manual modeling of the routines (cf. steps 3 and 4). To
this end, the SmartRPA approach1 is able to automatically synthesize executable scripts for
enacting SW robots at run-time. The SW robots generated by SmartRPA are obtained to handle
the intermediate user inputs that are required during the routine execution, thus enabling to
emulate the most suitable routine variant for any specific combination of user inputs as observed
in the UI log (C2). This makes the synthesis of SW robots performed by SmartRPA approach
reactive to any user decision found during a routine execution, thus allowing the potential
run-time generation of as many SW robots as the routine variants to be emulated (C3).</p>
    </sec>
    <sec id="sec-4">
      <title>4. Concluding Remarks</title>
      <p>In summary, this research tries to mitigate the involvement of skilled human experts in steps 1,
2, 3, and 4, throughout the development of the SmartRPA approach which is able to tackle C1,
C2 and C3. The main weakness of the SmartRPA approach is correlated with the quality of
information recorded in real-world UI logs. Since a UI log is fine-grained, routines executed
1https://github.com/bpm-diag/smartRPA
with many diferent strategies may potentially afect the identification of the routine segments.</p>
      <p>In conclusion, our approach is based on a semi-supervised assumption, since we know a-priori
the end-delimiters to be associated to any user action that ends a routine execution. On the
other hand, the approach is not aware of the concrete behaviour of the routines of interest,
which will be discovered by the approach itself. For this reason, we consider this contribution
as an important step towards the development of a more complete and unsupervised approach.
Towards this direction, we aim at relaxing the semi-supervised assumption by employing
machine learning and DNN techniques to automatically identify the end-delimiters.
Acknowledgments. This work has been supported by the H2020 project DataCloud.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Kirchmer</surname>
          </string-name>
          ,
          <article-title>Robotic Process Automation-Pragmatic Solution or Dangerous Illusion</article-title>
          , BTOES Insights, June'
          <volume>17</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          , Robotic Process Automation,
          <source>Bus. Inf. Syst. Eng</source>
          .
          <volume>60</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Aguirre</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rodriguez</surname>
          </string-name>
          ,
          <article-title>Automation of a Business Process Using Robotic Process Automation (RPA): A Case Study</article-title>
          , in: Appl. Comp. Scien. in Eng., Springer,
          <year>2017</year>
          , pp.
          <fpage>65</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>AI-Multiple</surname>
          </string-name>
          ,
          <source>Top 53 RPA Tools</source>
          ,
          <year>2022</year>
          . URL: https://blog.aimultiple.com/rpa-tools/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          , M. Mecella,
          <article-title>Research Challenges for Intelligent Robotic Process Automation</article-title>
          , in: Business Process Management Workshops,
          <year>2019</year>
          , pp.
          <fpage>12</fpage>
          -
          <lpage>18</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Chakraborti</surname>
          </string-name>
          , et al.,
          <article-title>From Robotic Process Automation to Intelligent Process Automation: Emerging Trends</article-title>
          , in: RPA Forum '
          <volume>20</volume>
          , Springer,
          <year>2020</year>
          , pp.
          <fpage>215</fpage>
          -
          <lpage>228</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mecella</surname>
          </string-name>
          ,
          <article-title>Towards Intelligent Robotic Process Automation for BPMers</article-title>
          . arXiv:
          <year>2001</year>
          .00804,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Jimenez-Ramirez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. A.</given-names>
            <surname>Reijers</surname>
          </string-name>
          , I. Barba,
          <string-name>
            <given-names>C.</given-names>
            <surname>Del Valle</surname>
          </string-name>
          ,
          <article-title>A Method to Improve the Early Stages of the Robotic Process Automation Lifecycle</article-title>
          , in: CAiSE'
          <fpage>19</fpage>
          ,
          <year>2019</year>
          , pp.
          <fpage>446</fpage>
          -
          <lpage>461</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>V.</given-names>
            <surname>Leno</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Polyvyanyy</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          , Robotic Process Mining: Vision and Challenges,
          <string-name>
            <surname>Bus. Inf. Syst. Eng.</surname>
          </string-name>
          (
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>14</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mecella</surname>
          </string-name>
          ,
          <source>Automated Segmentation of User Interface Logs</source>
          . In: RPA. Management, Technology, Applications, De Gruyter,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lupia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mecella</surname>
          </string-name>
          ,
          <source>Automated Generation of Executable RPA Scripts from User Interface Logs</source>
          , in: RPA Forum '
          <volume>20</volume>
          , volume
          <volume>393</volume>
          ,
          <year>2020</year>
          , pp.
          <fpage>116</fpage>
          -
          <lpage>131</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lupia</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mecella</surname>
          </string-name>
          ,
          <article-title>Reactive synthesis of software robots in RPA from user interface logs, Comp</article-title>
          . in Industry 142 (
          <year>2022</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>S.</given-names>
            <surname>Agostinelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Leotta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marrella</surname>
          </string-name>
          ,
          <article-title>Interactive Segmentation of User Interface Logs</article-title>
          ,
          <source>in: 19th Int. Conf. on Service-Oriented Computing (ICSOC)</source>
          , volume
          <volume>13121</volume>
          ,
          <year>2021</year>
          , pp.
          <fpage>65</fpage>
          -
          <lpage>80</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>D. J.</given-names>
            <surname>Cook</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. C.</given-names>
            <surname>Krishnan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rashidi</surname>
          </string-name>
          ,
          <article-title>Activity Discovery and Activity Recognition: A New Partnership</article-title>
          ,
          <source>IEEE Transactions on Cybernetics</source>
          <volume>43</volume>
          (
          <year>2013</year>
          )
          <fpage>820</fpage>
          -
          <lpage>828</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>W. M. van Der Aalst</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Pesic</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Schonenberg</surname>
          </string-name>
          , Declarative Workflows:
          <article-title>Balancing between Flexibility and Support, Comp</article-title>
          .
          <source>Sc.-Res. and Dev</source>
          .
          <volume>23</volume>
          (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>M. de Leoni</surname>
          </string-name>
          , A. Marrella,
          <source>Aligning Real Process Executions and Prescriptive Process Models through Automated Planning, Expert System with Application</source>
          <volume>82</volume>
          (
          <year>2017</year>
          )
          <fpage>162</fpage>
          -
          <lpage>183</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>