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.

Return multiple Objects

bjmohrbjmohr Posts: 5
edited August 2017 in - Development
Hi,

I need to return multiple objects in ProM, for example 4 Petri nets. Unfortunately, ProM only returns the first Object of the Object Array and shows it in the workspace. Is there a possibility to export ProM-Objects like petrinets or other objects, which can be exported through ProM, automatically? So, can I trigger the export mechanism in code? 

Greetings,
Björn
Post edited by JBuijs on
Tagged:

Comments

  • hverbeekhverbeek Posts: 427
    Dear Björn,

    By default, ProM indeed automatically only puts the first result of a plug-in in the workspace. But, you can also put objects in the workspace manually by using the createProvidedObject method of the ProvidedObjectManager. Assume that thew variable pn2 holds the second Petri net in your result array, and that the variable context is the PluginContext in which your plug-in is running. You can then put the secon dPetri net into the workspace by using:

    context.getProvidedObjectManager().createProvidedObject(
    "Second Petri net", pn2, Petrinet.class, context);
    The object will not be favorite (there are ways to do that as well, but I do not recall by heart), so you have to look for it in the All tab.

    Kind regards,

    Eric.


  • bjmohrbjmohr Posts: 5
    Hi Eric,

    thank you very much.
Sign In or Register to comment.