workflow::state::fsm::new (public)

 workflow::state::fsm::new -workflow_id workflow_id [ -internal ] \
    [ -short_name short_name ] -pretty_name pretty_name \
    [ -hide_fields hide_fields ] [ -sort_order sort_order ] \
    [ -parent_action parent_action ]

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

Creates a new state for a certain FSM (Finite State Machine) workflow.

Switches:
-workflow_id
(required)
The id of the FSM workflow to add the state to
-internal
(boolean) (optional)
Set this flag if you're calling this proc from within the corresponding proc for a particular workflow model. Will cause this proc to not flush the cache or call workflow::definition_changed_handler, which the caller must then do.
-short_name
(optional)
If you leave blank, the short_name will be generated from pretty_name.
-pretty_name
(required)
-hide_fields
(optional)
A space-separated list of the names of form fields which should be hidden when in this state, because they're irrelevant in a certain state.
-sort_order
(optional)
The number which this state should be in the sort ordering sequence. Leave blank to add state at the end. If you provide a sort_order number which already exists, existing states are pushed down one number.
-parent_action
(optional)
Which action with trigger_type 'workflow' does this state belong to.
Returns:
ID of new state.
Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::test::workflow_setup workflow::test::workflow_setup (public) workflow::state::fsm::new workflow::state::fsm::new workflow::test::workflow_setup->workflow::state::fsm::new workflow::state::fsm::edit workflow::state::fsm::edit (public) workflow::state::fsm::new->workflow::state::fsm::edit

Testcases:
No testcase defined.
Source code:
    # Wrapper for workflow::state::fsm::edit

    foreach elm { short_name pretty_name sort_order parent_action } {
        set row($elm) [set $elm]
    }

    set state_id [workflow::state::fsm::edit  -operation "insert"  -workflow_id $workflow_id  -array row]

    return $state_id
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="workflow::state::fsm::new.do_insert">
    <querytext>
        insert into workflow_fsm_states
                (state_id, workflow_id, sort_order, short_name, pretty_name, hide_fields)
         values (:state_id, :workflow_id, :sort_order, :short_name, :pretty_name, :hide_fields)
    </querytext>
</fullquery>
packages/workflow/tcl/state-procs.xql

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