- Publicity: Public Only All
workflow-procs.tcl
Procedures in the workflow namespace.
- Location:
- packages/workflow/tcl/workflow-procs.tcl
- Created:
- 8 January 2003
- Authors:
- Lars Pind <lars@collaboraid.biz>
- Peter Marklund <peter@collaboraid.biz>
- CVS Identification:
$Id: workflow-procs.tcl,v 1.36 2019/02/12 18:45:14 hectorr Exp $
Procedures in this file
- workflow::cache_timeout (private)
- workflow::callback_insert (private)
- workflow::clone (public)
- workflow::default_sort_order (private)
- workflow::definition_changed_handler (public)
- workflow::delete (public)
- workflow::edit (public)
- workflow::exists_p (public)
- workflow::flush_cache (private)
- workflow::fsm::clone (public)
- workflow::fsm::edit (public)
- workflow::fsm::generate_spec (public)
- workflow::fsm::get_initial_state (public)
- workflow::fsm::get_states (public)
- workflow::fsm::new_from_spec (public)
- workflow::generate_short_name (public)
- workflow::generate_spec (public)
- workflow::get (public)
- workflow::get_actions (public)
- workflow::get_callbacks (private)
- workflow::get_element (public)
- workflow::get_existing_short_names (public)
- workflow::get_id (public)
- workflow::get_id_not_cached (private)
- workflow::get_not_cached (private)
- workflow::get_notification_links (public)
- workflow::get_roles (public)
- workflow::new (public)
- workflow::new_from_spec (public)
- workflow::parse_spec (private)
- workflow::service_contract::action_side_effect (public)
- workflow::service_contract::activity_log_format_title (public)
- workflow::service_contract::get_impl_id (public)
- workflow::service_contract::notification_info (public)
- workflow::service_contract::role_assignee_pick_list (public)
- workflow::service_contract::role_assignee_subquery (public)
- workflow::service_contract::role_default_assignees (public)
Detailed information
workflow::cache_timeout (private)
workflow::cache_timeout
Returns the timeout to give to util_memoize (max_age parameter) for all workflow level data. Should probably be an APM parameter.
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::callback_insert (private)
workflow::callback_insert -workflow_id workflow_id -name name \ [ -sort_order sort_order ]
Add a side-effect to a workflow.
- Switches:
- -workflow_id (required)
- The ID of the workflow.
- -name (required)
- Name of service contract implementation, in the form (impl_owner_name).(impl_name), for example, bug-tracker.FormatLogTitle.
- -sort_order (optional)
- The sort_order for the rule. Leave blank to add to the end of the list
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::clone (public)
workflow::clone -workflow_id workflow_id [ -package_key package_key ] \ [ -object_id object_id ] [ -array array ] \ [ -workflow_handler workflow_handler ]
Clones an existing FSM workflow. The clone must belong to either a package key or an object id.
- Switches:
- -workflow_id (required)
- -package_key (optional)
- A package to which this workflow belongs
- -object_id (optional)
- The id of an ACS Object indicating the scope the workflow. Typically this will be the id of a package type or a package instance but it could also be some other type of ACS object within a package, for example the id of a bug in the Bug Tracker application.
- -array (optional)
- The name of an array in the caller's namespace. Values in this array will override workflow attributes of the workflow being cloned.
- -workflow_handler (optional, defaults to
"workflow"
)- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::default_sort_order (private)
workflow::default_sort_order -workflow_id workflow_id \ -table_name table_name
By default the sort_order will be the highest current sort order plus 1. This reflects the order in which states and actions are added to the workflow starting with 1
- Switches:
- -workflow_id (required)
- -table_name (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::definition_changed_handler (public)
workflow::definition_changed_handler -workflow_id workflow_id
Should be called when the workflow definition has changed while there are active cases. Will update the record of enabled actions in each of the case, so they reflect the new workflow.
- Switches:
- -workflow_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::delete (public)
workflow::delete -workflow_id workflow_id
Delete a generic workflow and all data attached to it (states, actions etc.).
- Switches:
- -workflow_id (required)
- The id of the workflow to delete.
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::edit (public)
workflow::edit [ -operation operation ] [ -workflow_id workflow_id ] \ [ -array array ] [ -internal ] [ -no_complain ]
Edit a workflow. Attributes of the array are:
- short_name
- pretty_name
- object_id
- package_key
- object_type
- description
- description_mime_type
- callbacks
- context_id
- creation_user
- creation_ip
- Switches:
- -operation (optional, defaults to
"update"
)- insert, update, delete
- -workflow_id (optional)
- For update/delete: The workflow to update or delete.
- -array (optional)
- For insert/update: Name of an array in the caller's namespace with attributes to insert/update.
- -internal (optional, boolean)
- 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.
- -no_complain (optional, boolean)
- Silently ignore extra attributes that we don't know how to handle.
- Returns:
- workflow_id
- Authors:
- Peter Marklund
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::exists_p (public)
workflow::exists_p -workflow_id workflow_id
Return 1 if the workflow with given id exists and 0 otherwise. This proc is currently not cached.
- Switches:
- -workflow_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::flush_cache (private)
workflow::flush_cache -workflow_id workflow_id
Flush all cached data related to the given workflow instance.
- Switches:
- -workflow_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::clone (public)
workflow::fsm::clone -workflow_id workflow_id \ [ -package_key package_key ] [ -object_id object_id ] \ [ -array array ]
Clones an existing FSM workflow. The clone must belong to either a package key or an object id.
- Switches:
- -workflow_id (required)
- -package_key (optional)
- A package to which this workflow belongs
- -object_id (optional)
- The id of an ACS Object indicating the scope the workflow. Typically this will be the id of a package type or a package instance but it could also be some other type of ACS object within a package, for example the id of a bug in the Bug Tracker application.
- -array (optional)
- The name of an array in the caller's namespace. Values in this array will override workflow attributes of the workflow being cloned.
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::edit (public)
workflow::fsm::edit [ -operation operation ] \ [ -workflow_id workflow_id ] [ -array array ] [ -internal ]
- Switches:
- -operation (optional, defaults to
"update"
)- -workflow_id (optional)
- -array (optional)
- -internal (optional, boolean)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::generate_spec (public)
workflow::fsm::generate_spec -workflow_id workflow_id \ [ -workflow_handler workflow_handler ] [ -handlers handlers ]
Generate a spec for a workflow in array list style.
- Switches:
- -workflow_id (required)
- The id of the workflow to generate a spec for.
- -workflow_handler (optional, defaults to
"workflow"
)- -handlers (optional, defaults to
" roles workflow::role actions workflow::action::fsm states workflow::state::fsm "
)- Returns:
- The spec for the workflow.
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::get_initial_state (public)
workflow::fsm::get_initial_state -workflow_id workflow_id
Get the id of the state that a workflow case is in once it's started (after the initial action is fired).
- Switches:
- -workflow_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::get_states (public)
workflow::fsm::get_states [ -all ] -workflow_id workflow_id \ [ -parent_action_id parent_action_id ]
Get the state_id's of all the states in the workflow.
- Switches:
- -all (optional, boolean)
- -workflow_id (required)
- The ID of the workflow
- -parent_action_id (optional)
- Returns:
- list of state_id's.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::fsm::new_from_spec (public)
workflow::fsm::new_from_spec [ -package_key package_key ] \ [ -object_id object_id ] -spec spec [ -array array ] \ [ -workflow_handler workflow_handler ] [ -handlers handlers ]
Create a new workflow from spec. Workflows must belong to either a package key or an object id.
- Switches:
- -package_key (optional)
- A package to which this workflow belongs
- -object_id (optional)
- The id of an ACS Object indicating the scope the workflow. Typically this will be the id of a package type or a package instance but it could also be some other type of ACS object within a package, for example the id of a bug in the Bug Tracker application.
- -spec (required)
- The workflow spec
- -array (optional)
- The name of an array in the caller's namespace. Values in this array will override workflow attributes of the workflow being cloned.
- -workflow_handler (optional)
- -handlers (optional)
- Returns:
- The ID of the workflow created
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::generate_short_name (public)
workflow::generate_short_name -package_key package_key \ [ -object_id object_id ] -pretty_name pretty_name \ [ -short_name short_name ] [ -workflow_id workflow_id ]
Generate a unique short_name from pretty_name, or verify uniqueness of a given short_name.
- Switches:
- -package_key (required)
- -object_id (optional)
- -pretty_name (required)
- -short_name (optional)
- Suggested short_name.
- -workflow_id (optional)
- If you pass in this, we will allow that workflow's short_name to be reused.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::generate_spec (public)
workflow::generate_spec -workflow_id workflow_id \ [ -workflow_handler workflow_handler ] [ -handlers handlers ]
Generate a spec for a workflow in array list style. Note that calling this directly with the default arguments will bomb, because workflow::action doesn't implement the required API.
- Switches:
- -workflow_id (required)
- The id of the workflow to generate a spec for.
- -workflow_handler (optional, defaults to
"workflow"
)- -handlers (optional, defaults to
" roles workflow::role actions workflow::action "
)- An array-list with Tcl namespaces where handlers for various elements are defined. The keys are identical to the keys in the spec, and the namespaces are where the procs to handle them are defined.
- Returns:
- The spec for the workflow.
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get (public)
workflow::get -workflow_id workflow_id -array array
Return information about a workflow. Uses util_memoize to cache values from the database.
- Switches:
- -workflow_id (required)
- ID of workflow
- -array (required)
- name of array in which the info will be returned
- Returns:
- An array list with keys workflow_id, short_name, pretty_name, object_id, package_key, object_type, and callbacks.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_actions (public)
workflow::get_actions [ -all ] -workflow_id workflow_id \ [ -parent_action_id parent_action_id ]
Get the action_id's of all the actions in the workflow.
- Switches:
- -all (optional, boolean)
- -workflow_id (required)
- The ID of the workflow
- -parent_action_id (optional)
- Returns:
- list of action_id's.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_callbacks (private)
workflow::get_callbacks -workflow_id workflow_id \ -contract_name contract_name
Return the implementation names for a certain contract and a given workflow.
- Switches:
- -workflow_id (required)
- -contract_name (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_element (public)
workflow::get_element -workflow_id workflow_id -element element
Return a single element from the information about a workflow.
- Switches:
- -workflow_id (required)
- The ID of the workflow
- -element (required)
- Returns:
- The element you asked for
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_existing_short_names (public)
workflow::get_existing_short_names -package_key package_key \ [ -object_id object_id ] \ [ -ignore_workflow_id ignore_workflow_id ]
Returns a list of existing workflow short_names for this package_key and object_id. Useful when you're trying to ensure a short_name is unique, or construct a new short_name that is guaranteed to be unique.
- Switches:
- -package_key (required)
- -object_id (optional)
- -ignore_workflow_id (optional)
- If specified, the short_name for the given workflow will not be included in the result set.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_id (public)
workflow::get_id [ -package_key package_key ] [ -object_id object_id ] \ -short_name short_name
Get workflow_id by short_name and object_id. Provide either package_key or object_id.
- Switches:
- -package_key (optional)
- The key of the package workflow belongs to.
- -object_id (optional)
- The ID of the object the workflow's for (typically a package instance)
- -short_name (required)
- the short name of the workflow you want
- Returns:
- The id of the workflow or the empty string if no workflow was found.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_id_not_cached (private)
workflow::get_id_not_cached [ -package_key package_key ] \ [ -object_id object_id ] -short_name short_name
Private proc not to be used by applications, use workflow::get_id instead.
- Switches:
- -package_key (optional)
- -object_id (optional)
- -short_name (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_not_cached (private)
workflow::get_not_cached -workflow_id workflow_id
Private procedure that should never be used by application code - use workflow::get instead. Returns info about the workflow in an array list. Always goes to the database.
- Switches:
- -workflow_id (required)
- Author:
- Peter Marklund
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_notification_links (public)
workflow::get_notification_links -workflow_id workflow_id \ [ -case_id case_id ] [ -return_url return_url ]
Return a links to sign up for notifications.
- Switches:
- -workflow_id (required)
- -case_id (optional)
- -return_url (optional)
- Returns:
- A multirow with columns url, label, title
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::get_roles (public)
workflow::get_roles [ -all ] -workflow_id workflow_id \ [ -parent_action_id parent_action_id ]
Get the role_id's of all the roles in the workflow.
- Switches:
- -all (optional, boolean)
- -workflow_id (required)
- The ID of the workflow
- -parent_action_id (optional)
- Returns:
- list of role_id's.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::new (public)
workflow::new -pretty_name pretty_name [ -short_name short_name ] \ -package_key package_key [ -object_id object_id ] \ [ -object_type object_type ] [ -callbacks callbacks ]
Creates a new workflow. For each workflow you must create an initial action (using the workflow::action::new proc) to be fired when a workflow case is opened.
- Switches:
- -pretty_name (required)
- A human readable name for the workflow for use in the UI.
- -short_name (optional)
- For referring to the workflow from Tcl code. Use Tcl variable syntax.
- -package_key (required)
- The package to which this workflow belongs
- -object_id (optional)
- The id of an ACS Object indicating the scope the workflow. Typically this will be the id of a package type or a package instance but it could also be some other type of ACS object within a package, for example the id of a bug in the Bug Tracker application.
- -object_type (optional, defaults to
"acs_object"
)- The type of objects that the workflow will be applied to. Valid values are in the acs_object_types table. The parameter is optional and defaults to acs_object.
- -callbacks (optional)
- List of names of service contract implementations of callbacks for the workflow in impl_owner_name.impl_name format.
- Returns:
- New workflow_id.
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::new_from_spec (public)
workflow::new_from_spec [ -package_key package_key ] \ [ -object_id object_id ] -spec spec [ -array array ] \ [ -workflow_handler workflow_handler ] [ -handlers handlers ]
Create a new workflow from spec. Workflows must belong to either a package key or an object id.
- Switches:
- -package_key (optional)
- A package to which this workflow belongs
- -object_id (optional)
- The id of an ACS Object indicating the scope the workflow. Typically this will be the id of a package type or a package instance but it could also be some other type of ACS object within a package, for example the id of a bug in the Bug Tracker application.
- -spec (required)
- The workflow spec
- -array (optional)
- The name of an array in the caller's namespace. Values in this array will override workflow attributes of the workflow being cloned.
- -workflow_handler (optional, defaults to
"workflow"
)- -handlers (optional, defaults to
" roles workflow::role actions workflow::action "
)- Returns:
- The ID of the workflow created
- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::parse_spec (private)
workflow::parse_spec -short_name short_name \ [ -package_key package_key ] [ -object_id object_id ] -spec spec \ [ -workflow_handler workflow_handler ] [ -handlers handlers ]
Create workflow, roles, states, actions, etc., as appropriate
- Switches:
- -short_name (required)
- -package_key (optional)
- -object_id (optional)
- -spec (required)
- The roles spec
- -workflow_handler (optional, defaults to
"workflow"
)- -handlers (optional, defaults to
" roles workflow::role actions workflow::action "
)- Author:
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::action_side_effect (public)
workflow::service_contract::action_side_effect
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::activity_log_format_title (public)
workflow::service_contract::activity_log_format_title
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::get_impl_id (public)
workflow::service_contract::get_impl_id -name name
- Switches:
- -name (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::notification_info (public)
workflow::service_contract::notification_info
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::role_assignee_pick_list (public)
workflow::service_contract::role_assignee_pick_list
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::role_assignee_subquery (public)
workflow::service_contract::role_assignee_subquery
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::service_contract::role_default_assignees (public)
workflow::service_contract::role_default_assignees
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.