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.

Petri Net to BPMN using CLI

Hi Guys, Hi Eric, 

i try to generate BPMN-Diagramms automatically from an Event-Log (.xes).
Is there any possibility to convert the resulting Petri-Net to BPMN using the command line ?
I found the Operator "Petri-Net to BPMN" in rapidProM, is this an "Only UI-Plugin" ? 

Many Thanks for your support,
Marc 
 

Comments

  • hverbeekhverbeek Posts: 583
    Hi Marc,

    Yes, that is possible. Please visit https://www.win.tue.nl/~hverbeek/pdc2020/miners/. At the bottom, you will find two links: one for a batch file and one for a script file. The batch file uses the script file to convert a BPMN file into a PNML file by first importing a BPMN model from the BPMNfile, then converting the BPMN model to a Petri net, and last exporting the Petri net to a PNML file.

    As you need to convert a Petri net to a BPMN model you need a different plugin, but the idea is the same. A snippet you could use is the following:

    // Assumption: 'net' is the Petri net you want to convert
    res = convert_petri_net_to_bpmn_diagram(net);
    // 'diagram' will be the resulting BPMN diagram.
    diagram = res[0];

    Kind regards,
    Eric.



  • Hi Eric,

    thanks for your quick reply. 
    I am afraid i cannot find the algorithm: "convert_petri_net_to_bpmn_diagram(net)"  in the list of available Plugins using the statement(in ProM6.4.1): ProM_CLI.bat -l 
    Is this a functionality of another plugin that i have to add ? 

    Best regards,
    Marc

  • hverbeekhverbeek Posts: 583
    Hi Marc,

    Quite possible that this plugin was not there yet in ProM 6.4.1. The plugin is now contained in the package BPMNConversions. I do not know by heart whether it is alreayd there in ProM 6.4.1. If so, it may have had a different name.

    Please check the list with action sin ProM 6.4.1 whether you can find any plugin that does what you want to do. This plugin should be headless, that is, it should have the gear/cog symbol at the left. If you can find such a plugin, then please note its name as listed in ProM.

    The method to call in the CLI is the name of the plugin, with capitals replaced by lowercase, spaces and other special characters with underscores, and multiple underscores in a sequence replaced by a single underscore. As an example, the plugin "A b (C d)" would correspond to the method "a_b_c_d_".

    Upgrading to, say, ProM 6.9 is not an option?

    Kind regards,
    Eric.
  • Thanks you're right the conversation of petri in BPMN is not headless in ProM6.4.1 in ProM 6.9 already. 
    Unfortunately the CLI commands in ProM6.9 do not work in the same way.
    I think it is much more complicated.....

    Sorry I'm not too familiar with CLI commands, you could tell me with which CLI command i can  start the Discovery.bat e.g. to use the Alpha Miner from your site https://www.win.tue.nl/~hverbeek/pdc2020/miners/.

    I guess I have to set the path to ProM6.9 as X.
    Where do i set the path to my xes.file (-> "IMPORTLOG ? )


  • hverbeekhverbeek Posts: 583
    Hi,

    You can run the Discovery,bat file form a Windows command prompt. The only thing you should change is the path to the actual java program. If you want to use the default java, you can replace the entire "..\..\Admin\jre8\bin\java" with just "java". You can then call the Discover.bat file like this:
    Discover.bat mylog.xes mymodel
    This will import the log from the file "mylog.xes", mine a Petri net using the alpha miner (using the Discovery.txt script file from the local Scripts folder), and export that Petri net to the file "mymodel.pnml" (note that you do not specify the ".pnml" part, the Discovery.bat file will add this). 

    Basically, the batch file runs the script file using the ProM CLI context.

    Please do not change the X. This is a variable that is used in the batch file to construct the classpath. Things may break if you change this.

    Kind regards,
    Eric.


  • Hi Eric,

    i am still trying to get the alpha miner working.
    While processing the Script Discover.txt i get this exception back:

    Error while executing '[-f, Discover.txt]'
    org.processmining.contexts.scripting.ScriptExecutor$ScriptExecutionException: Sourced file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : Unknown class: XEventNameClassifier : at Line: 22 : in file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : new XEventNameClassifier ( ) 

    Exception in thread "main" org.processmining.contexts.scripting.ScriptExecutor$ScriptExecutionException: Sourced file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : Unknown class: XEventNameClassifier : at Line: 22 : in file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : new XEventNameClassifier ( ) 

    at org.processmining.contexts.scripting.ScriptExecutor.execute(ScriptExecutor.java:109)
    at org.processmining.contexts.cli.CLI.main(CLI.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.processmining.framework.boot.Boot.boot(Boot.java:463)
    at org.processmining.framework.boot.Boot.boot(Boot.java:430)
    at org.processmining.contexts.cli.CLI.main(CLI.java:161)
    Caused by: Sourced file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : Unknown class: XEventNameClassifier : at Line: 22 : in file: inline evaluation of: ``print("Discovering...");  importlog = System.getenv("IMPORTLOG");  exportmodel = . . . '' : new XEventNameClassifier ( ) 

    at bsh.BSHAllocationExpression.objectAllocation(Unknown Source)
    at bsh.BSHAllocationExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHArguments.getArguments(Unknown Source)
    at bsh.BSHAllocationExpression.objectAllocation(Unknown Source)
    at bsh.BSHAllocationExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHTernaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHPrimaryExpression.eval(Unknown Source)
    at bsh.BSHAssignment.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at bsh.Interpreter.eval(Unknown Source)
    at org.processmining.contexts.scripting.ScriptExecutor.execute(ScriptExecutor.java:86)
    ... 8 more

  • hverbeekhverbeek Posts: 583
    Hi,

    The script executor cannot find the XEventNameClassifier() constructor.

    Please check which packages you have installed in the instance of ProM you are actually using. The Log package may be lacking.

    Kind regards,
    Eric.

  • BissmarcBissmarc Posts: 6
    hi guys,
    i have created a bpmn diagram with the prom plugins alpha miner and bpmn conversation. But the visual representation (bpmndi) is missing. I guess I need the prom jgraph visualizer for this but I can't find a jar file.

    thanks for your advice,
    marc
  • hverbeekhverbeek Posts: 583
    Hi Marc,

    The ProM JGraph visualizer can be found in the Widgets package (org.processmining.models.jgraph.ProMJGraphVisualizer). However, using this visualizer as-is will not yield in readable BPMN diagrams, as JGraph only calculates a layout for a graph if it is actually put on the screen. Even if you can get a visualization, it will lack a layout.

    An option could be to add a layout by applying the block layout plug-in first on the BPMN diagram. This plug-in can be found in the BlockLayout package (org.processmining.blocklayout.plugins.LayoutPlugin) and can take a BPMN diagram as parameter. I cannot tell you how to export a JGraphvisualization, as I honestly do not know.

    An alternative could be to use dot to create the layout and the visualization. For this, you can use a plugin from the GraphVisualizers package (org.processmining.plugins.GraphVisualizerPlugin). This plugin can take the BPMN diagram as parameter, returns a DotPanel that visualizes the diagram. Again, how to export this panel, I do not know.

    Best,
    Eric.



Sign In or Register to comment.