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?
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.