vars = new HashMap<String, Object>();
vars.put("stringVar", "azerty");
ProcessInstance processInstance3 = runtimeService.startProcessInstanceByKey("oneTaskProcess", vars);
// Test EQUAL on single string variable, should result in 2 matches
ExecutionQuery query = runtimeService.createExecutionQuery().variableValueEquals("stringVar", "abcdef");
List<Execution> executions = query.list();
assertNotNull(executions);
assertEquals(2, executions.size());
// Test EQUAL on two string variables, should result in single match
query = runtimeService.createExecutionQuery().variableValueEquals("stringVar", "abcdef").variableValueEquals("stringVar2", "ghijkl");
Execution execution = query.singleResult();
assertNotNull(execution);
assertEquals(processInstance2.getId(), execution.getId());
// Test NOT_EQUAL, should return only 1 execution
execution = runtimeService.createExecutionQuery().variableValueNotEquals("stringVar", "abcdef").singleResult();