Feedback for embedded Sub Processes

Hi Camunda Community,

first time poster here :slight_smile:

I am currently modelling a process for my Bachelor Thesis and wanted to provide feedback.
Is it possible to use a subprocess and pass all my values as “Call by reference” instead of “Call by value”?
My use case is that I want to check the status of a variable throughout a few hierarchies deep. Every time the variable changes a Subprocess on the highest level should be triggered .

I tried my best to find a workaround but couldnt actually find one. After talking to my Professor he told me that this was not actually possible without creating such a supervising event-subprocess in every hierarchy.

I hope somebody has a solution to my problem or at least I could provide some feedback :slight_smile:

Just thinking out loud here, because I haven’t been able to test this. If I understand correctly, what you need is to trigger that event subprocess at the root of the hierarchy whenever there is a change to a certain variable somewhere down the hierarchy of spawned sub processes (and from the looks of it, you’re using call activities to do so). You also don’t want to create a kind of try-catch-throw mechanism at every level in the hierarchy just for this purpose.

What might work to accomplish that is to implement an (additional) history backend that ignores pretty much every event that flies by, but triggers specifically when it’s an update of your target variable. In that case, you send a signal through the API that the variable was updated. If you update your root process’ event sub process to have a signal start event instead of the conditional, it could be triggered by the signal sent.

BTW, the reason your current approach will not work is because the scope of variables in the sub processes created from the call activity is completely separate from that of the invoking process, as you probably already realised. The only way for them to “share” variables is through input and output mappings or through some convoluted custom code that manipulates variables in the other process through the API. But the variable updates you configure on the conditional event really only apply to that variable value in the root process.

Thank you very much for the reply, really appreciate it :slight_smile:
Considering the relatively small scope of the whole process (about 10 Tasks), I can probably fit all my processes into one diagram.
Nonetheless a solution with collapsing non-calling subprocesses from Camunda would still be really nice.