workflow::case::action::get_enabled_action_id (private)

 workflow::case::action::get_enabled_action_id -case_id case_id \
    -action_id action_id \
    [ -parent_enabled_action_id parent_enabled_action_id ] [ -all ] \
    [ -any_parent ]

Defined in packages/workflow/tcl/case-procs.tcl

Get the enabled_action_id from case_id and action_id. Doesn't find completed enabled actions. Provided for backwards compatibility. Doesn't work properly for dynamic actions.

Switches:
-case_id
(required)
-action_id
(required)
-parent_enabled_action_id
(optional)
-all
(boolean) (optional)
If specified, will return all if more than one is found. Otherwise returns just the first.
-any_parent
(boolean) (optional)
Returns:
enabled_action_id. Returns blank if no enabled action exists.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/bug-tracker/www/bulk-update-op.tcl packages/bug-tracker/ www/bulk-update-op.tcl workflow::case::action::get_enabled_action_id workflow::case::action::get_enabled_action_id packages/bug-tracker/www/bulk-update-op.tcl->workflow::case::action::get_enabled_action_id workflow::case::action::available_p workflow::case::action::available_p (public) workflow::case::action::available_p->workflow::case::action::get_enabled_action_id workflow::case::action::execute workflow::case::action::execute (public) workflow::case::action::execute->workflow::case::action::get_enabled_action_id workflow::case::action::fsm::execute_state_change workflow::case::action::fsm::execute_state_change (private) workflow::case::action::fsm::execute_state_change->workflow::case::action::get_enabled_action_id workflow::case::action::permission_p workflow::case::action::permission_p (public) workflow::case::action::permission_p->workflow::case::action::get_enabled_action_id db_list db_list (public) workflow::case::action::get_enabled_action_id->db_list

Testcases:
No testcase defined.
Source code:
    if { $any_parent_p } {
        set result [db_list select_enabled_action_id {
            select enabled_action_id
            from   workflow_case_enabled_actions
            where  case_id = :case_id
            and    action_id = :action_id
            and    completed_p = 'f'
        }]
    } else {
        if { $parent_enabled_action_id eq "" } {
            set result [db_list select_enabled_action_id {
                select enabled_action_id
                from   workflow_case_enabled_actions
                where  case_id = :case_id
                and    action_id = :action_id
                and    completed_p = 'f'
                and    parent_enabled_action_id = :parent_enabled_action_id
            }]
        } else {
            set result [db_list select_enabled_action_id {
                select enabled_action_id
                from   workflow_case_enabled_actions
                where  case_id = :case_id
                and    action_id = :action_id
                and    completed_p = 'f'
                and    parent_enabled_action_id is null
            }]
        }
    }

    if { $all_p } {
        return $result
    } else {
        return [lindex $result 0]
    }
Generic XQL file:
packages/workflow/tcl/case-procs.xql

PostgreSQL XQL file:
packages/workflow/tcl/case-procs-postgresql.xql

Oracle XQL file:
packages/workflow/tcl/case-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: