HistoricProcessInstanceQuery also query task variable
See original GitHub issueDescribe the bug when use HistoricProcessInstanceQuery with variable value, it also query query task variable with the same name
Expected behavior HistoricProcessInstanceQuery only query process variable
Code
HistoricProcessInstanceQuery query = historyService
.createHistoricProcessInstanceQuery()
.processInstanceId("abc")
.includeProcessVariables();
query.variableValueEquals("process_variable", "process_variable_value");
query.count();
this query produce a sql :
select
count(distinct RES.ID_)
from
ACT_HI_PROCINST RES
left outer join ACT_RE_PROCDEF DEF on RES.PROC_DEF_ID_ = DEF.ID_
inner join ACT_HI_VARINST A0 on RES.PROC_INST_ID_ = A0.PROC_INST_ID_
WHERE
RES.PROC_INST_ID_ = ?
and A0.NAME_ = ?
and A0.VAR_TYPE_ = ?
and (A0.TEXT_ = ?)
the right sql should be
select
count(distinct RES.ID_)
from
ACT_HI_PROCINST RES
left outer join ACT_RE_PROCDEF DEF on RES.PROC_DEF_ID_ = DEF.ID_
inner join ACT_HI_VARINST A0 on RES.PROC_INST_ID_ = A0.PROC_INST_ID_
WHERE
RES.PROC_INST_ID_ = ?
and A0.NAME_ = ?
and A0.VAR_TYPE_ = ?
and (A0.TEXT_ = ?)
and A0.TASK_ID_ IS NULL
Additional context
flowable: 6.6.0 , 6.7.0
database: mysql
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
HistoryService (Camunda BPM Javadocs 7.11.21-ee)
Deletes historic process instances asynchronously based on query. All historic activities, historic task and historic details (variable updates, ...
Read more >History · Flowable Open Source Documentation
In the API, it's possible to query all 6 of the History entities. ... Task local variables can be set using the TaskService...
Read more >How to use variableValueEquals method in org.camunda.bpm ...
Only select process instances which have a variable value greater than the passed value. The type only applies to already ended process instances,...
Read more >Historical Variable Query to get task's local ... - Camunda forum
How to use historicalVariableInstanceQuery to access task local variables after task completed?
Read more >Fetch the process instances by passing the multipl...
Hello, I have one process which has task and form fields. ... The query will check for process instances that have all the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ningpp , the issue is fixed now. Thanks for reporting
Hi @ningpp , we think your analysis is correct, thanks for creating the issue. We will look into it.