Timer fired,but ActivitiEventListener not work

cancel
Showing results for 
Search instead for 
Did you mean: 
xukai8817
Member II

Timer fired,but ActivitiEventListener not work

I have two task.First,Task_1 complete and Task_2 started.Task_2 have a boundary Event.Like this:

<boundaryEvent id="boundarytimer" name="Timer" attachedToRef="task2" cancelActivity="true">
   <timerEventDefinition>
   <timeDuration>PT1M</timeDuration>
   </timerEventDefinition>
</boundaryEvent>

1min after,Task_2 back to Task_1.This job done by AsyncExceutor.

Question:

How can I listen task_2 back to task_1?AsyncExceutor didn't call onEvent() method after timer fired.And before timer fired,MyEventListener can listen all action.

I try :

@Component
public class MyEventListener implements ActivitiEventListener {

    @Override
    public void onEvent(ActivitiEvent event) {
        System.out.println("Listener: " + event.getType());
    }

    @Override
    public boolean isFailOnException() {
        System.out.println("Listener.isFailOnException()");
        return false;
    }
}

USE:

Spring-boot 1.4.2

activiti:5.22.0

Other,This action: ActivitiEventType.TIMER_FIRED.When did fired?

1 Reply
xukai8817
Member II

Re: Timer fired,but ActivitiEventListener not work

My problem is solved.Because We dev environment have several server, but database just one.Other server trigger the timer,so my application can't do it.And others server haven't Listener.The result,my application can't listen timer-fired.

Event Log:

TIMER_FIRED
ACTIVITY_CANCELLED
HISTORIC_ACTIVITY_INSTANCE_ENDED
ACTIVITY_COMPLETED

HISTORIC_ACTIVITY_INSTANCE_CREATED