workflow::case::role::assign (public)

 workflow::case::role::assign -case_id case_id -array array \
    [ -replace ]

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

Assign roles from an array with entries like this: array(short_name) = [list of party_ids].

Switches:
-case_id (required)
The ID of the case.
-array (required)
Name of array with assignment info
-replace (optional, boolean)
Should the new assignees replace existing assignees?
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 bug_tracker::bug::edit bug_tracker::bug::edit (public) workflow::case::role::assign workflow::case::role::assign bug_tracker::bug::edit->workflow::case::role::assign workflow::case::new workflow::case::new (public) workflow::case::new->workflow::case::role::assign db_transaction db_transaction (public) workflow::case::role::assign->db_transaction workflow::case::get_element workflow::case::get_element (public) workflow::case::role::assign->workflow::case::get_element workflow::case::role::assignee_insert workflow::case::role::assignee_insert (public) workflow::case::role::assign->workflow::case::role::assignee_insert workflow::role::get_id workflow::role::get_id (public) workflow::case::role::assign->workflow::role::get_id

Testcases:
No testcase defined.
Source code:
    upvar $array assignees

    set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id]
    
    db_transaction {
        foreach name [array names assignees] {
            
            set role_id [workflow::role::get_id  -workflow_id $workflow_id  -short_name $name]
            
            workflow::case::role::assignee_insert  -replace=$replace_p  -case_id $case_id  -role_id $role_id  -party_ids $assignees($name)
        }
    }
Generic XQL file:
packages/workflow/tcl/case-procs.xql

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

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

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