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.

Creating a rapidminer operator of the rapidprom Data-flow discovery plugin

Dear all,

I have successfully created a Data flow discovery operator with two input ports (for xes log and petri net model) and one output port (for data petri net model). I still didn't set any parameter for the operator (except the default event classifier) but, however, getting an error when executing it in rapid miner studio, and I think it's about the PluginContext. Indeed, the DecisionMining class (import org.processmining.datadiscovery.plugins.DecisionMining;) needs a UIPluginContext instead of a PluginContext.

To avoid this error, I tried to cast it:

PluginContext pluginContext = RapidProMGlobalContext.instance().getFutureResultAwarePluginContext(DecisionMining.class);

result = DecisionMining.decisionMiner( (UIPluginContext) pluginContext, petriNet, xLog.getArtifact());

but I got this error message in the rapidminer studio log:

Feb 10, 2017 11:25:28 AM SEVERE: Process failed: null Feb 10, 2017 11:25:28 AM SEVERE: Here:

Feb 10, 2017 11:25:28 AM SEVERE:           Process[1] (Process)

Feb 10, 2017 11:25:28 AM SEVERE:            subprocess 'Main Process'

Feb 10, 2017 11:25:28 AM SEVERE:              +- Import Event Log[1] (Import Event Log)

Feb 10, 2017 11:25:28 AM SEVERE:              +- Import Petri Net[1] (Import Petri Net)

Feb 10, 2017 11:25:28 AM SEVERE:        ==>   +- My Own Operator[1] (My Own Operator)

 

Then, I tried to take the RapidProMGlobalContext and cast it:

PluginContext pluginContext =  RapidProMGlobalContext.instance().getPluginContext();

result = DecisionMining.decisionMiner( (UIPluginContext) pluginContext, petriNet, xLog.getArtifact());

But I got this error:

Feb 10, 2017 11:30:19 AM INFO: Start: decision miner Feb 10, 2017 11:30:19 AM INFO: Before calling decision miner Feb 10, 2017 11:30:19 AM INFO: In try Feb 10, 2017 11:30:19 AM INFO: In catch Feb 10, 2017 11:30:19 AM INFO: org.rapidprom.external.connectors.prom.RapidProMPluginContext cannot be cast to org.processmining.contexts.uitopia.UIPluginContext

Feb 10, 2017 11:30:19 AM INFO: DM just called Feb 10, 2017 11:30:19 AM SEVERE: Process failed: null Feb 10, 2017 11:30:19 AM SEVERE: Here:

Feb 10, 2017 11:30:19 AM SEVERE:           Process[1] (Process)

Feb 10, 2017 11:30:19 AM SEVERE:            subprocess 'Main Process'

Feb 10, 2017 11:30:19 AM SEVERE:              +- Import Event Log[1] (Import Event Log)

Feb 10, 2017 11:30:19 AM SEVERE:              +- Import Petri Net[1] (Import Petri Net)

Feb 10, 2017 11:30:19 AM SEVERE:        ==>   +- My Own Operator[1] (My Own Operator)

 

The call of the DecisionMining class is surrounded with try/catch:

try { logger.log(Level.INFO, "In try"); result = DecisionMining.decisionMiner( (UIPluginContext) pluginContext, petriNet, xLog.getArtifact()); } catch (Exception e) { logger.log(Level.INFO, "In catch"); e.printStackTrace(); logger.log(Level.INFO, e.getMessage()); }

Do you have any idea how to define the plugin context in order to call the decisionMiner() method of the DecisionMining class?

Thank you.

Best regards.





Widad Es-Soufi

PhD Student

“Decision-making support in the context of systems design and supervision”

Arts et Métiers ParisTech. France.






Comments

  • Hi Widad,
    just casting the PluginContext to an UIPluginContext won't work since the DecisionMining plug-in tries to show UI element for its configuration. I don't know why RapidMiner branch you are working on?

    However, in the LPM branch there are quite new versions of all packages included. Amongs other I added the Data petri net visualizers, DPN conformance checking, etc.
    What you could do is to use the non-UI variants of Decision Mining from the package:

    org.processmining.datadiscovery

    For example, the BasicDecisionTreeImpl can be used for decision mining. An example on how to use it can be found in the following class of the DataAwareExplorer package:
    https://svn.win.tue.nl/repos/prom/Packages/DataAwareExplorer/Trunk/src/org/processmining/dataawareexplorer/explorer/work/DiscoveryProcessor.java

    It is not quite straightfoward as the DataDiscovery package allows for quite some flexibilty. It is not only meant for Petri nets, but can also be used for any other modeling formalism where an 'alignment' works. Actually, it is a small wrapper around Weka.

    My plan is to create a class in the DataDiscovery package similar to DiscoveryProcessor, which can be used directly with a Petri net and an Event Log and a parameter class without UIPluginContext. Then, I would also create a RapidProM plugin. However, I am busy writing my PhD thesis, so this might take some while.

    Let me know whether you succeeded in creating the RapidProM plugin. I would like to add it.
Sign In or Register to comment.