DBQueue blocked : Complete recalculation of all assignments of identity to roles

Hello,

I have a process that starts when a person is assigned an HR role.
The process is triggered by an Insert event on PersonInOrg.

This process contains the following steps:

1- Check whether the person has an HR contract using a ScriptComponent.

2- If yes, update some data in the Person table using a ScriptComponent.

3- Check whether the person has an active AD account in Active Directory using a ScriptComponent (ScriptExec).
In the properties of this step, I set “DBQueue does not wait” = true and “Wait on error” so that the step retries and waits until the AD account is provisioned.

This script launches a PowerShell session (with username + password) on AD and checks whether the AD account exists and is active.

Etc…

The Insert event should also, in parallel, trigger the creation/activation of the AD account through PersonHasTSBAccountDef, etc., but it does not.

In fact, the DBQueue is blocked at step 3 (because the step returns an error = “AD account not active”), and I see in the DBQueue a task marked “To process”:

Complete recalculation of all assignments of identity to roles (identity management base)

This task blocks for 10 to 15 minutes.


After that, the processes for creating/reactivating the AD account (and others) start — but too late for step 3 of my process to succeed, so the whole process cannot continue…

Any idea what could be causing this problem?

Thanks in advance.