cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning a task to a group minus an individual

walterjs
Champ in-the-making
Champ in-the-making
I know that you can use a spring service to create the list of users like this, but I was just wondering if this is something that you have solved already, since it comes up so often. A Create and Review task that follow each other for instance and the creator should not be able to review their own work.

I'm thinking of something like this:


    <potentialOwner>
      <resourceAssignmentExpression>
        <formalExpression>exclude(createTask), group(creators)</formalExpression>
      </resourceAssignmentExpression>
    </potentialOwner>

Where "createTask" was performed by the individual that you wish to exclude.
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
As a workaround, you could use a TaskListener that is triggered when task is created, that throws an exception when the "review" task is assigned to the initiator.

<process …>
    <startEvent id="request" activiti:initiator="theInitiator" />

    <… />

   <userTask id="reviewTask" name="my task" activiti:assignee="${selectedAssignee}">
      <extensionElements>
         <activiti:taskListener event="create" class="org.activiti.CheckAssigneeHandler" />
      </extensionElements>
   </userTask>

</process>


public class CheckAssigneeHandler implements TaskListener {

  public void notify(DelegateTask delegateTask) {
     if(delegateTask.getAssignee().equals(delegateTask.getExecution().getVariable("theInitiator")) {
         throw new ….Exception(…);
     }
  }
 
}


Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.