parameterIsList, what if I want to pass a list with just one object in it ?

5
My javascript: if (microflow !== '') { mx.processor.xasAction({ actionname : microflow, guids : this.mxGUIDs, applyto : 'selection', callback : function () {} }); } I have an array of GUIDs (which can have a length of 1 - N), now when I have mulitple elements I setup my xml as follows: <property key='microflow' type='microflow' parameterIsList='true' required='false' entityProperty='entity'> This works as expected, I get a list of my entity. When I have a single GUID this parameter doesn't get passed to my microflow, should I have two seperate microflows, one which has parameterIsList='false' and another for parameterIsList='true' ? It looks like a list with a single element doesn't get passed as a parameter when parameterIsList='true'... I would like to work with lists of any size, not just lists which has more than 1 element. Should I do a feature request for this, or am I doing something wrong ?
asked
2 answers
4

No, thats a bug indeed. I know two workarounds for this:

  • Use two different microflows (as you suggested)
  • Create a microflow with two arguments, the first an object of X, the second a list of X. One of them will be filled when invoking the microflow. But in that case you can't select the microflow in the modeler and have to define the microflow using a string property. So the first option might be a tiny small bit more user friendly.

(Note, I filed this bug already under #9116)

answered
0

Hallo,

sorry to open again this very old discussion. I recently encountered exactly the same problem. I am using Mx 7.11

I need to pass to a microflow a list of non-persistent objects that could possibly contain only one object; but if that the case the list is not passed to the microflow. The only workaround that I found was to add a second object that does not contain any information, and just through it away as first action in my microflow, but that solution is far to be clean 

Does anyone know if currently there is a better solution to solve this problem?

answered