<!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>Generating Event Logs with CPN IDE</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Eric Verbeek</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dirk Fahland</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Eindhoven University of Technology</institution>
          ,
          <addr-line>Groene Loper 5, 5612 AE Eindhoven</addr-line>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This extended abstract introduces the event log generation facility of CPN IDE. CPN IDE has replaced CPN Tools as a tool for editing and simulating (Coloured) Petri Net models. The main advantage of generating event logs with CPN IDE is that it typically will work on existing models by providing some additional information, and that typically the models themselves do not require any change. Basically, the only change that may be required is the consistent use of a single variable for the case identifier.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Coloured Petri Net (CPN)</kwd>
        <kwd>CPN IDE</kwd>
        <kwd>Event Logs</kwd>
        <kwd>XES1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1. CPN IDE</p>
    </sec>
    <sec id="sec-2">
      <title>2. Generating event logs</title>
      <p>
        Although it is possible to create event logs using CPN Tools [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], this is not a simple endeavor. First,
it requires the user to incorporate special log-creating annotations into the CPN model, forcing to
change the model itself. Second, it requires the user to create specific Standard ML scripts for the
model at hand. As a result, a lot of manual labor is involved when using CPN Tools to create event
logs. In CPN IDE, the user can simply load a model, run a simulation (which results in raw
simulation records) and then configure the event log to be created. The only prerequisite for this
is that a single variable is used throughout the model for the case identifier.
      </p>
      <p>Figure 1 shows a screenshot of CPN IDE where a model has been loaded and has been
simulated for 500 steps while recording events and their timestamps. In the main toolbar, at the
top, the box preceding the Record events item has been selected, indicating that events are being
recorded, and the box preceding the Record event times has been checked, indicating that
timestamps are being recorded for the events. To get to such a state from which we can export an
event log, the user only needed to check both these items as additional actions to performing the
simulation as usual.</p>
      <p>If timestamps are recorded, then two events are recorded in the back-end for every transition
that (1) was fired and (2) does not have black fill: A start event and a complete event. If a
transition has a black fill, no events will be recorded. The timestamp for the start event simply
equals the current simulation time when the transition fired, but the timestamp of the complete
event is more involved. For this, we compare the token values in the new marking (after the
transition has fired) with the token values in the old marking (before the transition fired) and
take the lowest time of any token value in the new marking that is not in the old marking. If no
such token value exists, the current simulation time is used. As an example, if a transition fires at
time  and produces tokens at times  + 1,  + 2, and  + 3, then the start event will have
timestamp  and the complete event will have timestamp  + 1.</p>
      <p>
        The recorded events can now be exported to an event log using the Play Out Recorded Events
form in the lower left corner. For this export, the user needs to provide the following
configuration settings:
• Case Id: This should be the name of the variable that is used as the case identifier of an
event. Only recorded events that have this variable as an input in their binding will be
exported.
• Starting Moment: The date and time that coincides with the simulation time 0.0.
• Time Unit: The relation between wall clock time and simulation time. As an example, if set
to “hours”, then a simulation time of 1.0 means one hour.
• Lifecycle Transition Attribute: Which events will be exported to the event log:
• start: Only start events will be exported.
• complete: Only complete events will be exported.
• start+complete: Both start and complete events will be exported.
• in transition name: Only start events will be exported, but the lifecycle
transition start will be replaced by the lifecycle transition as found in the
transition name. As an example, if the transition name equals A+resume, then
start will be replaced by resume, which effectively replaces the start event with
a resume event. If no valid lifecycle transition is found in the transition name,
start will be replaced by the empty string.
• Keep Information on Event Level: Has no use at the moment.
• Log Format: The format for the exported log, either xes (for XES [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] files) or csv (for CSV
files).
      </p>
      <p>After having provided these settings, the user can select the Run button in the form, which will
ask the user for the name of the log file. After having provided this name, the log will be exported
to a file with that name (with either the extension .xes or .csv added). The exact location of the file
will be shown in the Project console.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Links</title>
      <p>From https://cpnide.org/ you can download the latest releases for CPN IDE. The latest release is
CPN IDE 1.23.0725.</p>
      <p>From the Latest downloads section on https://cpnide.org/ you can also download a screencast
on how to generate an event log in CPN IDE. In this screencast, we load an example model (which
can also be downloaded from the Latest downloads section), start the simulator, select to record
events together with their timestamps, and then simulate the model for 500 steps. After this, we
select how the events that are recorded in the back by the controller should be exported to an
event log, and have the controller export them accordingly.</p>
      <p>On https://github.com/cpn-io/cpn-js/ you will find the sources for CPN IDE. CPN IDE is Open
Source.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>CPN IDE has been extended with functionality that allows the user to generate event logs from
(new or existing) CPN models, provided that a single variable is used for the case identifier
throughout the model. The user can simply load the model into CPN IDE, select the option to
record events (and possibly also event times), simulate the model for some time, and then to
export an event log from the events that have been recorded.</p>
      <p>The variable for the case identifier plays an important role in this extension, as a recorded
event is exported to the event log if and only if the event has this variable as input. This also means
that from the same collection of recorded events event logs from different perspectives can be
exported. As an example, if a single variable is used throughout the model for a resource, then
this variable could be used as well, leading to an event log containing a trace for every different
resource.</p>
      <p>
        For future work we are thinking of adding an option to import and/or export models from and
