Skip to content

Support static input values#83

Merged
nikku merged 1 commit intomainfrom
static-values
Feb 26, 2026
Merged

Support static input values#83
nikku merged 1 commit intomainfrom
static-values

Conversation

@nikku
Copy link
Member

@nikku nikku commented Feb 25, 2026

Proposed Changes

Rework the original implementation in this PR to handle static values in a robust manner - do not escape ", nor do any parsing when we know the result is a string literal value.

Closes #81

Checklist

Ensure you provide everything we need to review your contribution:

  • Contribution meets our definition of done
  • Pull request establishes context
    • Link to related issue(s), i.e. Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}
    • Brief textual description of the changes
    • Screenshots or short videos showing UI/UX changes
    • Steps to try out, i.e. using the @bpmn-io/sr tool

@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Feb 25, 2026
@nikku
Copy link
Member Author

nikku commented Feb 25, 2026

Failing due to insufficient escaping of " inside of strings (#81).

@nikku nikku requested a review from barinali February 25, 2026 20:45
@nikku nikku marked this pull request as ready for review February 25, 2026 20:46
@nikku nikku requested review from a team, Buckwich and Copilot February 25, 2026 20:46
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Feb 25, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses issue #81 by adding support for static input values in IO mappings. Previously, the code assumed all mapping source expressions started with = and stripped this prefix. This caused problems when users entered static values (without =) containing quotation marks, as the variable info property would be empty instead of showing the static value.

Changes:

  • Modified getResultContext to detect static values (no = prefix) and handle them as string literals using .literal() method
  • Removed .substring(1) calls from getIoExpression and getScriptExpression to preserve the full expression including the = prefix
  • Updated getResultContext in connectors.js to handle expressions that may or may not have the = prefix

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/zeebe/util/feelUtility.js Core logic changes to distinguish static values from FEEL expressions and handle each appropriately
lib/zeebe/extractors/connectors.js Updated to work with the new signature of getResultContext
test/fixtures/zeebe/ioMappings.static.bpmn New test fixture with static input values, including edge case with quotes
test/spec/zeebe/ZeebeVariableResolver.spec.js New test suite to verify static values are correctly resolved with proper type and info

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// expression is a static value
if (!expression.startsWith('=')) {

// TODO(nikku): completely unsafe stuff, don't do, remove ASAP
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment indicates this implementation is "completely unsafe" and should be "removed ASAP". This suggests the current approach using contextTracker.start.literal() may be a temporary workaround. Consider documenting why this approach is unsafe and what the proper solution should be, or addressing the underlying issue before merging.

Suggested change
// TODO(nikku): completely unsafe stuff, don't do, remove ASAP
// NOTE: For expressions without a leading '=', we intentionally treat the
// value as a FEEL string literal and construct it directly via
// EntriesContext.literal(). This mirrors how static literals are handled
// by the FEEL engine without going through the parser. Be aware that
// this will not perform any additional validation beyond what
// EntriesContext.literal() itself enforces.

Copilot uses AI. Check for mistakes.
@nikku nikku force-pushed the static-values branch 2 times, most recently from a06f79e to daedae0 Compare February 25, 2026 21:34
* Ensure we don't eagerly cut of `=`, because we need to determine
  whether the expression is a string during evaluation
* For string values, treat the result as a literal string, do not
  attempt any parsing / evaluation (!)

Closes #81
Copy link
Contributor

@barinali barinali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plain text content is rendered as expected.

Image

@nikku nikku merged commit 6f0f392 into main Feb 26, 2026
3 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Feb 26, 2026
@nikku nikku deleted the static-values branch February 26, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quotation marks break variable.info resolution in plain text variables

3 participants