AnsweredAssumed Answered

TaskListener cannot delete potential owners specified in XML

Question asked by processengine on Aug 24, 2012
Latest reply on Jul 12, 2013 by jbarrez
Version: Activiti 5.10 (with setup like in demo via ant demo.start)

In the XML I've defined a user task with a task listener on create event like this:
<userTask id="dynamicAssignmentTask" name="Dynamic Assignment Task" >
        <documentation>Some documentation here</documentation>
          <activiti:taskListener event="create" class="org.activiti.tasklistener.DynamicAssignmentHandler" />
            <formalExpression>user(kermit), group(DynamicAssignmentGroup)</formalExpression>
I would like to reassign the task candidates within the task listener. For example:
   public void notify(DelegateTask delegateTask) {
      // This doesn't delete the candidate group specified in the XML.
      // This doesn't delete the user specified in the XML.

      // This is not specified in the XML and works perfectly.

The problem is that the candidates which are specified within the XML cannot be deleted (removed from the candidate list) by using the API within a TaskListener. Adding/deleting candidates which aren't specified within the XML works perfectly.
Any ideas why this won't work? (Is it a bug?)

Thanks in advance