JBoss Community

Re: jBPM 5.4 : forwarding task PermissionDeniedException when user is actualOwner but not in potential owners

created by gonzalad in jBPM - View the full discussion

For now, I'm adding actualOwner to potentialOwner as a temporary solution just before calling forward.

 

 

// add actualOwner to potentialOwners
Task task = taskService.getTask(taskId);
org.jbpm.task.User actualOwner = task.getTaskData().getActualOwner();
if (actualOwner != null) {
  PeopleAssignments peopleAssignments = task.getPeopleAssignments();
  if (! peopleAssignments.getPotentialOwners().contains(actualOwner)) {
    peopleAssignments.getPotentialOwners().add(actualOwner);
  }
}
 
taskService.forward(taskSummary.getId(), username, targetGroupname);

Reply to this message by going to Community

Start a new discussion in jBPM at Community