workflow::role::callback_insert (public)

 workflow::role::callback_insert -role_id role_id -name name \
    [ -sort_order sort_order ]

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

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):
%3 workflow::role::edit workflow::role::edit (public) workflow::role::callback_insert workflow::role::callback_insert workflow::role::edit->workflow::role::callback_insert db_dml db_dml (public) workflow::role::callback_insert->db_dml db_string db_string (public) workflow::role::callback_insert->db_string db_transaction db_transaction (public) workflow::role::callback_insert->db_transaction workflow::role::flush_cache workflow::role::flush_cache (private) workflow::role::callback_insert->workflow::role::flush_cache workflow::role::get_workflow_id workflow::role::get_workflow_id (public) workflow::role::callback_insert->workflow::role::get_workflow_id

Testcases:
No testcase defined.
Source code:
    db_transaction {

        # Get the impl_id
        set acs_sc_impl_id [workflow::service_contract::get_impl_id -name $name]

        # Get the sort order
        if { (![info exists sort_order] || $sort_order eq "") } {
            set sort_order [db_string select_sort_order {}]
        }

        # Insert the rule
        db_dml insert_callback {}
    }

    set workflow_id [workflow::role::get_workflow_id -role_id $role_id]
    workflow::role::flush_cache -workflow_id $workflow_id

    return $acs_sc_impl_id
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="workflow::role::callback_insert.insert_callback">
    <querytext>
        insert into workflow_role_callbacks (role_id, acs_sc_impl_id, sort_order)
        values (:role_id, :acs_sc_impl_id, :sort_order)
    </querytext>
</fullquery>

<fullquery name="workflow::role::callback_insert.select_sort_order">
    <querytext>
        select coalesce(max(sort_order),0) + 1
        from   workflow_role_callbacks
        where  role_id = :role_id
    </querytext>
</fullquery>
packages/workflow/tcl/role-procs.xql

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