<!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>CCaaS: Online Conformance Checking as a Service</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ingo Weber</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andreas Rogge-Solti</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Chao Li</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="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>NICTA</institution>
          ,
          <addr-line>Sydney</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Wirtschaftsuniversitat Wien</institution>
          ,
          <addr-line>Vienna</addr-line>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Conformance checking, a method of process mining, is commonly used to assess how well a set of historic log traces ts a given process model, or vice versa. Here we explore online conformance checking, i.e., to check conformance on logs while they are written. This can be useful for near-realtime detection of errors and deviations from the desired path. While the online aspect leads to some challenges, we also study e cient detection of timing anomalies and violations of numerical invariants. The approach is implemented in CCaaS, a RESTful service that detects un tting events and other errors in split seconds.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        One main activity in process mining is conformance checking, i.e., determining
if a process model ts a given event log, or vice versa. Conformance checking
is often used to assess the quality of discovery algorithms [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], or how well a
model discovered from historic logs ts new logs. Thus conformance checking is
routinely applied o ine, and only subjected to event logs from completed traces.
      </p>
      <p>
        In contrast, in this work we propose to use conformance checking as an online
activity, to detect tness errors as soon as they can be observed. Consider the
example of earlier work, where we have shown that process-oriented analysis and
online error detection can strongly improve system reliability [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In that work,
process mining is used as a method to perform behavioral log analysis (through
discovery) and tracking (through conformance checking) of systems.
      </p>
      <p>The applicability of online conformance checking is much wider than system
log analysis. Whenever a process model needs to be followed strictly, e.g., to
ensure compliance with laws and regulations, online conformance checking can
be used to detect deviations in near-realtime.</p>
      <p>Our contributions in this paper are4:</p>
      <p>Retrieve log
data</p>
      <p>Basic
conformance
checking</p>
      <p>Detect num.</p>
      <p>invariant
violations
Detect
timing
anomalies</p>
      <p>Visualize
results
(POD-Viz)
{ Timing anomaly detection, based on timing anomaly intervals that can be
exported from a ProM plugin and imported into CCaaS, which in turn checks
if the duration of any activity is anomalous.
{ Applying numerical invariants to conformance checking: based on numerical
information in log events, CCaaS learns how many loop iterations or
multiinstantiated (MI) subprocess instances should be executed, and checks if the
actual number of executions adheres to this constraint.</p>
      <p>CCaaS is part of the POD tool suite NICTA has developed over the past two
years,5 where POD stands for Process-Oriented Dependability.
2</p>
    </sec>
    <sec id="sec-2">
      <title>CCaaS Overview</title>
      <p>In this section we discuss the core features of CCaaS, shown in Fig. 1: retrieving
events and mapping them to process models, basic conformance checking, timing
anomalies, and numerical invariants. Finally, we discuss the implementation.
2.1</p>
      <sec id="sec-2-1">
        <title>Retrieving and Parsing Event Data</title>
        <p>To retrieve log events in a timely fashion, a log agent can be deployed on the
log-emitting system. We use the open-source tool Logstash6 for this purpose.
Since CCaaS is implemented as a RESTful service, it su ces to con gure the
Logstash agent to watch the location where logs are emitted (log le, database,
or similar) and to forward each new log event to CCaaS via a HTTP invocation.</p>
        <p>
          Once a new event is retrieved by CCaaS, we parse the event for the
information that allows us to associate the event with a process model, instance, and
activity in the model. This is log-type speci c, and implemented with regular
expressions. Relevant regular expressions can largely be learned during process
discovery, e.g., using POD-Discovery [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], another tool from the POD tool suite.
2.2
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Basic Conformance Checking</title>
        <p>
          The main methods to check conformance are token replay [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], constraint
checking [
          <xref ref-type="bibr" rid="ref10 ref5">10, 5</xref>
          ], and alignment [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. In this work, we utilize token replay due to its
conceptual integration with BPMN.
        </p>
        <sec id="sec-2-2-1">
          <title>5 http://reliableops.com 6 http://www.logstash.net/, accessed on 6/6/2015</title>
          <p>Token replay reenacts a historic log on the model by moving tokens through
the model based on the observed events (after they have been mapped to
activities in the model). If an activity's execution is observerd, but there is no token
activating it, an error is thrown indicating the missing token, and a new token
is inserted to activate the activity.</p>
          <p>
            CCaaS accepts process models in BPMN. BPMN's execution semantics can
be expressed as a token game, see e.g. [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ]: tokens are placed on edges and an
activity is activated if a token is present on its incoming edge, among others.
          </p>
          <p>However, there is one challenge in implementing online token replay: for
decision points (like XOR splits) it is a priori unclear which subsequent branch
should be activated, i.e., which outgoing edge should receive a token. In essence,
for the purposes of token replay we have to interpret each XOR split as a deferred
choice. While in the process model the decision may be based on deterministic
criteria, for CCaaS as an outside observer, the criteria are in general not visible.
Hence we have to wait for the next observable event, i.e, activity execution,
before we know which decision was made.</p>
          <p>
            We solve the challenge using a token pull mechanism, which, in brief, works
as follows. If activity A is observed, but not activated, we try to pull a token
from its predecessor in the model. If that predecessor is another activity or a join
gateway, the pull fails. If the predecessor is a split gateway, and is activated, the
gateway is executed and the pull succeeds; if the split gateway is not activated,
it attempts to pull a token from its predecessor, using the same logic.
Multiinstantiation can be handled by CCaaS as described in [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ].
2.3
          </p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>Timing Anomalies</title>
        <p>When business processes and activities are enacted multiple times and we
measure the time spent in activities, we can learn the expected performance
characteristics of activities. That is, we can learn the duration distributions of activities,
which give us detailed insights into the timing behavior. We are interested in
deviations from the expected behavior, e.g., if an activity is nished too early.</p>
        <p>
          Based on the work of Rogge-Solti and Kasneci [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], we compute an activity's
temporal anomaly intervals that correspond to unexpected durations. Therefore,
we select a threshold of interest. For instance, we can set a threshold of 0.05, if
we want to compute the intervals of the 5 percent most extreme cases.
        </p>
        <p>
          Technically, we compute the boundaries of the intervals by looking at the
distribution of the log-likelihood of random samples from the duration
distribution as suggested by Yeung and Chow [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. For example, with a 0.05 threshold,
the cuto value can be estimated by the 5th percentile of the log-likelihood
distribution. The samples to the left of that value have lower log-likelihoods, and
would be considered as outliers.
        </p>
        <p>
          With the 5th percentile estimated, we use its value d of the probability density
function (pdf) as a threshold. Finally, we subtract the density d from the pdf and
need to nd the roots of this shifted function. That is, we look for the regions
where this shifted pdf is negative. In the case of non-parametric kernel density
estimates using Gaussian heaps, we lack a closed analytic formula for the density.
Therefore, we apply a numeric root- nding algorithm as presented by Ford [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]
to nd the interval boundaries and export the interval regions.
        </p>
        <p>Once timing anomaly intervals are computed for the activities, CCaaS
compares the durations of the activities, as observed through the respective events,
to the corresponding intervals. If an observed duration is anomalous, i.e., it lies
within the anomaly intervals, an according error is raised to warn the analyst.
2.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Numerical Invariants</title>
        <p>
          In processes with iteration or multi-instantiation, some log events may contain
numerical information about the number of iterations or multi-instantiated (MI)
subprocesses that is expected if the current process instance operates correctly.
For instance, in logs from Net ix Asgard7 rolling upgrade, one log line states
"The group gr01 has 8 instances. 8 will be replaced, 1 at a time."
Subsequently, a loop is executed exactly 8 times, unless there is an error. One
technique to discover such numerical invariants in logs can be found in the
literature [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Assuming the discovery has taken place, a numerical invariant in
CCaaS is de ned by the following attributes:
{ Start trigger event and position of the current values xmin; xmax in the event
log, the lower and upper bounds, respectively. If there is only one exact value
x, e.g., x = 8 in the example above, then xmin := x =: xmax.
{ Scope of invariant e ect, e.g., content of a loop or an MI subprocess.
{ End trigger event, i.e., when all executions of the scope have to be completed.
        </p>
        <p>Based on such a speci cation, CCaaS watches for the start trigger; once
observed, the concrete values for xmin and xmax in the current process instance
are known. Then, CCaaS tracks every start of the invariant's scope and retains
the number xcurr. If xcurr &gt; xmax is observed, CCaaS raises an error. Once the
end trigger is observed, CCaaS checks that xmin xcurr xmax, and that each
of the xcurr instances of the scope completed successfully. Should any of these
criteria not be met, an error is raised.
2.5</p>
      </sec>
      <sec id="sec-2-5">
        <title>Implementation</title>
        <p>CCaaS is implemented in about 1800 lines of Java code, using the Spring
framework, and is available as open-source.8 When invoked through the loopback
network interface, average response time is typically below 10ms. In most
deployments, higher network delays should be taken into consideration.</p>
        <p>The computation and export of anomaly intervals are implemented in the
ProM framework9, also available as open-source. Starting from an enriched
stochastic Petri net, the plugin can compute anomaly intervals for all transitions, which
are then exported as JSON for online anomaly detection in CCaaS.</p>
        <sec id="sec-2-5-1">
          <title>7 https://github.com/Netflix/asgard accessed on 10/6/2015 8 https://github.com/NICTA/pod-detection/tree/master/cfmchecker 9 See the StochasticPetriNet package at http://www.promtools.org</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Summary</title>
      <p>
        General-purpose online conformance checking can support many usage scenarios.
Any scenario where the timeliness of detecting non-conformance or errors is
important can bene t strongly, e.g., so that the underlying issue can be corrected
before it turns into a serious problem. Behavioral log analysis and tracking can
be of great value to system reliability, as outlined in our previous work [
        <xref ref-type="bibr" rid="ref11 ref9">9, 11</xref>
        ].
The added capabilities for timing anomalies and numerical invariants bring
this application to a new level: multiple concurrent subprocess instances can be
tracked individually, in terms of tness and the exact timing of their activities;
we can ensure that the number of subprocess instances is exactly as expected
and that each subprocess completes successfully. CCaaS has been developed over
the last 18 months, and will be applied as part of the POD tool suite in trials
with NICTA's business teams and industry partners in the near future.
      </p>
      <p>Two screencast videos accompany this paper. First, we show CCaaS through
the POD-Viz frontend.10 Second, a brief screencast video shows the export of
timing anomaly intervals from ProM.11
10 https://youtu.be/I-EjJGbvmzQ
11 http://andreas.solti.de/temporal-anomaly-intervals</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.: Process Mining: Discovery, Conformance and Enhancement of Business Processes. Springer (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.,
          <string-name>
            <surname>Adriansyah</surname>
          </string-name>
          , A.,
          <string-name>
            <surname>van Dongen</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Replaying history on process models for conformance checking and performance analysis</article-title>
          .
          <source>WIREs Data Mining and Knowledge Discovery</source>
          <volume>2</volume>
          (
          <issue>2</issue>
          ),
          <volume>182</volume>
          {
          <fpage>192</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Ford</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          :
          <article-title>Improved algorithms of illinois-type for the numerical solution of nonlinear equations</article-title>
          .
          <source>Tech. rep.</source>
          , University of Essex, Computer Science Dept. (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Lou</surname>
            ,
            <given-names>J.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fu</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Mining invariants from console logs for system problem detection</article-title>
          .
          <source>In: USENIX ATC</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Maggi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Montali</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Westergaard</surname>
          </string-name>
          , M.,
          <string-name>
            <surname>van der Aalst</surname>
          </string-name>
          , W.:
          <article-title>Monitoring business constraints with linear temporal logic: An approach based on colored automata</article-title>
          .
          <source>In: BPM</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Rogge-Solti</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kasneci</surname>
          </string-name>
          , G.:
          <article-title>Temporal anomaly detection in business processes</article-title>
          .
          <source>In: BPM</source>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farshchi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>J.G.</given-names>
          </string-name>
          :
          <article-title>Mining processes with multiinstantiation</article-title>
          .
          <source>In: ACM SAC</source>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <article-title>Ho mann</article-title>
          , J.,
          <string-name>
            <surname>Mendling</surname>
          </string-name>
          , J.:
          <article-title>Beyond soundness: On the semantic consistency of executable process models</article-title>
          .
          <source>In: IEEE ECOWS</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bass</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Discovering and visualizing operations processes with POD-Discovery and POD-Viz</article-title>
          . In: IEEE/IFIP DSN (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Weidlich</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Desai</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weske</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Process compliance analysis based on behavioural pro les</article-title>
          .
          <source>Inf. Syst</source>
          .
          <volume>36</volume>
          (
          <issue>7</issue>
          ),
          <volume>1009</volume>
          {
          <fpage>1025</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bass</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sun</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>POD-Diagnosis: Error diagnosis of sporadic operations on cloud applications</article-title>
          . In: IEEE/IFIP DSN (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Yeung</surname>
            ,
            <given-names>D.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chow</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Parzen-Window Network Intrusion Detectors</article-title>
          .
          <source>In: IEEE ICPR</source>
          . vol.
          <volume>4</volume>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>