select count(*) from wf_workflows
where workflow_key = :workflow_key
select count(*) from wf_roles
where workflow_key = :workflow_key
and role_key = :role_key
update wf_transitions set role_key = :role_key
where workflow_key = :workflow_key
and transition_key = :transition_key