workflow::case::assign_roles (private)

 workflow::case::assign_roles -case_id case_id [ -all ]

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

Find out which roles are assigned to currently enabled actions. If any of these currently have zero assignees, run the default assignment process.

Switches:
-case_id (required)
The ID of the case.
-all (optional, boolean)
Set this to assign all roles for this case. This parameter is deprecated, and always assumed.
Author:
Lars Pind <lars@collaboraid.biz>

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::case::state_changed_handler workflow::case::state_changed_handler (private) workflow::case::assign_roles workflow::case::assign_roles workflow::case::state_changed_handler->workflow::case::assign_roles db_list db_list (public) workflow::case::assign_roles->db_list workflow::case::role::flush_cache workflow::case::role::flush_cache (private) workflow::case::assign_roles->workflow::case::role::flush_cache workflow::case::role::set_default_assignees workflow::case::role::set_default_assignees (public) workflow::case::assign_roles->workflow::case::role::set_default_assignees

Testcases:
No testcase defined.
Source code:
    set role_ids [db_list select_unassigned_roles {
        select r.role_id
        from   workflow_roles r,
               workflow_cases c
        where  c.case_id = :case_id
        and    r.workflow_id = c.workflow_id
        and    not exists (select 1
                           from   workflow_case_role_party_map m
                           where  m.role_id = r.role_id
                           and    m.case_id = :case_id)
    }]

    foreach role_id $role_ids {
        workflow::case::role::set_default_assignees  -case_id $case_id  -role_id $role_id
    }

    workflow::case::role::flush_cache -case_id $case_id
Generic XQL file:
<fullquery name="workflow::case::assign_roles.select_num_assignees">
    <querytext>
      select count(*)
      from   workflow_case_role_user_map
      where  case_id = :case_id
      and    role_id = :role_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: