When the last active approver of a running approval task is deactivated or deleted, the task is reassigned to new approvers resolved by a configurable script (or to default approvers, when no script is configured or the script resolves nobody). A deactivated identity is kept as an approver for history (and is rendered grey on the frontend), a deleted identity's approver records are removed.
Whenever an identity transitions from an active to a disabled state (IdentityState.isDisabled()), all its running approval tasks (ApprovalTaskState.RUNNING) are checked. The disabled identity is kept as an approver (task lists render it grey), but when no active approver is left on the task, the task gets new approvers. Terminated tasks are not modified at all - their approvers are kept for history.
Every way an identity can become disabled is covered, because the trigger is the state transition itself, not the action that caused it:
An identity with more than one contract stays active (and stays an active approver) until its last valid contract ends.
If the task still has at least one active approver after the transition, nothing else happens - the task is not reassigned yet. Only when the deactivated approver was the last active one is the task reassigned.
When a deactivated approver is activated back, nothing is reassigned (the approvers added in the meantime stay) - the identity just becomes an active approver of its tasks again.
Identity delete already removes the identity's approver records (referential integrity, IdentityDeleteProcessor). A running task left without any active approver is then reassigned the same way as on deactivation.
idm.sec.core.wf.approval.task.reassign.script is evaluated (see below).idm.sec.core.role.substituteFallback). When the property is not set, the admin role is used (idm.sec.core.role.admin, `superAdminRole` by default). When even the fallback role has no valid holder, the task is assigned to the `admin` identity.The reassignment does not re-send new task notifications.
idm.sec.core.role.substituteFallback) is shared with the automatic role guarantor transfer feature - both use the same role for resolving substitutes of a deleted or deactivated identity. In environments with many admin role holders, configure a small dedicated role to keep the approver (and guarantor) lists short.
| Property | Default value | Description |
|---|---|---|
idm.sec.core.wf.approval.task.reassign.script | Code of the script that is used to resolve new approvers. | |
idm.sec.core.role.substituteFallback | admin role | Role whose valid holders are used as default approvers (and as substitutes for the role guarantor transfer), when the script resolves nobody. |
The feature has no enable/disable switch - the configuration is not public and the behavior is always active.
The reassignment scripts are of category SYSTEM and can use the input parameters approvalTask - the task that just ran out of active approvers - and lastApprover - the approver that was just deactivated or deleted (can be null).
The script must return either IdmIdentityDto or List<IdmIdentityDto>. Returning null, empty lists or throwing an exception will assign the task to the default approvers (see `getDefaultApprovers()` in DefaultIdmApprovalTaskApproverService).
The product provides three prewritten system scripts to resolve new approvers.
| Script code | Description |
|---|---|
| `approvalTaskReassignToIdentity` | Reassigns the task to a single identity with a hardcoded username. |
| `approvalTaskReassignToRole` | Reassigns the task to all valid identities with a hardcoded role assigned. |
| `approvalTaskReassignToLastApproverManager` | Reassigns the task to managers of the last approver (found by the last approver's contracts - contract guarantees or managers by tree structure). Falls back to the default approvers when the last approver has no manager. |
A warning about possible task reassignment is shown:
Localization key of the warning: `content.identities.action.deactivate.taskReassignWarning`.
Deactivated approvers are rendered grey in the task lists and the approvers dialog of a task shows deactivated approvers too.
IdentityDisableReassignApprovalTasksProcessor (core-impl) - reacts to both disabled state transitions of an identity (identity `UPDATE` event, order `+10`). On deactivation it reassigns running tasks left without an active approver via reassignWhenNoActiveApproverLeft. The processor is not disableable (isDisableable() returns `false`).IdentityDeleteProcessor (core-impl, pre-existing) - calls deleteWithAnyApproverLeftCheck for the deleted identity's approver records.IdentityDisableBulkAction.prevalidate() - returns the frontend warning (CoreResultCode.IDENTITY\_DISABLE\_BULK\_ACTION\_TASK\_REASSIGN).modified timestamp of the task (a single update statement, see IdmApprovalTaskRepository.touchTask). The frontend entity cache renders a newly fetched entity only when its modified changed - approver changes would not show up on already loaded tasks otherwise. Terminated tasks are never touched.