to PNML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] files, adding an option to create object-centric event data logs and adding an option
to replay an event log on the model:
• Import/export from/to PNML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. CPN IDE (and CPN Tools as well) can be used together
with ProM because ProM can import/export P/T nets from/to CPNXML files2, which is the
native file format for both CPN IDE and CPN Tools. However, if CPN IDE could import/export
workflow nets from/to PNML, then other tools could also be used together with CPN IDE.
• Creation of object-centric event data logs. Every log that can be created by CPN IDE is now
limited to a single notion of a case, like an order number or a client name. However, processes
in real-life are often more complex and not limited to this single case notion. For this reason,
work is being done on a standard for capturing Object-Centric Event Data (OCED) in a log3.
• Replay of event log on model. In a way, this is the counterpart of the facility to generate
event logs as presented by this abstract. Instead of exporting the events that resulted from a
simulation to an event log, we then import an event log and then `guide' the simulation as best
as possible using the imported events.
2 As from ProM 6.10, the CPNXML export (Petri net) plug-in exports a P/T net to the CPNXML format and the Import
Petri net from CPNXML file plug-in imports a P/T net from a CPNXML file.
3 See https://www.tf-pm.org/resources/oced-standard (accessed on October 10, 2023).
The authors would like to thank Tom Verberk for the work on his master project, which resulted
in this facility to generate event logs in CPN IDE [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. We also would like to thank Mitchel Brunings
and Boudewijn van Dongen for their help and supervision on this project.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H. M. W.</given-names>
            <surname>Verbeek</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Fahland</surname>
          </string-name>
          ,
          <string-name>
            <surname>CPN IDE</surname>
          </string-name>
          :
          <article-title>An extensible replacement for CPN Tools that uses Access/CPN, in Proceedings of the ICPM Doctoral Consortium and Demo Track 2021 colocated with 10th International Conference on Process Mining (ICPM 2021), ser</article-title>
          . CEUR Workshop Proceedings, M. Jans,
          <string-name>
            <given-names>G.</given-names>
            <surname>Janssenswillen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kalenkova</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F. M.</given-names>
            <surname>Maggi</surname>
          </string-name>
          , Eds. CEURWS.org,
          <year>2021</year>
          , pp.
          <fpage>29</fpage>
          -
          <lpage>30</lpage>
          . [Online]. Available: http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>3098</volume>
          /demo 197.pdf
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Westergaard</surname>
          </string-name>
          and
          <string-name>
            <surname>H. M. W. Verbeek.</surname>
          </string-name>
          (
          <year>2018</year>
          )
          <article-title>CPN Tools</article-title>
          . [Online]. Available: https://cpntools.org/
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Westergaard</surname>
          </string-name>
          and
          <string-name>
            <given-names>L. M.</given-names>
            <surname>Kristensen</surname>
          </string-name>
          ,
          <article-title>The Access/CPN framework: A tool for interacting with the CPN Tools simulator</article-title>
          , in Applications and Theory of Petri Nets,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Franceschinis and</article-title>
          K. Wolf, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg,
          <year>2009</year>
          , pp.
          <fpage>313</fpage>
          -
          <lpage>322</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>A.K.A.d. Medeiros</surname>
            ,
            <given-names>C.W.</given-names>
          </string-name>
          <string-name>
            <surname>Günther</surname>
          </string-name>
          ,
          <article-title>Process mining: using CPN tools to create test logs for mining algorithms</article-title>
          , K. Jensen (Ed.),
          <source>Proceedings of the Sixth Workshop on the Practical Use of Coloured Petri Nets and CPN Tools (CPN</source>
          <year>2005</year>
          ), DAIMI, vol.
          <volume>576</volume>
          , University of Aarhus, Aarhus, Denmark (
          <year>2005</year>
          ), pp.
          <fpage>177</fpage>
          -
          <lpage>190</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>G.</given-names>
            <surname>Acampora</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Vitiello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. Di</given-names>
            <surname>Stefano</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. M. P.</surname>
          </string-name>
          v. d. Aalst,
          <string-name>
            <given-names>C. W.</given-names>
            <surname>Günther</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H. M. W.</given-names>
            <surname>Verbeek</surname>
          </string-name>
          , IEEE 1849TM:
          <article-title>The XES standard: The second IEEE standard sponsored by IEEE Computational Intelligence Society</article-title>
          ,
          <source>IEEE Computational Intelligence Magazine</source>
          , pp.
          <fpage>4</fpage>
          -
          <lpage>8</lpage>
          , May
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Billington</surname>
          </string-name>
          and et. al.,
          <source>The Petri Net Markup Language: Concepts</source>
          ,
          <string-name>
            <surname>Technology</surname>
          </string-name>
          , and Tools,”
          <source>in Application and Theory of Petri Nets</source>
          <year>2003</year>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Aalst</surname>
          </string-name>
          and E. Best, Eds., vol.
          <volume>2679</volume>
          ,
          <year>2003</year>
          , pp.
          <fpage>483</fpage>
          -
          <lpage>506</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T.</given-names>
            <surname>Verberk</surname>
          </string-name>
          ,
          <article-title>Generating Realistic Logs using a Colored Petri Net simulator</article-title>
          ,
          <source>30 Aug</source>
          <year>2022</year>
          ,
          <string-name>
            <surname>Master</surname>
            <given-names>thesis</given-names>
          </string-name>
          , Eindhoven University of Technology. [Online]. Available: https://research.tue.nl/files/292963154/Verberk_T.pdf.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>