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 return an array of strings in a plugin

ProMUser88
edited July 2013 in - Development
Hello Community.


Is there a possibility to return the values of String[] array in a Plugin, with the result that all values are displayed together in ProM?

The "problem" is, that the length of the array is not clear from the beginning, but first when the program is executed.


Here is some code for more comprehension

****************
****************
public class Method {

    @Plugin(name = "MyPlug", parameterLabels = {}, returnLabels = {"AnyName"},
            returnTypes = {String[].class}, userAccessible = true, help = "Method to calc anything..")

    @UITopiaVariant(affiliation = "Research Lab of ....", author = "...", email = "")
   
    public static String[] main(PluginContext context) {

        return method(input);

    }

..
..
private static String[] method(Input input) {..}    // this Method creates a String array, where the length depends on the input

************
************

When executing this, Prom creates a String[] Object but no output in the "View".

What configuratoin has to be changed to solve my problem? The output should be something like this.

Value 1:   String[0]
Value 2:   String[1]
.
.

Value n:   String[n]


Thank you in advance!
Michael



Answers

  • Dear Michael,

    You can do this by creating a specific visualizer for String[].

    There is ongoing work on working with arrays of objects in ProM but this is still in early testing.
    Joos Buijs

    Senior Data Scientist and process mining expert at APG (Dutch pension fund executor).
    Previously Assistant Professor in Process Mining at Eindhoven University of Technology
  • Thank you for your fast reply.

    I'll try this out.


    regards Michael
Sign In or Register to comment.