Forum OpenACS Development: Re: case_id X role_id

2: Re: case_id X role_id (response to 1)
Posted by Brian Fenton on
Hi Iuri!

Well, I'm not too familiar with that version of Workflow (I've used the older workflow a lot), but it looks like you need to clarify the question you're asking. Looking at the datamodel here,r=1.27/OpenACS/openacs-4/packages/workflow/sql/postgresql/workflow-tables-create.sql I can guess you're trying to ask for either "all the cases having a party in a particular role" or "all the cases assigned to a particular role".

My guess is you probably want the second, which would be something like:

select distinct case_id
from workflow_case_assigned_actions
where role_id = :role_id

The first query might be something like this:
select distinct case_id
from workflow_case_role_party_map
where role_id = :role_id

hope this helps