workflow::role::get_picklist (public)

 workflow::role::get_picklist -role_id role_id

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

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):
%3 workflow::role::get_assignee_widget workflow::role::get_assignee_widget (public) workflow::role::get_picklist workflow::role::get_picklist workflow::role::get_assignee_widget->workflow::role::get_picklist acs_sc::invoke acs_sc::invoke (public) workflow::role::get_picklist->acs_sc::invoke ad_conn ad_conn (public) workflow::role::get_picklist->ad_conn db_list_of_lists db_list_of_lists (public) workflow::role::get_picklist->db_list_of_lists db_transaction db_transaction (public) workflow::role::get_picklist->db_transaction workflow::role::get_callbacks workflow::role::get_callbacks (private) workflow::role::get_picklist->workflow::role::get_callbacks

Testcases:
No testcase defined.
Source code:
    set contract_name [workflow::service_contract::role_assignee_pick_list]

    set party_id_list [list]

    db_transaction {

        set impl_names [workflow::role::get_callbacks  -role_id $role_id  -contract_name $contract_name]

        foreach impl_name $impl_names {
            # Call the service contract implementation
            set party_id_list [acs_sc::invoke  -contract $contract_name  -operation "GetPickList"  -impl $impl_name  -call_args [list "" "" $role_id]]
    
            if { [llength $party_id_list] != 0 } {
                # Return after the first non-empty list
                break
            }
        }

    }

    if { [ad_conn isconnected] && [ad_conn user_id] != 0 } {
        lappend party_id_list [ad_conn user_id]
    }

    if { [llength $party_id_list] > 0 } { 
        set options [db_list_of_lists select_options "select acs_object__name(p.party_id) || ' (' || p.email || ')'  as label, p.party_id
        from   parties p
        where  p.party_id in ([join $party_id_list ""])
        order  by label"]
    } else {
        set options {}
    }

    set options [concat { { "Unassigned" "" } } $options]
    lappend options { "Search..." ":search:"}

    return $options
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/workflow/tcl/role-procs.xql

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