Based on the user roles, we would be fetching the set of approvers from the DB that needs to be assigned to the approval request task. I have explored two approaches to achieve this:
1. Using Task Rules
There is no way I can have dynamic assignment in Task Rules. However, I can create different task rules associated with different users / groups and can trigger them based on certain conditions. Considering the volume of the users and dynamics, this is not a feasible solution.
2. Doing Dynamic Assignment Within The Process
There is no way the Approval Request Task takes the list of assignees as an input. Either I need to manually assign users to the task or insert reference of an Identity variable. I'm able to resolve the User based on it's Distinguished Name using Resolve Email Address activity. However, when I try inserting its identity reference, I'm getting the following error:
Unable to fully resolve expression, as Reference to Property ResolvedDefinition.Identity of ActivityInstance 2fd79e29-e36a-49cd-9a87-da0f2922d005. could not be resolved.
I tried doing the dynamic allocation by setting an Identity variable, but got the same exception. Please find attached screenshot for your kind reference. Can you please share your inputs on how we can achieve this?
Under #1 if you just care about the email you can use a notify task rule and set a group or list serv to notify.
If assignment is what you really care about then yes, task rules is not the proper place.
So if you have a set of approvers, fetch it from the DB, then create your approval request, make sure to uncheck wait for the activity to complete. (on assignment tab). Then for-each through your table and update the approval request with each rows ID variable. Then use a wait for task to enter state activity to wait for the approval request to finish. I was able to do this in about 5 minutes on one of my support servers.
The harder part you may run into is getting a database output in string format to be an ID or Active Directory based variable. That might require an ENH, as I do not believe that currently exists.
As previously mentioned, this is *NOT* a place to post things of this nature if you are in a rush or need help quickly.
The difference here is I read directly from a table.
I have had a similar setup before in the SRD I developed for TAC support in reading a user from a database and them assigning them to a task.
What I did (since TEO has *no* way to convert string to ID variable) is to make a table of those IDs that I expect to use, and then match whatever I pull from the DB to the ID variable's string. Each ID variable has a sub string property exposed.