workflow::state::fsm::generate_spec (private)

 workflow::state::fsm::generate_spec [ -state_id state_id ] \
    [ -one_id one_id ] [ -handlers handlers ]

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

Generate the spec for an individual state definition.

Switches:
-state_id
(optional)
The id of the state to generate spec for.
-one_id
(optional)
Same as state_id, just used for consistency across roles/actions/states.
-handlers
(optional)
Returns:
spec The states spec
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::state::fsm::generate_states_spec workflow::state::fsm::generate_states_spec (private) workflow::state::fsm::generate_spec workflow::state::fsm::generate_spec workflow::state::fsm::generate_states_spec->workflow::state::fsm::generate_spec workflow::state::fsm::get workflow::state::fsm::get (public) workflow::state::fsm::generate_spec->workflow::state::fsm::get

Testcases:
No testcase defined.
Source code:
    if { $state_id eq "" } {
        if { $one_id eq "" } {
            error "You must supply either state_id or one_id"
        }
        set state_id $one_id
    } else {
        if { $one_id ne "" } {
            error "You can only supply either state_id or one_id"
        }
    }

    get -state_id $state_id -array row

    # Get rid of elements that shouldn't go into the spec
    array unset row short_name
    array unset row state_id
    array unset row workflow_id
    array unset row sort_order
    array unset row parent_action
    array unset row parent_action_id
    array unset row enabled_actions
    array unset row enabled_action_ids
    array unset row assigned_actions
    array unset row assigned_action_ids

    set spec {}
    foreach name [lsort [array names row]] {
        if { $row($name) ne "" } {
            lappend spec $name $row($name)
        }
    }

    return $spec
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/workflow/tcl/state-procs.xql

[ hide source ]
Show another procedure: