cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve Activiti:candidategroups?

ask45ru
Champ on-the-rise
Champ on-the-rise
How can I programmatically get access to Activiti:candidategroups?
4 REPLIES 4

plehal
Champ in-the-making
Champ in-the-making
something like this:


public String getCandidateGroupsForTask(String taskid) {

  IdentityService is = engine.getIdentityService();
  TaskService ts = engine.getTaskService();

  List<IdentityLink> il = ts.getIdentityLinksForTask(taskid);
  String str = "";

  Vector ve = new Vector();
  for (int n = 0; n < il.size(); n++) {

   IdentityLink cil = il.get(n);

   String gid = cil.getGroupId();

   if (gid != null) {
    
    ve.add(gid);
    
   }
  }
  for (int l = 0; l < ve.size(); l++) {
   str += ve.elementAt(l);
   if (l < ve.size() - 1)
    str += ",";
  }

  return str;
}

ask45ru
Champ on-the-rise
Champ on-the-rise
I already solved my problem by casting TaskEntity on Task object.  Smiley Very Happy  TaskEntity have an access to task definition including candidategroups.


        TaskFormData data = formService.getTaskFormData(taskId);

        TaskEntity t = (TaskEntity) data.getTask();

plehal
Champ in-the-making
Champ in-the-making
Is TaskEntity  part of public API?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
No, it is in the impl package…