Skip to content

Follow-ups for disabling serializable variables by default - #4337

Open
filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:serializable-variables-review-follow-ups
Open

filiphr wants to merge 1 commit into
flowable:mainfrom
filiphr:serializable-variables-review-follow-ups

Conversation

@filiphr

@filiphr filiphr commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up to "Disable serializable variables by default" (1c9e84d), addressing findings from reviewing that change.

Changes

  • REST variable data endpoints: the type of the variable is validated before its value is resolved. With the default configuration (serializable variables disabled in the engine and not allowed in the REST API) the endpoints return a 415 response instead of a 500 response, and no serializable variable is deserialized before the request is rejected. This applies to all data endpoints in flowable-rest and flowable-cmmn-rest.
  • Untyped JSON object or array values: a variable with a JSON object or array as value and no type is rejected with a 400 response, since such a value could only be stored using Java serialization. The json type needs to be used instead. This applies to the BPMN, CMMN and external job REST APIs. Transient variables are not affected.
  • Overwriting existing serializable variables: the old value of a variable is only read when a logging session is enabled. An existing serializable variable can now be overwritten with a value of another type when serializable variables are disabled.
  • Logging session: the value of a serializable variable that cannot be read is no longer read, such a variable is logged without its value. Removing a serializable variable with a logging session enabled no longer fails.
  • Business rule task: a warning is logged when the result is only stored as a transient variable.
  • API docs: restore the @ApiResponses of the historic process and case instance variable data endpoints.
  • Import order fixes.

Behavior changes to be aware of

  • The rejection of untyped JSON object and array values is unconditional, it also applies when the serializable variable type mode is ENABLED.
  • In DISABLED mode an existing serializable variable can be overwritten with a value of another type (this failed before).

Tests

  • SerializableVariablesDefaultConfigurationTest in flowable-rest and flowable-cmmn-rest: no property set and a DISABLED engine, covering create, every data endpoint and untyped JSON values.
  • The existing REST disabled tests also cover the historic task and historic detail data endpoints.
  • SerializableVariableTypeModeTest for the CMMN engine and the v5 engine, and new cases for the BPMN engine (overwrite in DISABLED, overwrite and remove with a logging session).
  • Negative test for the string only filter of JPAEntityListVariableType.
  • FloatVariableTest for the CMMN engine, float variable test for the v5 engine.

- The REST variable data endpoints validate the type of the variable before resolving its value. With
  the default configuration (serializable variables disabled in the engine and not allowed in the
  REST API) they return a 415 response instead of a 500 response, and no serializable variable is
  deserialized before the request is rejected.
- A variable with a JSON object or array as value and no type is rejected with a 400 response in the
  REST API, since such a value could only be stored using Java serialization. The json type needs to
  be used instead. This does not apply to transient variables.
- The old value of a variable is only read when a logging session is enabled. This allows overwriting
  an existing serializable variable with a value of another type when serializable variables are
  disabled. The logging session no longer reads the value of a serializable variable that cannot be
  read, such a variable is logged without its value.
- The Drools based business rule task logs a warning when its result is only stored as a transient
  variable.
- Restore the API responses documentation of the historic process and case instance variable data
  endpoints.
- Add tests for the serializable variable type mode in the CMMN and v5 engines, for the default
  configuration of the REST API, for the string only filter of the JPA entity list variable type and
  for float variables in the CMMN and v5 engines.

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