question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HistoricProcessInstanceQuery also query task variable

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tijsrademakerscommented, Dec 23, 2021

Hi @ningpp , the issue is fixed now. Thanks for reporting

1reaction
tijsrademakerscommented, Nov 26, 2021

Hi @ningpp , we think your analysis is correct, thanks for creating the issue. We will look into it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found