Notice: This Wiki is now read only and edits are no longer 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 Workflow and Runtime"
< Stardust | Knowledge Base
(New page: ==== Getting all Users having a certain role, belonging to a certain Organization or Department ==== (Versions: 6.0.3)<br> <source lang="java"> import ag.carnot.web.jsf.common.beans.Se...) |
(→Getting all Users having a certain role, belonging to a certain Organization or Department) |
||
Line 2: | Line 2: | ||
(Versions: 6.0.3)<br> | (Versions: 6.0.3)<br> | ||
+ | This example gets the ServiceFactory from the SessionContext (usage in a JSF backing bean). Outside the session the runtime ServiceFactoryLocator should be used (ServiceFactoryLocator.get("user","password",...)). | ||
<source lang="java"> | <source lang="java"> |
Revision as of 00:48, 6 December 2011
Getting all Users having a certain role, belonging to a certain Organization or Department
(Versions: 6.0.3)
This example gets the ServiceFactory from the SessionContext (usage in a JSF backing bean). Outside the session the runtime ServiceFactoryLocator should be used (ServiceFactoryLocator.get("user","password",...)).
import ag.carnot.web.jsf.common.beans.SessionContext; import ag.carnot.workflow.model.ParticipantInfo; import ag.carnot.workflow.query.ParticipantAssociationFilter; import ag.carnot.workflow.query.UserQuery; import ag.carnot.workflow.query.Users; import ag.carnot.workflow.runtime.QueryService; ... public static Users getUserListForParticipant(String participantId){ SessionContext sessionContext = SessionContext.findSessionContext(); QueryService qsService = sessionContext.getServiceFactory().getQueryService(); ParticipantInfo pInfo = qsService.getParticipant(participantId); UserQuery query = new UserQuery(); query.getFilter().add(ParticipantAssociationFilter.forParticipant(pInfo)); Users users = qsService.getAllUsers(query); return users; }