How to dynamic assign User Task role based on the Requesters User Role in Workflow?

0
Hi all,I am working on a Mendix Workflow and trying to implement the following logic: "Dynamically assign the first User Task to a specific User Role based on the Requester's (Form Creator) own User Role."For example:If the Requester's role is Operator -> First approval task goes to QC Staff.If the Requester's role is MA Staff -> First approval task goes to MA Manager.In my domain model, the main entity (MaterialInspectionForm) stores the creator via System.owner (or an association to Administration.Account).What is the best way to achieve this?Should I use a Decision node with a Microflow before the User Task? If so, how can I check the owner's role inside the Microflow? Or is there a way to configure this directly in the User Task's Target Users (Task Strategy)?Any advice or screenshots of a similar microflow would be highly appreciated! Thank you.
asked
1 answers
0

Hi Winnie,


I would recommend using a Decision activity before the User Task.


In the microflow, retrieve the requester's System.UserRoles (either from System.owner or your associated Administration.Account) and check which role the user belongs to. Based on that, route the workflow to the appropriate User Task or assign the corresponding User Role.


For example:

  • Operator → QC Staff
  • MA Staff → MA Manager


As far as I know, there isn't a built-in way to dynamically map one user role to another directly in the User Task configuration. Using a Decision (or microflow) keeps the logic clear and easy to maintain.


Kindly mark this as the accepted answer if it helps.

answered