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.
How to automatically generate the Petri net model using inductive miner?
Dear all,
I am using ProM 6.6 for my process analysis tasks (Petri net model and decision rules and trace variants generation). Now, I want to automate the generation of the Petri net model from the XES log using Java (the petri net model is generated using the inductive miner). So, using the rapidprom and the openXES jars, I wrote the code:
public class PetriNetGenerationAutomationClass {
//here, I want to load the default parameters ("variant=Inductive Miner (IM)" and "Event classifier=concept:name" as in proM 6.6)
I am using ProM 6.6 for my process analysis tasks (Petri net model and decision rules and trace variants generation). Now, I want to automate the generation of the Petri net model from the XES log using Java (the petri net model is generated using the inductive miner). So, using the rapidprom and the openXES jars, I wrote the code:
public class PetriNetGenerationAutomationClass {
public static void main(String[] args) throws FileNotFoundException, Exception {
//loading the xes file
String xesFilePath = "C:\\TraceVariantTest\\runningExample.xes";
File file = new File(xesFilePath);
String outputPNMLFilePath = "W:\\TraceVariantTest\\OutputPNML";
File outputPNMLFile = new File(xesFilePath);
XLog myXesLog = XUtils .loadLog(file);
System.out.println("myXESLog is succesfully read! \n");
//here, I want to load the default parameters ("variant=Inductive Miner (IM)" and "Event classifier=concept:name" as in proM 6.6)
XEventClassifier classifier = MiningParameters.getDefaultClassifier();
MiningParameters parameters = new org.processmining.plugins.InductiveMiner.mining.MiningParametersIMi();
Object[] object = IMPetriNet.minePetriNet(myXesLog, parameters); //I don't understand why am I having an object[] here, but I assume the petri net model is the first element
Petrinet petriNetModel = (Petrinet) object[0];
PetriNetFileFormat format = PetriNetFileFormat.PNML;
//Export the petri net model in pnml format
//Export the petri net model in pnml format
writeToFile(outputPNMLFile, petriNetModel, format); //of the ExportPetriNetOperator class
}
\\To avoid the error "The method writeToFile(File, Petrinet, PetriNetFileFormat) is undefined for the type PetriNetGenerationAutomationClass" I copied and pasted the function in my code
The code above is generating a NullPointerException error, caused by the "writeToFile". Is there any other solutions allowing us to export the petri net model in pnml format? are the mining parameters specified correctly?
I appreciate your feedback,
Regards,
Widad
\\To avoid the error "The method writeToFile(File, Petrinet, PetriNetFileFormat) is undefined for the type PetriNetGenerationAutomationClass" I copied and pasted the function in my code
static void writeToFile(File file, Petrinet object, PetriNetFileFormat format) throws IOException {
switch (format) {
case EPNML:
PnmlExportNetToEPNML exporterEPNML = new PnmlExportNetToEPNML();
exporterEPNML.exportPetriNetToEPNMLFile(RapidProMGlobalContext.instance().getPluginContext(), object, file);
break;
case PNML:
default:
PnmlExportNetToPNML exporterPNML = new PnmlExportNetToPNML();
exporterPNML.exportPetriNetToPNMLFile(RapidProMGlobalContext.instance().getPluginContext(), object, file);
break;
}
}
}The code above is generating a NullPointerException error, caused by the "writeToFile". Is there any other solutions allowing us to export the petri net model in pnml format? are the mining parameters specified correctly?
I appreciate your feedback,
Regards,
Widad
Widad Es-Soufi
PhD Student
“Decision-making support in the context of systems design and supervision”
Arts et Métiers ParisTech. France.
Howdy, Stranger!
Categories
- 1.6K All Categories
- 45 Announcements / News
- 225 Process Mining
- 6 - BPI Challenge 2020
- 9 - BPI Challenge 2019
- 24 - BPI Challenge 2018
- 27 - BPI Challenge 2017
- 8 - BPI Challenge 2016
- 68 Research
- 1K ProM 6
- 394 - Usage
- 288 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame