fix: resolve path expression on Any-typed plain variable as Any, not Null#99
Closed
fix: resolve path expression on Any-typed plain variable as Any, not Null#99
Conversation
Related to #87 Path FEEL expressions like `=agent.context` on an `Any`-typed variable incorrectly resolve as `null` with `Null` type instead of `Any`.
6 tasks
|
|
Co-authored-by: barmac <28307541+barmac@users.noreply.github.com>
…le resolves to Null Also fix: extend Any-type detection to handle plain variable objects (not just EntriesContext instances) The previous code only checked `entry instanceof EntriesContext`, but scopedContext.entries may also contain plain variable objects from toOptimizedFormat (external provider variables). These plain objects can be Any-typed, and accessing a path expression on them would incorrectly resolve to Null instead of Any. The fix uses `entry instanceof EntriesContext ? entry.value : entry` to handle both cases, with a defensive null check for missing entries. Co-authored-by: barmac <28307541+barmac@users.noreply.github.com>
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] [WIP] Add test case for path expression resolution on Any-typed variable feedback
fix: resolve path expression on Any-typed plain variable as Any, not Null
Mar 18, 2026
Member
|
I think we are good without it. The library exposes the EntriesContext, so anybody can use it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Any-type detection for path expressions only handled
EntriesContextinstances, missing the case wherescopedContext.entries[name]holds a plain variable object fromtoOptimizedFormat(e.g. an external provider variable). In that case,=agent.contextwhereagentisAny-typed would incorrectly resolve toNull.The masking factor: the existing test fixture had both an input (
=agent.context) and output (=agent) mapping. Sorting caused the output to be resolved first, converting the plain object to anEntriesContextbefore the path expression was evaluated — hiding the bug.Changes
test/fixtures/zeebe/mappings/path-expression-on-any-variable.bpmn— new fixture with only the input mapping=agent.context → agentContext, no output mapping, to surface the bug directlytest/spec/zeebe/Mappings.spec.js— new test: external provider suppliesagentas a plainAny-typed variable; assertsagentContextresolves toAnylib/zeebe/util/feelUtility.js— extend Any-type detection to handle plain variable objects alongsideEntriesContextinstances, with a defensive null guard:💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.