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?
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.
Comments
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:
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.
thank you very much.