Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Stardust/Knowledge Base/API/JavaAPICookbook/QueryingWorklists"

(Getting all Users having a certain role, belonging to a certain Organization or Department)
(Introduction)
Line 1: Line 1:
 
== Introduction  ==
 
== Introduction  ==
  
In this article, we will explain the capabilities of Stardust Workflow Service in details with examples. It is assumed that you are familiar with the modeling the processes with Stardust. If not please read the product documentation here first.<br>If you are using the Stardust in embedded mode, then it is likely that you will have to use this service extensively. The Workflow Service is the heart of Stardust Engine. Its core features include:<br>  
+
This article will provide examples/usage of different Query API's. It is assumed that you are familiar with the modeling the processes with Stardust.  
 +
 
 +
Its core features include:<br>  
  
 
*Starting a process  
 
*Starting a process  

Revision as of 06:24, 5 February 2014

Introduction

This article will provide examples/usage of different Query API's. It is assumed that you are familiar with the modeling the processes with Stardust.

Its core features include:

  • Starting a process
  • Executing an activities
  • Activating, delegating, suspending and aborting activities
  • Accessing workflow data


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;
}

Back to the top