6 Replies Latest reply on Sep 25, 2017 2:07 AM by Smurfy 303

    Task event listener

    Fer Gia Newbie

      Hi all!!


      I want to add a task event listener to make actions while task event occurs.


      I have this:


      @PersistenceUnit(unitName = "jbpm")
        private EntityManagerFactory emf;
      private BeanManager beanManager;
      public RuntimeEnvironment produceEnvironment(EntityManagerFactory emf) {
        RuntimeEnvironment environment = RuntimeEnvironmentBuilder.getDefault()
        .registerableItemsFactory(InjectableRegisterableItemsFactory.getFactory(beanManager, AuditLoggerFactory.newJPAInstance(emf)))
        .addAsset(ResourceFactory.newClassPathResource("process.bpmn"), ResourceType.BPMN2).get();
        return environment;


      I added a Event listener class like that:


      public class TaskEventListener implements TaskLifeCycleEventListener {
        public TaskEventListener(){
      public void afterTaskActivatedEvent(Task ti) {
      public void afterTaskClaimedEvent(Task ti) {



      This never prints any messages in the console and the TaskEventListener methods are never executed.


      I try adding a

      public TaskEventListener buildTaskEventListener(){
           return new TaskEventListener();

      but the result is the same...

      What Im missing?

      Thanks all!