I might be misunderstanding it, but why not just one microflow that can be called by both roles and then in the microflow check the user role of the current user and based on that call the different subflows? Or am I missing the problem here?
Regards,
Ronald
I ended up using a custom Java Action
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.
package srv_eservice.actions;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import com.mendix.core.Core;
import com.mendix.core.actionmanagement.MicroflowCallBuilder;
import com.mendix.logging.ILogNode;
public class JA_CallMicroflowWithoutUserRole extends CustomJavaAction<java.lang.Void>
{
private final java.lang.String Microflow;
private final IMendixObject Parameter;
private final java.lang.String ParameterName;
public JA_CallMicroflowWithoutUserRole(
IContext context,
java.lang.String _microflow,
IMendixObject _parameter,
java.lang.String _parameterName
)
{
super(context);
this.Microflow = _microflow;
this.Parameter = _parameter;
this.ParameterName = _parameterName;
}
@java.lang.Override
public java.lang.Void executeAction() throws Exception
{
// BEGIN USER CODE
if (this.Microflow == null || this.Microflow.isEmpty()) {
throw new IllegalArgumentException("Microflow name cannot be null or empty.");
}
Core.getLogger("Dashboard").info("Microflow: " + this.Microflow);
if (this.Parameter != null) {
String ApplicationNumber = (String) this.Parameter.getValue(this.getContext(), "ApplicationNumber");
}
if (this.Parameter != null && this.ParameterName != null) {
com.mendix.core.Core.microflowCall(this.Microflow)
.inTransaction(true)
.withParam(this.ParameterName, this.Parameter)
.execute(this.getContext());
return null;
}
com.mendix.core.Core.microflowCall(this.Microflow)
.inTransaction(true)
.execute(this.getContext());
return null;
// END USER CODE
}
/**
* Returns a string representation of this action
* @return a string representation of this action
*/
@java.lang.Override
public java.lang.String toString()
{
return "JA_CallMicroflowWithoutUserRole";
}
// BEGIN EXTRA CODE
// END EXTRA CODE
}