select workflow_id
from workflows
where object_id = :object_id
and short_name = :short_name
select workflow_id,
short_name,
pretty_name,
object_id,
package_key,
object_type
from workflows
where workflow_id = :workflow_id
select impl.impl_owner_name || '.' || impl.impl_name
from acs_sc_impls impl,
workflow_callbacks c
where c.workflow_id = :workflow_id
and impl.impl_id = c.acs_sc_impl_id
order by c.sort_order
select workflow_id
from workflows
where package_key = :package_key
and short_name = :short_name
and object_id is null
select action_id
from workflow_initial_action
where workflow_id = :workflow_id
select role_id
from workflow_roles
where workflow_id = :workflow_id
order by sort_order
select action_id
from workflow_actions
where workflow_id = :workflow_id
order by sort_order
select max(sort_order)
from $table_name
where workflow_id = :workflow_id
select coalesce(max(sort_order),0) + 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 state_id
from workflow_fsm_states
where workflow_id = :workflow_id
order by sort_order
select impl_id
from acs_sc_impls
where impl_owner_name = :impl_owner_name
and impl_name = :impl_name