workflow::case::fsm::get (public)

 workflow::case::fsm::get -case_id case_id -array array \
    [ -parent_enabled_action_id parent_enabled_action_id ] \
    [ -action_id action_id ] [ -enabled_action_id enabled_action_id ]

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

Get information about an FSM case set as values in your array. case_id state_short_name pretty_state state_hide_fields state_id parent_enabled_action_id parent_case_id entry_id top_case_id workflow_id object_id

Switches:
-case_id (required)
The ID of the case
-array (required)
The name of an array in which information will be returned.
-parent_enabled_action_id (optional)
If specified, will return the sub-case information for the given action.
-action_id (optional)
Deprecated. Same effect as enabled_action_id, but will not work for dynamic workflows.
-enabled_action_id (optional)
If specified, will return the case information as if the given action had already been executed. This is useful for presenting forms for actions that do not take place until the user hits OK.
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::bug::get bug_tracker::bug::get (public) workflow::case::fsm::get workflow::case::fsm::get bug_tracker::bug::get->workflow::case::fsm::get bug_tracker::scheduled::close_bugs bug_tracker::scheduled::close_bugs (public) bug_tracker::scheduled::close_bugs->workflow::case::fsm::get packages/bug-tracker/www/related-file-add.tcl packages/bug-tracker/ www/related-file-add.tcl packages/bug-tracker/www/related-file-add.tcl->workflow::case::fsm::get packages/bug-tracker/www/related-file-delete.tcl packages/bug-tracker/ www/related-file-delete.tcl packages/bug-tracker/www/related-file-delete.tcl->workflow::case::fsm::get packages/bug-tracker/www/related-file-update.tcl packages/bug-tracker/ www/related-file-update.tcl packages/bug-tracker/www/related-file-update.tcl->workflow::case::fsm::get db_1row db_1row (public) workflow::case::fsm::get->db_1row db_nextval db_nextval (public) workflow::case::fsm::get->db_nextval util_memoize util_memoize (public) workflow::case::fsm::get->util_memoize workflow::case::action::get_enabled_action_id workflow::case::action::get_enabled_action_id (private) workflow::case::fsm::get->workflow::case::action::get_enabled_action_id workflow::case::cache_timeout workflow::case::cache_timeout (private) workflow::case::fsm::get->workflow::case::cache_timeout

Testcases:
No testcase defined.
Source code:
    # Select the info into the upvar'ed Tcl Array
    upvar $array row

    if { $action_id ne "" } {
        if { $enabled_action_id ne "" } {
            error "You cannot specify both action_id and enabled_action_id. enabled_action_id is preferred."
        }
        set enabled_action_id [workflow::case::action::get_enabled_action_id  -case_id $case_id  -action_id $action_id  -any_parent]
    }

    if { $enabled_action_id eq "" } {
        array set row [util_memoize [list workflow::case::fsm::get_info_not_cached $case_id $parent_enabled_action_id]  [workflow::case::cache_timeout]]
        set row(entry_id) {}
    } else {
        # TODO: cache this query as well
        db_1row select_case_info_after_action {} -column_array row
        set row(entry_id) [db_nextval "acs_object_id_seq"]
    }
Generic XQL file:
<fullquery name="workflow::case::fsm::get.select_case_info_after_action">
    <querytext>
      select c.case_id,
             c.workflow_id,
             c.object_id,
             s.state_id,
             s.short_name as state_short_name,
             s.pretty_name as pretty_state,
             s.hide_fields as state_hide_fields
      from   workflow_cases c,
             workflow_case_fsm cfsm,
             workflow_fsm_states s,
             workflow_fsm_actions afsm,
             workflow_case_enabled_actions ena
      where  c.case_id = :case_id
      and    cfsm.case_id = c.case_id
      and    ((:parent_enabled_action_id is null and cfsm.parent_enabled_action_id is null) or (cfsm.parent_enabled_action_id = :parent_enabled_action_id))
      and    ena.enabled_action_id = :enabled_action_id
      and    afsm.action_id = ena.action_id
      and    ((afsm.new_state is null and s.state_id = cfsm.current_state)  or (s.state_id = afsm.new_state))
    </querytext>
</fullquery>
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: