Using ILP miner from CLI

GDLP8GDLP8 Posts: 6
Hi,

I'm working on a project that obtains a XLog file from the log of an application and passes it to ProM. What I need to do there is to obtain a diagram, which is estimated from the XLog. As the project is automated, the plugin to be used needs to be called from the CLI, and it is neccesary to be able to export the result obtained out of ProM (I mention this because I tried using Fuzzy Miner, but it cannot export its results). The application I use converts UML diagrams to code. Therefore, I would need to obtain a UML from a conversion.

However, as I could not find any plugin for generating UMLs, I decided to do it by using Petrinets. After generating the Petrinet and exporting it to my disk, what I do is use and XSLT to convert from the format of the Petrinet to a UML. Among all the possible petrinet converter plugins I found in ProM, ILP Miner gave the bests results (I tested it using the ProM UI application). However, as stated before, what I need is to use this plugin from the CLI. I have checked the list of possible functions to call from the CLI and found the following one:

ilp_miner(XLog, XLogInfo, ILPMinerSettings) -> (Petrinet, Marking)

I have no doubt regarding the first two parameters, at least for now. However, I do not know how I should define the ILPMinerSettings so they correspond to the ones that I tried from the UI (that is, the default ones).

I would also want to know if ILP is the best option regarding the creation of Petrinets. I decided to use it mainly because it did not replicate the states, but I would gladly hear if there is some other better option.

I would be really grateful to anyone that could either tell me what I need to set as the third parameter of the ilp_miner function or which method is the most adequate to extract Petrinets.

Comments

  • hverbeekhverbeek Posts: 910
    Hi,

    Indeed, that would be the plugin to use here. I guess you have also seen the other variant of this plugin, the one that takes only a log as an input but require a UIPluginContext. This variant shows how you can create a default settings object:
    settings = (new ILPMinerUI()).getSettings();
    You can then pass this as the third argument. If needed, you can also make necessary changes to it before you pass it.

    There are a  number of other miners you could use to discover a Petri net from an event log, like the Inductive Miner and the Hybrid ILP Miner. The Hybrid ILP mIner can be called as follows:
    clss = (log.getClassifiers().isEmpty() ? new XEventAndClassifier(new XEventNameClassifier(), new XEventLifeTransClassifier()) : log.getClassifiers().get(0));
    res = ilp_based_process_discovery(log, clss);
    model = res[0];
    marking = res[1];
    The Inductive Miner as follows:
    clss = (log.getClassifiers().isEmpty() ? new XEventAndClassifier(new XEventNameClassifier(), new XEventLifeTransClassifier()) : log.getClassifiers().get(0));
    pars = new org.processmining.plugins.InductiveMiner.mining.MiningParametersIMi();
    pars.setClassifier(clss);
    res = mine_petri_net_with_inductive_miner_with_parameters(log, pars);
    model = res[0];
    marking = res[1];
    Perhaps also good to know that at https://icpmconference.org/2020/process-discovery-contest/downloads/ you can find some downloads for some headless miners, which includes the Inductive Miner and the Hybrid ILP miner.

    Kind regards,
    Eric.





  • GDLP8GDLP8 Posts: 6
    Hi,

    Thanks for your response.
    settings = (new ILPMinerUI()).getSettings();
    However, when I tried to integrate the previous line in the script to obtain the ILPMinerSettings, I got an Exception, saying that ILPMinerUI is an unknown class. I had similar problems with other classes, and what I needed to do to solve the problem was to add the entire path of the class. For example: 
    org.deckfour.xes.info.XLogInfoFactory.createLogInfo(log)
    Instead of: 
    XLogInfoFactory.createLogInfo(log)
    I tried searching for the entire path of the class, but I could not find anything. I will be really grateful if you could tell it to me.

    Thank you in advance.
  • hverbeekhverbeek Posts: 910
    Hi,

    Yes, I'm sorry. I forgot that for the script you need to add the full path to the class:
    settings = (new org.processmining.plugins.ilpminer.ILPMinerUI.ILPMinerUI()).getSettings();
    Kind regards,
    Eric.



  • GDLP8GDLP8 Posts: 6
    Thank you! That worked perfectly, except that I had to do a small change to your code:
    settings = (new org.processmining.plugins.ilpminer.ILPMinerUI()).getSettings();
    Thank you again for all your help.
Sign In or Register to comment.