AnsweredAssumed Answered

TaskListener doesn't call

Question asked by yuriyk on Aug 21, 2013
Latest reply on Aug 21, 2013 by yuriyk
Hello everyone,

I'm trying to use TaslListener for dynamic assining candidads.

    <userTask id="HTask" name="HTask" activiti:assignee="${initiator}">
    <documentation>Write something.</documentation>
      <extensionElements>
        <activiti:taskListener event="assignment" class="org.bpmnwithactiviti.dzone.pizzaorder.MyAssignmentHandler"></activiti:taskListener>
        <activiti:taskListener event="create" class="org.bpmnwithactiviti.dzone.pizzaorder.MyAssignmentHandler"></activiti:taskListener>
      </extensionElements>
    </userTask>

public class MyAssignmentHandler implements TaskListener {   public void notify(TaskEntity task) {
                  task.addCandidateUser("testUser1");
   }

The problem is that when I try to test it with JUnit, my class "MyAssignmentHandler" isn't called at all. Essentially I can enev wrtite "bla-bla-bla" instead classname in XML and test complete successful.

I don't understand what is wrong wit my code?

Outcomes