select 1 from wf_workflows
where workflow_key = :workflow_key
select pretty_name as workflow_name
from acs_object_types
where object_type = :workflow_key
select context_key as context_key_from_db,
context_name as title,
'' as url,
0 as selected_p
from wf_contexts
order by context_name
select tr.transition_key,
tr.transition_name,
p.party_id,
acs_object.name(p.party_id) as party_name,
p.email as party_email,
'' as user_select_widget
from wf_transition_info tr left outer join
(wf_context_assignments ca left outer join parties p
using (party_id)) using (context_key, transition_key)
where tr.workflow_key = :workflow_key
and tr.context_key = :context_key
and tr.trigger_type = 'user'
and tr.assignment_callback is null
and not exists
(select 1
from wf_transition_assignment_map
where workflow_key = tr.workflow_key
and assign_transition_key = tr.transition_key)
order by tr.sort_order, tr.transition_key
select p.party_id as sel_party_id,
acs_object.name(p.party_id) as sel_name,
p.email as sel_email
from parties p
where p.party_id not in
(select ca.party_id
from wf_context_assignments ca
where ca.workflow_key = :workflow_key
and ca.context_key = :context_key
and ca.transition_key = :transition_key)