select workflow_id from workflows where object_id = :object_id and short_name = :short_name select workflow_id from workflows where package_key = :package_key and short_name = :short_name select action_id from workflow_initial_action where workflow_id = :workflow_id select max(sort_order) from $table_name where workflow_id = :workflow_id select coalesce(max(sort_order)) + 1 from workflow_callbacks where workflow_id = :workflow_id insert into workflow_callbacks (workflow_id, acs_sc_impl_id, sort_order) values (:workflow_id, :acs_sc_impl_id, :sort_order) select impl_id from acs_sc_impls where impl_owner_name = :impl_owner_name and impl_name = :impl_name