# Cannot get process instance start time inside JavaDelegate

**URL:** <https://forum.flowable.org/t/cannot-get-process-instance-start-time-inside-javadelegate/3779>\
**Category:** Flowable Engine\
**Created:** [April 23, 2019, 12:23pm UTC](https://forum.flowable.org/t/cannot-get-process-instance-start-time-inside-javadelegate/3779 "2019-04-23T12:23:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TodoMary](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/todomary/32/1173_2.png) [@TodoMary](https://forum.flowable.org/u/TodoMary)\
**Post date:** [April 23, 2019, 12:23pm UTC](https://forum.flowable.org/t/cannot-get-process-instance-start-time-inside-javadelegate/3779/1 "2019-04-23T12:23:02Z")

</div>

In my process I use a JavaDelegate to save some information about the execution in a DB. The executions are scheduled to run each minute, and every time they finish they write on the DB. One of the informations I need to save is the total time of execution. The problem is that I can’t get the start time of my process. In fact, if I use `RuntimeService` inside the delegate, it throws nullpointerexception, and I think that is because it is `@Autowired` and doesn’t work when the flow is called by the timer event triggered after the deploy.  
I can only use `DelegateExecution`, but I couldn’t find a method to get the info.  
How can I retrieve this information?

---

<div class="post-metadata">

**Author:** ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)\
**Post date:** [April 24, 2019, 7:07am UTC](https://forum.flowable.org/t/cannot-get-process-instance-start-time-inside-javadelegate/3779/2 "2019-04-24T07:07:51Z")

</div>

Hi,

Yes you can use the info from the DelegateExecution.

```
ExecutionEntity processInstanceExecution = CommandContextUtil.getExecutionEntityManager().findById(execution.getProcessInstanceId());
Date startTime = processInstanceExecution.getStartTime();

```

In this way the cache is used to fetch the process instance execution.

Best regards,

Tijs
