workflow::case::role::assignee_insert (public)

 workflow::case::role::assignee_insert -case_id case_id \
    -role_id role_id -party_ids party_ids [ -replace ]

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

Insert a new assignee for this role

Switches:
-case_id (required)
the ID of the case.
-role_id (required)
the ID of the role to assign.
-party_ids (required)
-replace (optional, boolean)
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::case::role::assign workflow::case::role::assign (public) workflow::case::role::assignee_insert workflow::case::role::assignee_insert workflow::case::role::assign->workflow::case::role::assignee_insert workflow::case::role::set_default_assignees workflow::case::role::set_default_assignees (public) workflow::case::role::set_default_assignees->workflow::case::role::assignee_insert callback callback (public) workflow::case::role::assignee_insert->callback db_dml db_dml (public) workflow::case::role::assignee_insert->db_dml db_string db_string (public) workflow::case::role::assignee_insert->db_string db_transaction db_transaction (public) workflow::case::role::assignee_insert->db_transaction workflow::case::role::assignees_remove workflow::case::role::assignees_remove (public) workflow::case::role::assignee_insert->workflow::case::role::assignees_remove

Testcases:
No testcase defined.
Source code:
    db_transaction { 
        if { $replace_p } {
            workflow::case::role::assignees_remove -case_id $case_id -role_id $role_id
        }
        
        foreach party_id $party_ids {
            if { [catch {
                db_dml insert_assignee {}

        callback workflow::case::role::after_assign  -case_id $case_id  -party_id $party_id

            } errMsg] } {
                set already_assigned_p [db_string already_assigned_p {}]
                if { !$already_assigned_p } {
                    global errorInfo errorCode
                    error $errMsg $errorInfo $errorCode
                }
            }
        }
    }

    workflow::case::role::flush_cache -case_id $case_id
Generic XQL file:
<fullquery name="workflow::case::role::assignee_insert.insert_assignee">
    <querytext>
      insert into workflow_case_role_party_map
        (case_id, role_id, party_id)
      values
        (:case_id, :role_id, :party_id)
    </querytext>
</fullquery>

<fullquery name="workflow::case::role::assignee_insert.already_assigned_p">
    <querytext>
      select count(*)
      from   workflow_case_role_party_map
      where  case_id = :case_id
      and    role_id = :role_id
      and    party_id = :party_id
    </querytext>
</fullquery>
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: