AnsweredAssumed Answered

Certain execution queries returns 0 results.

Question asked by andreasa on Feb 11, 2013
Latest reply on Feb 12, 2013 by frederikheremans1
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")

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();