Multi-instance Parallel Execution Managing Variables

I’m using Camunda 7.8 enterprise edition, and I’ve been searching the forum and on the Internet how to manage variables in a parent process after you’ve run a parallel async sub-process. So maybe this has been answered already, but I haven’t been able to find a post.

I have a list of objects that I’m iterating over, and after my subprocess is complete, I need to update each item as completed or failed (with fault information). Since I can’t merge the items into the parent list without getting the Optimistic Locking Exception, I attempted to use an ArrayList to add my objects from the subprocesses so I could update my parent variable later sequentially. However this also creates an Optimistic Locking Exception, which I am unable to catch in my code to be able to retry the operation, etc.

From the my searches, all I’ve been able to come up with is that I will have to run sequentially and have a task listener that will merge the objects back.

Is there any way I can create some sort of a list that can hold the updates from my subprocesses, so that I can update my main process after the subprocesses are finished, or is the only way available to handle this issue is by using sequential instead of parallel execution?

Or is there any way to configure the engine db (maria db v10.3.9) to create versions of the updates so they can all be applied w/o throwing the exception?

Did you ever get an answer to your query? I am trying to do parrallel processes my self.

No, I did not. We had to resort to creating one variable per item and then once we get back into a single thread, then we clean up the list and delete the variables.

We had created a support request to add the ability to aggregate the subprocess responses so it could cleanly return a single list to the parent process, but I think it got closed and I have not followed up on it.