Ignore User Role in microflow

0
I have a snippet that contains a list view (which is in a deferent module than the rest of the logic and has a general UserRole), on clicking the list view item I want to call the main microflow that will direct me to 1 of 2 other sub microflows (based on UserRole) to show a review page, I have 2 user roles that can use the Main Microflow, but there's no entity access for 1st UserRole in the 2nd mf and vise versa, is there a way to call the sub microflows without it seeing the UserRoles that was used to go into the main one just the one that will be going to that sub microflow?
asked
2 answers
0

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

 

answered
0

I ended up creating a Java action that directs the user to the sub microflows, that way the user can be in the same transaction and yet entity access reapplies after they are already in the sub microflows. 

// BEGIN USER CODE

if (this.Microflow == null || this.Microflow.isEmpty()) {

throw new IllegalArgumentException("Microflow name cannot be null or empty.");

}

if (this.__ContextObject == null) {

throw new IllegalArgumentException("Context object cannot be null.");

}



Core.microflowCall(this.Microflow)

.inTransaction(true) 

.withParam("ContextObject", this.__ContextObject) 

.execute(this.getContext());



return null; 

// END USER CODE

 

answered