# Event Dispatching issues, missing id in ACTIVITY\_STARTED,Duplicated ENTITY\_CREATED for sequenceFlow and events and missing ending for task activity

**URL:** <https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402>\
**Category:** Flowable Engine\
**Created:** [April 5, 2024, 7:53pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402 "2024-04-05T19:53:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:53pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/1 "2024-04-05T19:53:04Z")

</div>

I am using global listener to stream to my application all dispatched entities changes and in general events and there are several issues / gaps i dont understand, if someone can chime in here and explain some of this issues I will apreciate. Thanks!

1. ENTITY\_CREATED is dispatched twice for sequenceFlow, only difference with the second one is second has endTime, seems to me this must be an ENTITY\_UPDATE or ENTITY\_DELETE ?

2. ENTITY\_CREATED is dispatched twice for Event, here only difference i see is that deleteReason was added in a diferent position (so is detected by serializer). I assume this should not even exist as event or a property is missing and should also be an update.

3. In case of the task, has a ENTITY\_CREATED for the activity of the task but no DELETED nor UPDATED after finished, but it has a HISTORIC\_ACTIVITY\_INSTANCE\_ENDED. Where also the task itself has a separated ENTITY\_CREATED and it has a ENTITY\_DELETED. so seems a bug and inconsistency too.

4. ACTIVITY\_STARTED vs HISTORIC\_ACTIVITY\_INSTANCE\_CREATED  
oddly activity started does not include for some reason entity id, which makes it some how useless vesrus historic version of it which includes the entity. why is this?

code for event listening

```auto
@Configuration(proxyBeanMethods = false)
@AutoConfigureAfter(BootstrapConfiguration.class)
public class CustomEngineConfiguration {
    @Bean
    public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> customProcessEngineConfigurer(ApplicationContext context) {
        return (configuration) -> {
            SpringProcessEngineConfiguration cfg = context.getBean(SpringProcessEngineConfiguration.class);
            // Registro del listener del proceso
            PriBpmListener processListener = new PriBpmListener();
            if ( cfg.getEventDispatcher() == null ) {
                cfg.setEventDispatcher(new org.flowable.common.engine.impl.event.FlowableEventDispatcherImpl());
                cfg.getEventDispatcher().addEventListener(processListener);
                System.out.println("Event Dispatcher" + cfg.getEventDispatcher());
            }
        };
    }
}

```

Process example  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/b/b5df261055f2cfaa0f984aff76dc4f9b54ce9919.png)

log file example for these events streams [Flowable Event Log example · GitHub](https://gist.github.com/gustavomick/a1564661fbfe59180273c3e53353697c)

---

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:54pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/2 "2024-04-05T19:54:06Z")

</div>

1. ENTITY\_CREATED is dispatched twice for sequenceFlow  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/b/b36382995ba1a59c2f5c2b73668feb190d542276.png)

---

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:54pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/3 "2024-04-05T19:54:59Z")

</div>

1. ENTITY\_CREATED is dispatched twice for Event  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/b/b36382995ba1a59c2f5c2b73668feb190d542276.png)

---

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:55pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/4 "2024-04-05T19:55:42Z")

</div>

1. In case of the task, has a ENTITY\_CREATED for the activity of the task but no DELETED

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

---

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:58pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/5 "2024-04-05T19:58:54Z")

</div>

1. B) ENTITY\_DELETED  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/d/dbf54359510ec20bd7b3e1d31242b9022937265d.png)

---

<div class="post-metadata">

**Author:** ![gustavomick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/gustavomick/32/3454_2.png) [@gustavomick](https://forum.flowable.org/u/gustavomick)\
**Post date:** [April 5, 2024, 7:59pm UTC](https://forum.flowable.org/t/event-dispatching-issues-missing-id-in-activity-started-duplicated-entity-created-for-sequenceflow-and-events-and-missing-ending-for-task-activity/11402/6 "2024-04-05T19:59:25Z")

</div>

1. ACTIVITY\_STARTED vs HISTORIC\_ACTIVITY\_INSTANCE\_CREATED  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/6/6d1d2a7c13b49f823386ea5f27ccee536445aa04.png)
