workflow::role::update_sort_order (private)

 workflow::role::update_sort_order -workflow_id workflow_id \
    -sort_order sort_order

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

Increase the sort_order of other roles, if the new sort_order is already taken.

Switches:
-workflow_id (required)
-sort_order (required)

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::role::edit workflow::role::edit (public) workflow::role::update_sort_order workflow::role::update_sort_order workflow::role::edit->workflow::role::update_sort_order db_dml db_dml (public) workflow::role::update_sort_order->db_dml db_string db_string (public) workflow::role::update_sort_order->db_string

Testcases:
No testcase defined.
Source code:
 
    set sort_order_taken_p [db_string select_sort_order_p {}]
    if { $sort_order_taken_p } {
        db_dml update_sort_order {}
    }
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
<fullquery name="workflow::role::update_sort_order.select_sort_order_p">
    <querytext>
        select count(*)
        from   workflow_roles
        where  workflow_id = :workflow_id
        and    sort_order = :sort_order
    </querytext>
</fullquery>

<fullquery name="workflow::role::update_sort_order.update_sort_order">
    <querytext>
        update workflow_roles
        set    sort_order = sort_order + 1
        where  workflow_id = :workflow_id
        and    sort_order >= :sort_order
    </querytext>
</fullquery>
packages/workflow/tcl/role-procs.xql

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