-
Notifications
You must be signed in to change notification settings - Fork 487
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
Result variables shouldn't be merged into the process instance when output mappings exist #4737
Comments
I've added "related" part to the additional context part. I can reproduce the issue. I've also confirmed that the runtime behaviour is as described in the doc. |
Perhaps it makes sense to tackle this together with #4614? What do you think @abdul99ahad ? |
I'm not sure if we could tackle this together. To my understanding, issue #4614 is about parsing the result variables and this is about handling the scope of variables. Let me know if you think otherwise. |
@abdul99ahad Should we put this in |
Added in |
To clarify: this is NOT a part of the v5.31.0 release 👍 |
Describe the bug
When a script task has output mappings defined, only the variables specified in the output mappings should be merged into the process instance. However, the current behavior merges all result variables into the process instance, even when output mappings exist. This leads to unintended variables being accessible at the process level, violating the expected scoping rules.
Here, we shouldn't get
foo
in the suggestions as output mappings already exists andfoo
is a result variable.See Camunda docs
If one or more output mappings are defined, the results variables are set as local variables in the scope where the mapping is defined. Then, the output mappings are applied to the variables and create new variables in this scope. The new variables are merged into the parent scope. If there is no mapping for a job/message variable, the variable is not merged.
If no output mappings are defined, all results variables are merged into the process instance.
this issue first discussed in #4614
Steps to reproduce
Expected behavior
Environment
Additional context
Related to #4614
The text was updated successfully, but these errors were encountered: