Call activity with execution listener to set out parameters

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

Hi Andrej,

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

Best regards,

Tijs

I shared a sample project on github.

The mapping itself is done in this listener.

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.

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

Thank you, that would help us a lot.

Best regards,
Andrej

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

Hey @Streamsoft-ecommerce,

Have a look at the StartProcessInstanceInterceptor 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