Skip to content

Map the definition id of the variables fetched by queries that include variables - #4309

Merged
filiphr merged 1 commit into
flowable:mainfrom
filiphr:query-variables-definition-id
Oct 15, 2026
Merged

filiphr merged 1 commit into
flowable:mainfrom
filiphr:query-variables-definition-id

Conversation

@filiphr

@filiphr filiphr commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

The variables of the process instance, historic process instance, task, historic task, case instance, historic case instance, plan item instance and historic plan item instance queries that include variables did not have the process or case definition id, so code that needed it for such a variable had to fetch the instance again.

  • The queryVariables collections of these queries now map the process definition id (BPMN) or the scope definition id (CMMN) of the instance to the variables, and use VAR_ID_ as notNullColumn, so an instance without variables gets an empty collection.
  • HistoricVariableInstance exposes getProcessDefinitionId() and getScopeDefinitionId(), like VariableInstance. They are not persisted and are also copied from the runtime variable when the historic variable is created or updated.
  • The task and historic task queries without included variables use a result map with only the identity links.
  • The CMMN task sets the scope definition id on its local variables, like the process definition id for BPMN tasks.

Check List:

  • Unit tests: YES
  • Documentation: NA

…e variables

The variables of the process instance, historic process instance, task, historic task, case instance,
historic case instance, plan item instance and historic plan item instance queries that include variables
did not have the process or case definition id, so code that needed it for such a variable had to fetch
the instance again.

- The queryVariables collections of these queries now map the process definition id (BPMN) or the scope
  definition id (CMMN) of the instance to the variables, and use VAR_ID_ as notNullColumn, so an instance
  without variables gets an empty collection.
- HistoricVariableInstance exposes getProcessDefinitionId() and getScopeDefinitionId(), like
  VariableInstance. They are not persisted and are also copied from the runtime variable when the historic
  variable is created or updated.
- The task and historic task queries without included variables use a result map with only the identity
  links.
- The CMMN task sets the scope definition id on its local variables, like the process definition id for
  BPMN tasks.
@filiphr
filiphr merged commit 1f81d96 into flowable:main Oct 15, 2026
3 checks passed
@filiphr
filiphr deleted the query-variables-definition-id branch October 15, 2026 15:56
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