55.8 GET_WORKFLOWS Function

This function gets the workflows of a user depending on the given context. Context can be MY_WORKFLOWS, ADMIN_WORKFLOWS, or SINGLE_WORKFLOW.

Note:

The function only returns data in the context of a valid Oracle APEX session. It returns no data in SQL Workshop.

Syntax

APEX_WORKFLOW.GET_WORKFLOWS (
    p_context            IN VARCHAR2 DEFAULT 
                                   wwv_flow_workflow_api.c_context_my_workflows,
    p_user               IN VARCHAR2 DEFAULT wwv_flow_security.g_user,
    p_workflow_id        IN NUMBER   DEFAULT NULL,
    p_application_id     IN NUMBER   DEFAULT NULL )
RETURN wwv_flow_t_workflow_instances pipelined;

Parameters

Parameter Description
p_context The list context. Default is MY_WORKFLOWS.
p_user The user to check for. Default is logged-in user. Needs p_context set to MY_WORKFLOWS, ADMIN_WORKFLOWS or INITIATED_BY_ME.
p_workflow_id Filter for a workflow ID instead of a user. Default is NULL. Needs p_context set to SINGLE_WORKFLOW.
p_application_id Filter for an application. Default is NULL (all applications).

Returns

A table of workflows (type apex_t_workflow_instances) containing the following columns:

  • badge_css_classes varchar2(255)
  • badge_state varchar2(255)
  • badge_text varchar2(255)
  • created_ago varchar2(255)
  • created_ago_hours number
  • created_by varchar2(255)
  • created_on timestamp with time zone
  • end_time timestamp with time zone
  • initiator varchar2(255)
  • initiator_lower varchar2(255)
  • is_completed varchar2(1)
  • is_dev_mode varchar2(1)
  • is_terminated varchar2(1)
  • last_updated_by varchar2(255)
  • last_updated_on timestamp with time zone
  • start_time timestamp with time zone
  • state varchar2(255)
  • state_code varchar2(32)
  • title varchar2(4000)
  • workflow_def_app_id number
  • workflow_def_app_name varchar2(255)
  • workflow_def_id number
  • workflow_def_name varchar2(255)
  • workflow_def_static_id varchar2(255)
  • workflow_id number
  • workflow_version varchar2(255)
  • workflow_version_id number

Example

select *
  from table ( apex_workflow.get_workflows ( 
                   p_context => 'MY_WORKFLOWS' ) )