63.4 DELETE_WORKFLOWS Procedure

This procedure removes workflow instances for a given application.

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

Syntax

PROCEDURE apex_workflow.delete_workflows (
    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_all_versions   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 workflow. If omitted, the deletion applies to all workflows in the application
p_states (Optional) State(s) of the workflow instances. If provided, only those workflow instances which belong to the specified state(s), will be deleted
p_include_all_versions If false, only instances created from Inactive workflow versions will be deleted . Default is false.

Example

The following example removes all workflow instances for application 100 which are in Faulted or Terminated state.

begin
  apex_workflow.delete_workflows(
    p_application_id       => 100,
    p_states               => apex_t_varchar2(apex_workflow.c_state_faulted, apex_workflow.c_state_terminated),
    p_include_all_versions => true);
end;