# Call activity with execution listener to set out parameters

**URL:** <https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431>\
**Category:** Flowable Engine\
**Created:** [January 12, 2018, 11:56am UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431 "2018-01-12T11:56:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrej\_Zirko](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/andrej_zirko/32/209_2.png) [@Andrej\_Zirko](https://forum.flowable.org/u/Andrej_Zirko)\
**Post date:** [January 12, 2018, 11:56am UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/1 "2018-01-12T11:56:21Z")

</div>

Hello,  
We have a call activity, which should map output parameters dynamically. We are using start execution listener for this purpose, which sets out parameters on call activity.

This setup works fine, if there is no receive within the called process. If there is receive, the process dehydrates into database, but doesn’t store the out parameters configuration which was set. If the process is then triggered on another node, or the node is restarted, the out parameters are not set.

Is there a way how to persist dynamic out paramater configuration into database?

Thank you,  
Andrej

---

<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:** [January 15, 2018, 1:14pm UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/2 "2018-01-15T13:14:48Z")

</div>

Hi Andrej,

Could you share how you implemented this exactly. You didn’t use process variables for this?

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![Andrej\_Zirko](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/andrej_zirko/32/209_2.png) [@Andrej\_Zirko](https://forum.flowable.org/u/Andrej_Zirko)\
**Post date:** [January 23, 2018, 4:26pm UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/3 "2018-01-23T16:26:16Z")

</div>

> [@tijs](#):
>
> Could you share how you implemented this exactly. You didn’t use process variables for this?

I shared a [sample project on github](https://github.com/andrej-zirko/flowable-template-dynamic-variable).

The mapping itself is done in [this listener](https://github.com/andrej-zirko/flowable-template-dynamic-variable/blob/master/src/main/java/eu/zirko/flowable/StepImplCallParametersListener.java).

I’m using a template approach. When a template subprocess has generic tasks and then specific subprocess implementation. I need to map variables dynamically from template to implementation. Usually I have multiple template calls within one process.

I also provided a mapping unit test, which works when there is no receive and / or it is executed on single node.

---

<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:** [January 24, 2018, 11:19am UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/4 "2018-01-24T11:19:29Z")

</div>

Thanks, understand it now.  
The way you are using the execution listener to set the in and out parameters on a call activity indeed only works in synchronous processes, and it’s also not thread safe. If two process instances of this process definition are executed at the same time the same call activity instance will be changed by this execution listener.  
What we can do in a new version of Flowable is to provide a hookpoint to set the in and out parameters using a Java class / Spring bean / expression. That would solve this use case. What you can do right now is override the default call activity behaviour and set your custom version in the process engine configuration.

Best regards,

Tijs

---

<div class="post-metadata">

**Author:** ![Andrej\_Zirko](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/andrej_zirko/32/209_2.png) [@Andrej\_Zirko](https://forum.flowable.org/u/Andrej_Zirko)\
**Post date:** [January 24, 2018, 4:34pm UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/5 "2018-01-24T16:34:48Z")

</div>

Thank you, that would help us a lot.

Best regards,  
Andrej

---

<div class="post-metadata">

**Author:** ![Streamsoft-ecommerce](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/streamsoft-ecommerce/32/2140_2.png) [@Streamsoft-ecommerce](https://forum.flowable.org/u/Streamsoft-ecommerce)\
**Post date:** [December 15, 2020, 9:44pm UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/6 "2020-12-15T21:44:19Z")

</div>

Hello, in version 6.6 Flowable this hookpoint to set the in and out parameters exist ?

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [December 23, 2020, 10:14am UTC](https://forum.flowable.org/t/call-activity-with-execution-listener-to-set-out-parameters/1431/7 "2020-12-23T10:14:37Z")

</div>

Hey @Streamsoft-ecommerce,

Have a look at the [`StartProcessInstanceInterceptor`](https://github.com/flowable/flowable-engine/blob/master/modules/flowable-engine/src/main/java/org/flowable/engine/interceptor/StartProcessInstanceInterceptor.java) for intercepting the in parameters.

For the out parameters, for now you’ll need to use an execution listener and set variables on the execution.

Cheers,  
Filip
