# How to pass StartedByUser from parent process to subprocess using call activity

**URL:** <https://forum.flowable.org/t/how-to-pass-startedbyuser-from-parent-process-to-subprocess-using-call-activity/7282>\
**Category:** Flowable Application\
**Created:** [January 7, 2021, 7:38pm UTC](https://forum.flowable.org/t/how-to-pass-startedbyuser-from-parent-process-to-subprocess-using-call-activity/7282 "2021-01-07T19:38:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![majid.raoofshahir](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@majid.raoofshahir](https://forum.flowable.org/u/majid.raoofshahir)\
**Post date:** [January 7, 2021, 7:38pm UTC](https://forum.flowable.org/t/how-to-pass-startedbyuser-from-parent-process-to-subprocess-using-call-activity/7282/1 "2021-01-07T19:38:54Z")

</div>

I am using a Call Activity in a process and when the child process gets created the Started By User is null. Is it possible to pass the Starter from parent to child process?

---

<div class="post-metadata">

**Author:** ![VasilTsimashchuk](https://avatars.discourse-cdn.com/v4/letter/v/ed655f/32.png) [@VasilTsimashchuk](https://forum.flowable.org/u/VasilTsimashchuk)\
**Post date:** [January 13, 2021, 12:31pm UTC](https://forum.flowable.org/t/how-to-pass-startedbyuser-from-parent-process-to-subprocess-using-call-activity/7282/2 "2021-01-13T12:31:15Z")

</div>

Hi,

we actually had a similar use case and came up with the solution where we extend the existing org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior.

There we have overridden the execute method in the way similar to following:

```
@Override
public void execute(DelegateExecution execution) {
    String originalUserId = Authentication.getAuthenticatedUserId();

    try {
        Authentication.setAuthenticatedUserId(getUserToPropagate(execution));
        super.execute(execution);
    } finally {
        Authentication.setAuthenticatedUserId(originalUserId);
    }
}

private String getUserToPropagate(DelegateExecution execution) {
         HistoricProcessInstanceEntity historicProcessInstanceEntity = CommandContextUtil.getHistoricProcessInstanceEntityManager()
            .findById(execution.getProcessInstanceId());
         return historicProcessInstanceEntity.getStartUserId();
}
```

---

<div class="post-metadata">

**Author:** ![majid.raoofshahir](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@majid.raoofshahir](https://forum.flowable.org/u/majid.raoofshahir)\
**Post date:** [January 14, 2021, 3:07pm UTC](https://forum.flowable.org/t/how-to-pass-startedbyuser-from-parent-process-to-subprocess-using-call-activity/7282/3 "2021-01-14T15:07:37Z")

</div>

Thanks for response Vasil, This will change the behavior of call activity and will have impact in all call activity. But I wanted to do this in specific workflow process. For now I fixed it by adding a new variable “startedById” to main process and passed it to child process. It is working, although I don’t like it.
