cancel
Showing results for 
Search instead for 
Did you mean: 

Certain execution queries returns 0 results.

andreasa
Champ in-the-making
Champ in-the-making
I'm trying to query for executions that have a certain process variable, and that is waiting for a signal.

List<Execution> executions = runtimeService.createExecutionQuery()
      .variableValueEquals("caseId", 123456L)
      .signalEventSubscriptionName("My Signal")
      .list();

This always returns 0 results. If I query for one or the other I get 1 result.

I don't know if this is intended or if it is an error.

I suppose a quick and dirty solution would be to query in sql:

List<Execution> executions = runtimeService.createNativeExecutionQuery()
.sql(select * from act_ru_execution ex
join act_ru_event_subscr sub on sub.execution_id_ = ex.id_
join act_ru_variable rv on ex.proc_inst_id_ = rv.proc_inst_id_
where name_ = 'caseId' and long_ = 123456 and sub.event_name_= 'My Signal').list();
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
I don't see anything suspicious at first sight, it's just 2 inner-joins on different tables.

Can you perhaps create a Jira-issue for this and attach a unit-test to it? That would help us a lot…