I'm having to design a new flow which will require that multiple approvers, all with different category filter values, approve the WorkUnit at the same time.
What makes it even more interesting is the UserAction setting for the percentage of recipients taking the same action. We are setting primary and backup approvers and PFI calculates the number of users by how many could take action, not on how many approvals are required by category filter.
In other words, if you have 3 departments needing to approve the UserAction but you have 2 of these departments with a primary and backup approver, the system calculates that 5 users could take action so you have to base your percentage of recipients on that value.
Now as to how to dynamically set your UserAction to different approvers with different category filter values:
My flow will figure out all of the category filter values it needs to take into account (for example, multiple departments) with a Query and then update the oCatValue variable with a unique key value (see below) and then add that category filter value to each approver's User Task Category Definition prior to entering the UserAction.
After all required users have taken their action, this dynamic category filter value will be deleted from each approver.
A simple function to create a dynamic category filter value:
The following JavaScript creates a 12 digit number (milliseconds since 1/1/1970) and is unique per second.
// var d=new Date();
// oCatValue=d.getTime()