# Not able to get FlowableEngineEventType.TASK\_CREATED after Boundary timer event trigger

**URL:** <https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829>\
**Category:** Flowable Engine\
**Created:** [April 14, 2020, 11:50am UTC](https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829 "2020-04-14T11:50:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshus007](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@maheshus007](https://forum.flowable.org/u/maheshus007)\
**Post date:** [April 14, 2020, 11:50am UTC](https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829/1 "2020-04-14T11:50:41Z")

</div>

Hi Team,

I’m facing the below problem in flowable.

I used a timer(boundary timer event) from one task(test1), and if the task is not completed in 20s, it will move to a task called Test2 instead of Test3. But during this timer event triggered, the task are created in the Engine, but the listener is not able to find the created new task.

![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/0/00dbcabeaa3a66381627eb1349a78984df1a2886.png)

I’m using springboot application and the code is as below.

public class CreateTaskListener implements FlowableEventListener  
{

```
@Override
public void onEvent(FlowableEvent event)
{
    if (event instanceof FlowableEngineEntityEvent) {
    	System.out.println(event.getType());
        if (event.getType() == FlowableEngineEventType.TASK_CREATED) {
            TaskEntity task = (TaskEntity) ((FlowableEngineEntityEvent) event).getEntity();
            try {
                restClient rest = new restClient("api-env");
                rest.createTask(task);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
```

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [April 20, 2020, 10:18am UTC](https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829/2 "2020-04-20T10:18:46Z")

</div>

I assume, looking at your code, that you are sending out REST request to somewhere else and there want to query the tasks?

The task entity won’t be in the database until the transaction has been committed. The solution is to send out this request only when the transaction has been committed. This is possible by enabling the isFireOnTransactionLifecycleEvent, see more info here: [https://flowable.com/open-source/docs/bpmn/ch03-Configuration/#event-listener-implementation](https://flowable.com/open-source/docs/bpmn/ch03-Configuration/#event-listener-implementation)

---

<div class="post-metadata">

**Author:** ![maheshus007](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@maheshus007](https://forum.flowable.org/u/maheshus007)\
**Post date:** [April 20, 2020, 10:34am UTC](https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829/3 "2020-04-20T10:34:21Z")

</div>

Team,

This is working after setting config.setAsyncExecutorDefaultTimerJobAcquireWaitTime(10) in configuration.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [April 20, 2020, 10:48am UTC](https://forum.flowable.org/t/not-able-to-get-flowableengineeventtype-task-created-after-boundary-timer-event-trigger/5829/4 "2020-04-20T10:48:53Z")

</div>

This setting will set the delay between two checks of the async executor for new work. Not sure how this solves the problem (i’m guessing there is a race condition between db transaction commit and the other service querying for the task).
