- Publicity: Public Only All
role-procs.tcl
Procedures in the workflow::role namespace.
- Location:
- packages/workflow/tcl/role-procs.tcl
- Created:
- 8 January 2003
- Authors:
- Lars Pind <lars@collaboraid.biz>
- Peter Marklund <peter@collaboraid.biz>
- CVS Identification:
$Id: role-procs.tcl,v 1.29 2018/06/12 08:40:05 gustafn Exp $
Procedures in this file
- workflow::role::add_assignee_widgets (public)
- workflow::role::callback_insert (public)
- workflow::role::delete (public)
- workflow::role::edit (public)
- workflow::role::flush_cache (private)
- workflow::role::generate_short_name (public)
- workflow::role::generate_spec (private)
- workflow::role::get (public)
- workflow::role::get_all_info (private)
- workflow::role::get_all_info_not_cached (private)
- workflow::role::get_assignee_widget (public)
- workflow::role::get_callbacks (private)
- workflow::role::get_element (public)
- workflow::role::get_existing_short_names (public)
- workflow::role::get_id (public)
- workflow::role::get_ids (private)
- workflow::role::get_options (public)
- workflow::role::get_picklist (public)
- workflow::role::get_search_query (public)
- workflow::role::get_workflow_id (public)
- workflow::role::get_workflow_id_not_cached (private)
- workflow::role::new (public)
- workflow::role::parse_spec (private)
- workflow::role::update_sort_order (private)
Detailed information
workflow::role::add_assignee_widgets (public)
workflow::role::add_assignee_widgets -form_name form_name \ [ -prefix prefix ] -workflow_id workflow_id [ -roles roles ] \ [ -mode mode ]
Get the assignee widget for use with ad_form for this role.
- Switches:
- -form_name (required)
- -prefix (optional, defaults to
"role_"
)- -workflow_id (required)
- -roles (optional)
- -mode (optional, defaults to
"display"
)- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::callback_insert (public)
workflow::role::callback_insert -role_id role_id -name name \ [ -sort_order sort_order ]
Add an assignment rule to a role.
- Switches:
- -role_id (required)
- The ID of the role
- -name (required)
- Name of service contract implementation, in the form (impl_owner_name).(impl_name), for example, bug-tracker.ComponentMaintainer.
- -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::role::delete (public)
workflow::role::delete -role_id role_id
Delete workflow role with given id.
- Switches:
- -role_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::edit (public)
workflow::role::edit [ -operation operation ] [ -role_id role_id ] \ [ -workflow_id workflow_id ] [ -array array ] [ -internal ] \ [ -no_complain ] [ -handlers handlers ]
Edit a workflow role. Attributes of the array are: short_name pretty_name sort_order callbacks.
- Switches:
- -operation (optional, defaults to
"update"
)- insert, update, delete
- -role_id (optional)
- For update/delete: The role to update or delete. For insert: Optionally specify a pre-generated role_id for the role.
- -workflow_id (optional)
- For update/delete: Optionally specify the workflow_id. If not specified, we will execute a query to find it. For insert: The workflow_id of the new role.
- -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.
- -handlers (optional)
- Returns:
- role_id
- Authors:
- Peter Marklund
- Lars Pind <lars@collaboraid.biz>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::flush_cache (private)
workflow::role::flush_cache -workflow_id workflow_id
Flush all caches related to roles for the given workflow. Used internally by the workflow API only.
- Switches:
- -workflow_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::generate_short_name (public)
workflow::role::generate_short_name -workflow_id workflow_id \ -pretty_name pretty_name [ -short_name short_name ] \ [ -role_id role_id ]
Generate a unique short_name from pretty_name.
- Switches:
- -workflow_id (required)
- -pretty_name (required)
- -short_name (optional)
- -role_id (optional)
- If you pass in this, we will allow that role's short_name to be reused.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::generate_spec (private)
workflow::role::generate_spec [ -role_id role_id ] [ -one_id one_id ] \ [ -handlers handlers ]
Generate the spec for an individual role definition.
- Switches:
- -role_id (optional)
- The id of the role to generate spec for.
- -one_id (optional)
- Same as role_id, just used for consistency across roles/actions/states.
- -handlers (optional)
- Returns:
- spec The roles spec
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get (public)
workflow::role::get -role_id role_id -array array
Return information about a role in an array.
- Switches:
- -role_id (required)
- The ID of the workflow
- -array (required)
- Name of the array you want the info returned in
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_all_info (private)
workflow::role::get_all_info -workflow_id workflow_id
This proc is for internal use in the workflow API only. Returns all information related to roles for a certain workflow instance. Uses util_memoize to cache values.
- Switches:
- -workflow_id (required)
- Author:
- Peter Marklund
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_all_info_not_cached (private)
workflow::role::get_all_info_not_cached -workflow_id workflow_id
This proc is for internal use in the workflow API only and should not be invoked directly from application code. Returns all information related to roles for a certain workflow instance. Goes to the database on every invocation and should be used together with util_memoize.
- Switches:
- -workflow_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_assignee_widget (public)
workflow::role::get_assignee_widget -role_id role_id \ [ -prefix prefix ] [ -mode mode ]
Get the assignee widget for use with ad_form for this role.
- Switches:
- -role_id (required)
- the ID of the role.
- -prefix (optional, defaults to
"role_"
)- -mode (optional, defaults to
"display"
)- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_callbacks (private)
workflow::role::get_callbacks -role_id role_id \ -contract_name contract_name
Get the impl_names of callbacks of a given contract for a given role.
- Switches:
- -role_id (required)
- the ID of the role to assign.
- -contract_name (required)
- the name of the contract
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_element (public)
workflow::role::get_element [ -role_id role_id ] [ -one_id one_id ] \ -element element
Return a single element from the information about a role.
- Switches:
- -role_id (optional)
- The id of the role to get an element for.
- -one_id (optional)
- Same as role_id, just used for consistency across roles/actions/states.
- -element (required)
- Returns:
- element The element you asked for
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_existing_short_names (public)
workflow::role::get_existing_short_names -workflow_id workflow_id \ [ -ignore_role_id ignore_role_id ]
Returns a list of existing role short_names in this workflow. 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:
- -workflow_id (required)
- -ignore_role_id (optional)
- If specified, the short_name for the given role will not be included in the result set.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_id (public)
workflow::role::get_id -workflow_id workflow_id -short_name short_name
Return the role_id of the role with the given short_name in the given workflow.
- Switches:
- -workflow_id (required)
- The ID of the workflow
- -short_name (required)
- The short_name of the role
- Returns:
- role_id of the desired role, or the empty string if it can't be found.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_ids (private)
workflow::role::get_ids [ -all ] -workflow_id workflow_id \ [ -parent_action_id parent_action_id ]
Get the IDs of all the roles in the right order.
- Switches:
- -all (optional, boolean)
- -workflow_id (required)
- The id of the workflow to get roles for.
- -parent_action_id (optional)
- No meaning. Provided for compatibility with similar procs for actions and states.
- Returns:
- A list of role IDs.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_options (public)
workflow::role::get_options -workflow_id workflow_id [ -id_values ]
Get a list of roles in a workflow for use in the 'options' property of a form builder form element.
- Switches:
- -workflow_id (required)
- -id_values (optional, boolean)
- Provide this switch if you want the values in the options list to be role id:s instead of short names.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_picklist (public)
workflow::role::get_picklist -role_id role_id
Get the picklist for this role.
- Switches:
- -role_id (required)
- the ID of the role.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_search_query (public)
workflow::role::get_search_query -role_id role_id
Get the search query for this role.
- Switches:
- -role_id (required)
- the ID of the role.
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_workflow_id (public)
workflow::role::get_workflow_id -role_id role_id
Lookup the workflow_id of a certain role_id.
- Switches:
- -role_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::get_workflow_id_not_cached (private)
workflow::role::get_workflow_id_not_cached -role_id role_id
This is a proc that should only be used internally by the workflow API, applications should use workflow::role::get_workflow_id instead.
- Switches:
- -role_id (required)
- Author:
- Peter Marklund
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::new (public)
workflow::role::new -workflow_id workflow_id [ -role_id role_id ] \ [ -short_name short_name ] -pretty_name pretty_name \ [ -sort_order sort_order ] [ -callbacks callbacks ]
Creates a new role for a workflow.
- Switches:
- -workflow_id (required)
- The ID of the workflow the new role belongs to
- -role_id (optional)
- -short_name (optional)
- The short_name of the new role
- -pretty_name (required)
- The pretty name of the new role
- -sort_order (optional)
- -callbacks (optional)
- A list of names service-contract implementations.
- Returns:
- role_id
- Authors:
- Peter Marklund
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::parse_spec (private)
workflow::role::parse_spec -workflow_id workflow_id \ -short_name short_name -spec spec
Parse the spec for an individual role definition.
- Switches:
- -workflow_id (required)
- The id of the workflow the role should be added to.
- -short_name (required)
- The short_name of the role
- -spec (required)
- The roles spec
- Author:
- Lars Pind <lars@collaboraid.biz>
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
workflow::role::update_sort_order (private)
workflow::role::update_sort_order -workflow_id workflow_id \ -sort_order sort_order
Increase the sort_order of other roles, if the new sort_order is already taken.
- Switches:
- -workflow_id (required)
- -sort_order (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.