bpmn-io / bpmn-io/variable-resolver
Variables consumed by flow element expressions not reconciled with scoped declarations
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 8h 41m
- Merged PRs (30d)
- 3
Description
### Describe the Bug
Variables consumed by flow element expressions are not reconciled with their scoped written declarations. They remain scopeless in the output even when a matching written variable exists in the process.
This happens because `extractConsumedVariablesFromElements` runs after `parseVariables` Step 5 (bridge consumed usages back to uniquely scoped declarations), so its results bypass `annotateConsumedUsagesToScopedVariables` entirely.
### Steps to Reproduce
1. Create a process with a service task that writes a variable via output mapping (e.g. `managerReviewOutcome`)
2. Add a sequence flow with a condition expression that reads that variable (e.g. `= managerReviewOutcome = "approved"`)
3. Call `getVariables` on the process
Visualization from variable-outline perspective
### Expected Behavior
The consumed variable from the sequence flow condition should be reconciled with the scoped written declaration so that it appears as a `usedBy` entry on the written variable rather than as a separate scopeless variable.
### Environment
- Library version: 3.0.1
Contributor guide
Assessment
This issue has not been assessed yet.