To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.

Computation & Transition Time in Petrinet / BPMN using Inductive Miner

We are on ProMLite and are using Inductive miner, which creates a petrinet. We converted the petrinet into BPMN using convert_petri_net_to_bpmn_diagram script in CLI.  We are able to render this BPMN 2.0 file in our web application. We also need to display the below in the BPMN:
  1. min, max, average time to execute steps
  2. computing transition time between steps 
  3. who are the users working on the process etc. etc.
Please help with the plugin and associated script for CLI.

Comments

  • Hi,

    I guess the main issue here is get an alignment between the event log and the model. This alignment links activities in the event log to objects (like transitions) in the model. Using such an alignment, you can then compute the metrics that you are interested in.

    I do not know how to compute this alignment for a BPMN diagram other than converting it to a Petri net first. Therefore, I will assume that having an alignment for the event log and the Petri net would be fine.

    Enclosed you will find a CLI script file that I use to compute an alignment between an event log (importlog, imported from a XES file) and a Petri net (importmodel, imported from a PNML file). The script assumes that the transition labels in the Petri net match the activity names in the event log perfectly.

    As I am only  interested in whether the alignment is a perfect match or not, I only count successes (pos) and failures (neg). But the result of the line 127 "result = futures.get[i];" is a PNRepResult object, that is, an alignment.

    I hope this helps you a bit.

    Kind regards,
    Eric.


  • Thank you Eric. The script is helpful.

    I am trying to find the average/minimum/maximum throughput time of cases and I find org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayer helpful. But I need to run the same in CLI. how do I get the UI PluginContext i CLI and how to get these values?
  • Hi,

    Plugins that require a UIPluginContext cannot be run in a CLI context. The plugin you are referring to has a variant ("From Petri net and Event Log, given algorithm and parameters") that requires the general PluginContext, and that one can run in the CLI context. Unlike the UIPluginContext variant, you need to specify the both replay algorithm and its parameters as arguments.

    You can start ProM in a CLI context by using org.processmining.contexts.cli.CLI as the main class (instead of org.processmining.contexts.uitopia.UI). When starting ProM this way, it is typically useful to add a script file that you want to have executed. You can add this scriptfile using the "-f scriptfile" option. Below, I've included the contents of a Windows batch file that I use to start ProM in a CLI context and to execute the script as inlcuded earlier. Note that I use environment variables (like IMPORTLOG) to pass on additional information from the batch file to the script.

    Kind regards,
    Eric.

    ----8<-----
    @GOTO start

    :add
    @set X=%X%;%1
    @GOTO :eof

    :start
    @set X=.\dist\ProM-Framework.jar
    @set X=%X%;.\dist\ProM-Contexts.jar
    @set X=%X%;.\dist\ProM-Models.jar
    @set X=%X%;.\dist\ProM-Plugins.jar

    @for /R .\lib %%I IN ("*.jar") DO @call :add .\lib\%%~nI.jar

    @set IMPORTLOG=%1.xes
    @set IMPORTMODEL=%2.pnml
    @set EXPORTLOG=%3.xes
    @set OUTPUT=%3.ClassifyPNML.log

    java -da -Xmx8G -classpath "%X%" -Djava.library.path=.//lib -Djava.util.Arrays.useLegacyMergeSort=true org.processmining.contexts.cli.CLI -f Scripts/ClassifyPNML.txt 1> %OUTPUT% 2>&1

    set X=






  • Am able to run the script which you shared in CLI. However am not able to find the plugin "From_Petri_net_and_Event_Log" in ProMLite. Could you please share additional details - name, parameters, return type etc. 
  • I found that. 

    I found the below also useful.
    manifest = replay_a_log_on_petri_net_for_performance_conformance_analysis(net, log, org.processmining.plugins.petrinet.manifestreplayer.algorithms.IPNManifestReplayAlgorithm.Debug.NONE, pnManifestparameters ); 

    Can you please help me for populating the algorithm and parameter values?
  • Hi,

    Please have a look at the script I enclosed earlier. On line 91, parameters are populated, while on line 94 the algorithm is populated. The code from line 59 to these lines is needed for the actual population.

    You might want to use slightly different settings, though. Please check your computer how many threads (nThreads) you can run comfortably in parallel. Also, a costUpperBound of 0 will not be that useful for you, I would set this to MAXINT if I were you. By default, a timeout (in milliseconds) of 10 * 1000 should do for you.

    The script does assume that the transition names in the Petri net match the event names in the log exactly.

    Kind regards,
    Eric.
  • Hi Eric,

    The code which you shared is for nl.tue.alignment.Replayer, which I could refer. However am trying to use org.processmining.plugins.petrinet.manifestreplayer.PNManifestReplayer.  
    Attached the code I tried of top of your script. Please refer from line 190 and let me know your suggestions.

    The requirement is 
    a) Min, Max, Avg throughput of cases
    b) Similar metrics for each activity

    Thanks in advance.
  • Hi,

    Populating the manifest replayer is uncharted territory for me as well. I guess you have already looked at the sources for this (like https://svn.win.tue.nl/trac/prom/browser/Packages/PNetReplayer/Trunk/src/org/processmining/plugins/petrinet/manifestreplayer/PNManifestReplayerParameter.java)? I would populate mapTransClass2Cost (costs for model moves) and mapEvClass2Cost (costs for log moves) as well, instead of leaving them null, but for the rest the constructor should work.

    You do not need to create a CLIContext and a CLIPluginContext. In the script, you can call the plugin by its name, and forget about the context. In this case, you should call replay_a_log_on_petri_net_for_performance_conformance_analysis(model, log, algorithm, pnmParameter).

    Kind regards,
    Eric.




  • Sure, will try this Eric. 
    Thank you.
Sign In or Register to comment.