Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Stardust/Knowledge Base/API/JavaAPICookbook/Querying Activity Instance List"
< Stardust | Knowledge Base
m (→List Activity Instance) |
m (STP/Stardust/KnowledgeBase/API/JavaAPICookbook/Querying Activity Instance List moved to Stardust/Knowledge Base/API/JavaAPICookbook/Querying Activity Instance List) |
(2 intermediate revisions by one other user not shown) | |
(No difference)
|
Latest revision as of 11:03, 25 June 2013
List Activity Instance
Getting all Activity instances having a certain state, belonging to a certain Department
(Versions: 6.0.3)
In certain scenarios you want to get all Activity instances having a certain state, belonging to a certain Department. The modelid, participantId, departmentId in the example are sample ids it will vary from case to case
String modelId = "aModelId"; String participantId = "aParticipantId"; String departmentId = "aDeparmentId"; ParticipantInfo participantInfo = getQueryService().getParticipant(participantId); if (participantInfo instanceof OrganizationInfo) { OrganizationInfo organizationInfo = (OrganizationInfo) participantInfo; if (organizationInfo.isDepartmentScoped()) { Department department = getQueryService().findDepartment(null, departmentId, (OrganizationInfo) participantInfo); participantInfo = ParticipantInfoUtil.newModelParticipantInfo( modelId, participantId, department); } } ActivityInstanceQuery query = ActivityInstanceQuery.findAll(); query.getFilter().add(ActivityStateFilter.PENDING); query.getFilter().add(PerformingParticipantFilter.forParticipant(participantInfo)); ActivityInstance aInstance = getQueryService().findFirstActivityInstance(query);