Home > Forum > Processes > Limited Task Assignment through AD Group

Limited Task Assignment through AD Group
0

Hello,

I struggle with this scenario:
1) An AD group of 8 purchasers gets the first task to approve an order.
2) One user approves the order for the first step.
3) Several steps later another purchase out of the group of 8 is meant to approve the order again.
But not the user having done the first approval (1).

My approach would be to get the first approver from the tasks table via SQL and make sure that he is not within the users for the second approval. So that this user would not receive a second task on that workflow instance.

Does that work or is there a better approach?

Can I use an SQL statement for the user assignment?

Any better suggestion?

Thanks for your answers in advance.

MVP

Hello Ingo,

Yes, you can use SQL to assign tasks, and your approach seems right.
What I think might be useful, is a query that returns users from AD group:

SELECT users.COS_BpsID
FROM [dbo].[CacheOrganizationStructure] as users
join [dbo].CacheOrganizationStructureGroupRelations as groupMebers
on users.COS_ID = groupMebers.COSGR_UserID
join [dbo].[CacheOrganizationStructure] as [group]
on groupMebers.COSGR_GroupID = [group].COS_ID
where [group].COS_DisplayName = '<Group name>' AND [users].COS_IsActive = 1 AND [users].COS_AccountType = 1

using this, you can exclude the user who ended task in the previous step and assign other step to the remaining users :)

MVP
In reply to: Ingo Doerrie

Hello Sebastian,

thank you for your reply. The query you sent helps, as my analysis has not developed so far.

Can you pass me another hint?

Question: Where do I find the user who has finished a specific step / task? I'd expect to find this within WFElements but that does not seem to be right.

Best regards, Ingo

You can find the tasks associated with an element in the WFElementTasks table:

SELECT *
FROM WFElementTasks
WHERE WFT_WFDID = <Element ID>

Also, a simple way may be to save the current user (who is finishing the task) in some technical field, which value you can then use to filter users instead of using WFElementTasks table.