Skip to content

Expose plain values for JSON array elements in multi instance and repetition collections - #4317

Open
filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:unwrap-json-collection-elements
Open

filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:unwrap-json-collection-elements

Conversation

@filiphr

@filiphr filiphr commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

When a JSON array is used as the collection of a BPMN multi instance or a CMMN collection repetition, the element variable was set to the Jackson value node. Using it in an expression such as flowable:assignee="${assignee}" gave the JSON representation ("kermit", including the quotes) instead of the plain value.

JSON value nodes (text, number, boolean, null) are now set as plain Java values (String, Integer, Long, Double, BigDecimal, BigInteger, Boolean, null). Object and array elements are kept as JSON nodes. This works for both Jackson 2 and Jackson 3.

To stay backwards compatible, the new JsonValueNodeMethodsELResolver keeps the Jackson value node accessor methods (e.g. asText(), asString(), textValue(), asInt(), isTextual()) working on String, Number and Boolean values. It is registered in the DefaultExpressionManager and the JuelScriptEngine. The methods behave like the Jackson 2 value node methods, which are more lenient than the Jackson 3 ones. One consequence: with Jackson 3, the methods with a default value (e.g. asInt(9)) now coerce the value like Jackson 2 does (" 12 ".asInt(9) returns 12 instead of 9).

The tests run through the engine and compare every supported method on the element with the same method on the original Jackson 2 or Jackson 3 node.

Check List:

  • Unit tests: YES
  • Documentation: YES

…etition collections

JSON value nodes (text, number, boolean, null) used as the element variable of a
BPMN multi instance or CMMN collection repetition are now set as plain Java values.
Jackson value node accessor methods (e.g. asText(), asString(), asInt(), isTextual())
keep working on String, Number and Boolean values through a new EL resolver.

This branch has not been deployed

No deployments
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.

1 participant