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 implement/reference/run an existing plugin as part of a new plugin?
Hello, I want to create a new plugin to perform some calculations on some log files, but as part of this new plugin, I would also like to implement/run other existing plugin(s) on my log file when I execute my plugin?
For example, My new plugin is XYZ, then when I run my XYZ plugin, it should also run an existing plugin, let's say "Convert log to Directly follows graph" plugin as part of my new plugin XYZ along with my own new calculations.
What is the approach to extend such functionality? Or more specifically, for my input log file, how do I create a Directly Follows Graph (as output/visualization in the visualisation pane) as part of my new plugin?
PS: I am new to Java development, so please bear my naiveness.
For example, My new plugin is XYZ, then when I run my XYZ plugin, it should also run an existing plugin, let's say "Convert log to Directly follows graph" plugin as part of my new plugin XYZ along with my own new calculations.
What is the approach to extend such functionality? Or more specifically, for my input log file, how do I create a Directly Follows Graph (as output/visualization in the visualisation pane) as part of my new plugin?
PS: I am new to Java development, so please bear my naiveness.
Answers
-
Hi,This is not a naive question, as many wonder how to do this in the best possible way.The preferred way is to use the tryToFindOrConstructFirstNamedObject method from the plugin context that is passed as first argument to every plugin. This method takes the following parameters:
- Class<X> type: The class X of the desired result. In your example this should be the class of the Directly follows graph that you want. Like DirectlyFollowsGraph.class, or something like that.
- String name: The name of the plugin you want to use for getting the result. This is the name of the plugin as it is specified in the @plugin annotation.
- Class<Connection> connectionType: The type of the connection to use. Please set this to null if you do not want to use connections.
- String role: The role of the desired result in a connection. Please set this to null as well if you do not want to use conenctions.
- Object... inputs: The inputs to the plugin. In your example this should be the event log.
Kind regards,Eric.
-
Thank you so much for such quick reply and detailed answer. Can I find any such references in the existing plugins in any packages just an example? I am still trying to understand the framework so I am thinking it would be of great help to analyse any such examples in the existing packages.
-
Hi,In https://svn.win.tue.nl/trac/prom/browser/Packages/AcceptingPetriNetMiner/Trunk/src/org/processmining/acceptingpetrinetminer/miners/impl you will find some examples on how you can call certain miners. Some of them will use the way I described, others may use a different approach.Kind regards,Eric.
-
Thank you so much, it worked
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
- 393 - Usage
- 287 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame