32.11 DELETE_TASKS Procedure

This procedure removes human task instances for a given application. If p_include_workflow_tasks flag is not set, only those instances that are not created through a workflow will be deleted. If the p_include_workflow_tasks flag is true, all human task instances will be deleted.

This procedure should invoked with caution and only as a data clean-up measure.

Syntax

PROCEDURE apex_human_task.delete_tasks (
    p_application_id             IN   NUMBER               DEFAULT apex_application.g_flow_id,
    p_static_id                  IN   VARCHAR2             DEFAULT NULL,
    p_states                     IN   apex_t_varchar2      DEFAULT NULL,
    p_include_workflow_tasks     IN   BOOLEAN              DEFAULT FALSE );

Parameters

Parameter Description
p_application_id The application ID. Defaults to the currently running application.
p_static_id Static ID of the task definition. If omitted, the deletion applies to task instances for all task definitions in the application
p_states (Optional) State(s) of the task instances. If provided, only those task instances which belong to the specified state(s), will be deleted
p_include_workflow_tasks If true, those human task instances that are created through workflow will also be deleted. Default is false.

Example

The following example removes all Human Task instances for application 100 which are in Canceled or Errored state.

begin
  apex_human_task.delete_tasks(
    p_application_id         => 100,
    p_states                 => apex_t_varchar2(apex_human_task.c_task_state_cancelled, apex_human_task.c_task_state_errored),
    p_include_workflow_tasks => true);
end;