27.8 COMPLETE_TASK Procedure

This procedure completes a task with an outcome. Only the actual owner or a potential owner of the task can invoke this procedure.

Tasks in Assigned state might be completed with an outcome. This operation transitions the Task from Assigned state to Completed state and sets the outcome of the task. Once a Task is in Completed state, it is subject for purging and archival.

Syntax

APEX_HUMAN_TASK.COMPLETE_TASK (
    p_task_id                IN NUMBER,
    p_outcome                IN t_task_outcome DEFAULT NULL,
    p_autoclaim              IN BOOLEAN DEFAULT FALSE );

Parameters

Parameter Description
p_task_id The Task ID.
p_outcome The outcome of the Task for Approval Tasks.
p_autoclaim If Task is in state UNASSIGNED then claim the task implicitly.

State Handling

Pre-State: ASSIGNED|UNASSIGNED (p_autoclaim=true)

Post-State: COMPLETED

Example

BEGIN
    apex_human_task.complete_task(
        p_task_id => 1234,
        p_outcome => apex_human_task.c_task_outcome_approved
    );
END;