New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT-24219: local variables before calling subprocess remains after en… #4596
base: 7.11.x
Are you sure you want to change the base?
MNT-24219: local variables before calling subprocess remains after en… #4596
Conversation
Optional<? extends ExecutionEntity> first = parentExecution.getParent().getExecutions().stream() | ||
.filter(executionEntity -> { | ||
// scoped execution of the current subprocess should not be considered | ||
return !executionEntity.getId().equals(parentExecution.getId()); | ||
} ) | ||
.findFirst(); | ||
if( first.isPresent() ) { | ||
new SubProcessVariableSnapshotter().setVariablesSnapshots(first.get(), executionToContinue); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic only works for some specific cases, but it cannot work in general: parentExecution.getParent().getExecutions()
may return several executions depending on the process design and peeking the first one could return the wrong one. Also, there is no guarantee that the execution we are looking for is still in the database at this point, as it's marked to be deleted in ContinueProcessOperation.createChildExecutionForSubProcess and depending on the process design it may or may not be there. For instance, if the subprocess has a user task or any flow node marked as async, the execution will be already deleted from the database when we reach this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've improved the fetch of the execution but it fails when a UserTask is inside of the subprocess: the execution was already deleted.
Pushed modifications in order to continue the discussion
…d of subprocess
What kind of change does this PR introduce?
Description
Does this PR introduce a breaking change? (check one with "x")