select t.case_id,
t.workflow_key,
t.transition_key,
c.object_id,
wcti.access_privilege
from wf_tasks t, wf_cases c, wf_context_transition_info wcti
where wcti.context_key = c.context_key
and wcti.workflow_key = t.workflow_key
and wcti.transition_key = t.transition_key
and c.case_id = t.case_id
and t.task_id = :task_id
select count(*) from wf_user_tasks where task_id = :task_id and user_id = :user_id
select count(*) from wf_task_assignments
where task_id = :task_id and party_id = :party_id
select count(*) from wf_case_assignments
where workflow_key = :workflow_key
and case_id = :case_id
and transition_key = :transition_key
and party_id = :party_id