workflow::action::callback_insert (public)

 workflow::action::callback_insert -action_id action_id -name name \
    [ -sort_order sort_order ]

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

Add a side-effect to an action.

Switches:
-action_id
(required)
The ID of the action.
-name
(required)
Name of service contract implementation, in the form (impl_owner_name).(impl_name), for example, bug-tracker.CaptureResolutionCode
-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::action::edit workflow::action::edit (public) workflow::action::callback_insert workflow::action::callback_insert workflow::action::edit->workflow::action::callback_insert db_dml db_dml (public) workflow::action::callback_insert->db_dml db_string db_string (public) workflow::action::callback_insert->db_string db_transaction db_transaction (public) workflow::action::callback_insert->db_transaction workflow::action::flush_cache workflow::action::flush_cache (private) workflow::action::callback_insert->workflow::action::flush_cache workflow::action::get_workflow_id workflow::action::get_workflow_id (public) workflow::action::callback_insert->workflow::action::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 callback
        db_dml insert_callback {}
    }

    set workflow_id [workflow::action::get_workflow_id -action_id $action_id]
    workflow::action::flush_cache -workflow_id $workflow_id

    return $acs_sc_impl_id
Generic XQL file:
<fullquery name="workflow::action::callback_insert.insert_callback">
    <querytext>
        insert into workflow_action_callbacks (action_id, acs_sc_impl_id, sort_order)
        values (:action_id, :acs_sc_impl_id, :sort_order)
    </querytext>
</fullquery>

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

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

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

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