workflow::action::new (public)

 workflow::action::new -workflow_id workflow_id \
    [ -action_id action_id ] [ -sort_order sort_order ] \
    [ -short_name short_name ] -pretty_name pretty_name \
    [ -pretty_past_tense pretty_past_tense ] \
    [ -edit_fields edit_fields ] [ -assigned_role assigned_role ] \
    [ -allowed_roles allowed_roles ] [ -privileges privileges ] \
    [ -callbacks callbacks ] [ -always_enabled_p always_enabled_p ] \
    [ -initial_action_p initial_action_p ] \
    [ -trigger_type trigger_type ] [ -parent_action parent_action ] \
    [ -description description ] \
    [ -description_mime_type description_mime_type ] \
    [ -timeout_seconds timeout_seconds ] [ -internal ]

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

This procedure is normally not invoked from application code. Instead a procedure for a certain workflow implementation, such as for example workflow::action::fsm::new (for Finite State Machine workflows), is used.

Switches:
-workflow_id
(required)
The id of the FSM workflow to add the action to
-action_id
(optional)
Optionally specify the ID of the new action.
-sort_order
(optional)
The number which this action should be in the sort ordering sequence. Leave blank to add action at the end. If you provide a sort_order number which already exists, existing actions are pushed down one number.
-short_name
(optional)
Short name of the action for use in source code. Should be on Tcl variable syntax.
-pretty_name
(required)
Human readable name of the action for use in UI.
-pretty_past_tense
(optional)
Past tense of pretty name
-edit_fields
(optional)
A space-separated list of the names of form fields which should be opened for editing when this action is carried out.
-assigned_role
(optional)
The short_name of an assigned role. Users in this role are expected (obliged) to take the action.
-allowed_roles
(optional)
A list of role short_names or IDs. Users in these roles are allowed to take the action.
-privileges
(optional)
Users with these privileges on the object treated by the workflow (i.e. a bug in the Bug Tracker) will be allowed to take this action.
-callbacks
(optional)
List of names of service contract implementations of callbacks for the action in impl_owner_name.impl_name format.
-always_enabled_p
(defaults to "f") (optional)
-initial_action_p
(optional)
Deprecated. Use this switch to indicate that this is the initial action that will fire whenever a case of the workflow is created. The initial action is used to determine the initial state of the worklow as well as any procedures that should be executed when the case created.
-trigger_type
(defaults to "user") (optional)
user, auto, message, time, init, workflow, parallel, dynamic.
-parent_action
(optional)
Short_name of the action's parent action.
-description
(optional)
-description_mime_type
(optional)
-timeout_seconds
(optional)
If zero, the action will automatically fire whenever it becomes enabled. If greater than zero, the action will automatically fire x number of seconds after the action is enabled. If empty, will never fire automatically.
-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.
Returns:
The id of the created action
Author:
Peter Marklund
See Also:

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

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

    array set row [list]
    foreach col {
        initial_action_p sort_order short_name pretty_name
        pretty_past_tense edit_fields allowed_roles assigned_role
        privileges callbacks always_enabled_p description description_mime_type
        timeout_seconds trigger_type parent_action
    } {
        if { [info exists $col] } {
            set row($col) [set $col]
        }
    }

    set action_id [workflow::action::edit  -operation "insert"  -action_id $action_id  -workflow_id $workflow_id  -array row]

    return $action_id
Generic XQL file:
packages/workflow/tcl/action-procs.xql

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

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

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