Passing lists to Java actions and retrieving output
I've got a microflow which takes a list of objects and derives from it a second list of objects of the same type. It looks at a list of tasks (mainTaskMappings) which make up a job, and returns some further tasks (ancillaryTasks) which it thinks are also required. ArrayList<IMendixObject> ancillaryMappings = new ArrayList<IMendixObject>(); HashMap<String, Object> params = new HashMap<String, Object>(); params.put("InputJobObject", jobObject); params.put("mainTaskMappings", mainTaskMappings); params.put("ancillaryMappings", ancillaryMappings); Core.execute(context, "PipsAndSubbies.createAncillaryMappings", params); When I run that I get a RuntimeException: Unknown right predicate token. Firstly is it correct to pass an ArrayList of IMendixObjects to a microflow like this or must I use some API construct? Secondly, in this code I have passed to the microflow an object (ArrayList<imendixobject> ancillaryTasks), which initially is empty, in which the microflow will write the response, so that the Java can then iterate over the ArrayList after the call to Core.execute in order to process the additional tasks it identified. Is it possible to have the microflow construct the list and declare it as a return object - how would I retrieve the return object from the Java code?
The "Unknown right predicate token" error comes from an Xpath expression 'somewhere' in your microflow that the mxruntime can't evaluate. It has nothing to do with the way you're calling the microflow from java.
To answer your second question: Core.execute() returns an Object, you can type check this to see what it is (it will match whatever your microflow returned) and then cast it to do whatever you want.