Hi Enzo,
Chris recommended the ModelReflection module because it does exactly what I describe in number 2 above. I've created a simple module that you can download, import, and try yourself. It contains a java action and one page. Add the page to your project navigation menu and give it a try.
For reference, the java action code is:
List<IMendixObject> microflowObjs = new ArrayList<IMendixObject>();
IMendixObject obj;
for(String microflowName: Core.getMicroflowNames())
{
obj = Core.instantiate(getContext(), "SimpleModelReflection.MxMicroflow");
obj.setValue(getContext(), "CompleteName", microflowName);
microflowObjs.add( obj );
}
return microflowObjs;
Hope that helps!
Looking at your question number one: if you do not know or understand the way functions are defined in Java (including their input parameters and output type) you should really do some research first, e.g. by looking at: the first Google hit for 'Java function definition'
To answer your question number two: Core.getMicroflowNames() returns a set of strings. You can iterate over the set, and for each element create a Mendix object, set an attribute on the object with the microflow name, add the object to a list and return the list. Alternatively, if this sounds rather complex, you can use the model reflection, like Chris suggested, and retrieve the microflow names from the database. Model reflection also contains the code the map microflows, and this code can be found in /javasource/mxmodelreflection/metamodelBuilder/MicroflowBuilder.java
See appstore module modelreflection