Pass microflows as parameters to other microflows - Mendix Forum

Pass microflows as parameters to other microflows


It would be great to be able to pass a microflow as a parameter to another microflow and then be able to call that microflow.

Most other languages support anonymous / lambda functions and callbacks it would be great to see this added to Mendix as well.

It would make it easier to reuse code. 

4 answers

It should actually be possible using a workaround. A Java action can take one or more Microflows as parameter. If you use this Java action to simply Core.execute the passed microflow name with the microflow parameter, you can invoke your Java action with the desired microflow-as-parameter.


We find it an issue when we try to reuse modules across different projects. We get round it, but it just feels it would be a lot easier if we could just pass in a microflow so we can keep the code leaner and cleaner.


Can't you use the MxModel Reflection module to achieve this (in the mean time)?


You have my vote sir.

But I need to ask a question as well. Out of all the language constructs traditional programming languages have available, how high is this on your list of things you miss in Mendix?