workflow::callback_insert (private)

 workflow::callback_insert -workflow_id workflow_id -name name \
    [ -sort_order sort_order ]

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

Add a side-effect to a workflow.

Switches:
-workflow_id
(required)
The ID of the workflow.
-name
(required)
Name of service contract implementation, in the form (impl_owner_name).(impl_name), for example, bug-tracker.FormatLogTitle.
-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::edit workflow::edit (public) workflow::callback_insert workflow::callback_insert workflow::edit->workflow::callback_insert db_dml db_dml (public) workflow::callback_insert->db_dml db_string db_string (public) workflow::callback_insert->db_string db_transaction db_transaction (public) workflow::callback_insert->db_transaction util_memoize_flush util_memoize_flush (public) workflow::callback_insert->util_memoize_flush workflow::service_contract::get_impl_id workflow::service_contract::get_impl_id (public) workflow::callback_insert->workflow::service_contract::get_impl_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 callback
        db_dml insert_callback {}
    }

    # Flush workflow scalar attributes and workflow callbacks
    util_memoize_flush [list workflow::get_not_cached -workflow_id $workflow_id]

    return $acs_sc_impl_id
Generic XQL file:
<fullquery name="workflow::callback_insert.select_sort_order">
    <querytext>
        select coalesce(max(sort_order),0) + 1
        from   workflow_callbacks
        where  workflow_id = :workflow_id
    </querytext>
</fullquery>

<fullquery name="workflow::callback_insert.insert_callback">
    <querytext>
        insert into workflow_callbacks (workflow_id, acs_sc_impl_id, sort_order)
        values (:workflow_id, :acs_sc_impl_id, :sort_order)
    </querytext>
</fullquery>
packages/workflow/tcl/workflow-procs.xql

PostgreSQL XQL file:
packages/workflow/tcl/workflow-procs-postgresql.xql

Oracle XQL file:
packages/workflow/tcl/workflow-procs-oracle.xql

[ hide source ]
Show another procedure: