Question About Sub-Workflows With Associated Context Object

0
I am making a workflow for security-role access requests. Each user belongs to a department (where they work), and they might be requesting access roles to manage other departments. Each department can have multiple admins w/ approval power.   The way I have it set up is currently as follows:    - Request (top-level workflow request) - Roles which are being requested (1 to many) - (For each role): The Department(s) for which that role, for that person, will need access.    The very first step of the workflow, is that the entire request needs to be approved by the user's department admin (for the department they work for). For this, I can just pass the entire request and have 2 outcomes, approve or deny. On approval, it then needs to go to each department for approval.    What I'm struggling w/ is the best way to do this in a sub-workflow style. Currently, after the first approval, I am calling a microflow that iterates over each department and creates a new workflow using the related "RoleDepartment" object as the context that assigns the department's list of admins (any one of them can approve it, by department). This is annoying b/c it then creates a completely new workflow w/ its own start/end and statuses, and I can't use the overall outcomes to continue the whole request, because the parent request, at this point is marked completed right after I call the microflow that creates the sub-workflows.    Really what I need is the ability to "iterate" in the workflow and call a user task for each Department w/ it's own list of target users, but make the outcome of the whole workflow reliant on one of the admins of each department approving the request.    Hope that makes sense and someone can help me! Thanks in advance
asked
2 answers
0

Jordan,

Have you tried using a Multi-User task?  https://docs.mendix.com/refguide/multi-user-task/  You could assign target users with a microflow - pass in the context object and return a list of all of the department admins who need to approve the request.  Then you wouldn't need submicroflows and would be able to specify how the outcomes are handled from each of the people who complete the Multi-User task.

Hope that helps,

Mike

answered
0

Multi User Task has a decision method  "Microflow" In this microflow you can check which admin has completed the task and remove the other admins from the department from targeted users. In addition, add the logic how the decisions of all admins (1 per department) are evaluated into a final outcome.

answered