# DelegateExecution::getCurrentActivityId returns null

**URL:** <https://forum.flowable.org/t/delegateexecution-getcurrentactivityid-returns-null/2497>\
**Category:** Uncategorized\
**Created:** [September 3, 2018, 1:57pm UTC](https://forum.flowable.org/t/delegateexecution-getcurrentactivityid-returns-null/2497 "2018-09-03T13:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enchobelezirev](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/enchobelezirev/32/604_2.png) [@enchobelezirev](https://forum.flowable.org/u/enchobelezirev)\
**Post date:** [September 3, 2018, 1:57pm UTC](https://forum.flowable.org/t/delegateexecution-getcurrentactivityid-returns-null/2497/1 "2018-09-03T13:57:57Z")

</div>

Hello experts,

I have the following diagram(I will explain it below):  
There is a SubProcess element in which there is a CallActivity. The SubProcess is NOT asynchronous but the CallActivity IS asynchronous. The process definition which the CallActivity starts has a JavaDelegate ServiceTask which invokes the method getCurrentActivityId of the DelegateExecution and uses the Id for reporting.  
The problem is that the getCurrentActivityId is returning null. What I have observed in the database is that, when the CallActivity is being started, two executions are being created for the CallActivity - one with activityId = null and the other with activityId = ‘id of the CallActivity’ . I do not know whether this might be the problem here - just sharing with you what I have observed in the database 🙂

Could you give me a hint what could be done here?

Also, when an error in such scenario is thrown, the process is not finished. I can see in the database that the endTime is NULL and moreover when I query the process instance from the RuntimeService and check the isEnded method it returns false.

Could you also give me a hint here?

Thanks,  
Encho

---

<div class="post-metadata">

**Author:** ![enchobelezirev](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/enchobelezirev/32/604_2.png) [@enchobelezirev](https://forum.flowable.org/u/enchobelezirev)\
**Post date:** [September 5, 2018, 8:16am UTC](https://forum.flowable.org/t/delegateexecution-getcurrentactivityid-returns-null/2497/2 "2018-09-05T08:16:30Z")

</div>

Hello,

Could you give me some update here?  
I am also experiencing this using CallActivity - not only with SubProcess.

Thanks
