Skip to content

Transform JSON nodes of the other Jackson version when updating a variable - #4319

Open
filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:fix-json-variable-update-jackson-version
Open

filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:fix-json-variable-update-jackson-version

Conversation

@filiphr

@filiphr filiphr commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

When a variable is created with a JSON node of the other Jackson version (e.g. a Jackson 3 node with the Jackson 2 VariableJsonMapper), DefaultVariableInstanceValueModifier#setVariableValue transforms it to the node type of the variable json mapper. updateVariableValue did not, so when an existing variable was updated with such a node, the json type did not recognize it and the variable was silently changed to the serializable type. Reading it back returned the node of the other Jackson version, and JSON expressions and anything that excludes serializable variables no longer worked on it.

updateVariableValue now transforms the value in the same way as setVariableValue, through the new protected transformJsonValue method. Custom modifiers that override updateVariableValue and call super get this as well.

The tests cover updates with a node of the other Jackson version through RuntimeService and TaskService in BPMN and CMMN, with both the Jackson 2 and the default Jackson 3 mapper, and an update of a serializable variable that now switches to json.

Check List:

  • Unit tests: YES
  • Documentation: NA

…iable

When a variable was created with a JSON node of the other Jackson version (e.g. a Jackson 3 node
with the Jackson 2 variable json mapper), the node was transformed to the node type of the variable
json mapper. When an existing variable was updated, the node was not transformed, so it was not
recognized as json and was stored as a serializable variable instead.

DefaultVariableInstanceValueModifier now transforms the JSON value in updateVariableValue in the same
way as in setVariableValue.

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