-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: script task result variable scope redefines if output mapping exists #30
base: main
Are you sure you want to change the base?
Conversation
67cdf23
to
3322ea3
Compare
// Checks if output variable exists, the scope gets redefined | ||
if (processVariables.some(x => x.origin[0] === element && x.scope === containerElement)) { | ||
|
||
// result variable will have local scope | ||
containerElement = element; | ||
} | ||
|
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.
[suggestion] Let's add an example to the functions JSDoc
Since this pull request applies to Business Rule Task implemented as a DMN decision, I'd suggest to add a respective test case, and document it in the pull request. When this is done, I think it's ready to merge. Great job :) |
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.
Approved with comment above :)
3322ea3
to
cbad563
Compare
Related to: camunda-modeler #4737
Proposed Changes
Script Task
If output mapping exists, result variable scope should be local.
If output mapping doesn't exist, result variable scope is global.
You can test the implementation by running this command:
npx @bpmn-io/sr bpmn-io/variable-resolver#variable-scoping -l bpmn-io/extract-process-variables#script-variable-scope
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}