code: @Deployment(resources={"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"}) public void testQueryIntegerVariable(){
    Map<String,Object> vars=new HashMap<String,Object>();
    vars.put("integerVar",12345);
    ProcessInstance processInstance1=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
    vars=new HashMap<String,Object>();
    vars.put("integerVar",12345);
    vars.put("integerVar2",67890);
    ProcessInstance processInstance2=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
    vars=new HashMap<String,Object>();
    vars.put("integerVar",55555);
    ProcessInstance processInstance3=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
    ExecutionQuery query=runtimeService.createExecutionQuery().variableValueEquals("integerVar",12345);
    List<Execution> executions=query.list();
    assertNotNull(executions);
    assertEquals(2,executions.size());
    query=runtimeService.createExecutionQuery().variableValueEquals("integerVar",12345).variableValueEquals("integerVar2",67890);
    Execution execution=query.singleResult();
    assertNotNull(execution);
    assertEquals(processInstance2.getId(),execution.getId());
    execution=runtimeService.createExecutionQuery().variableValueEquals("integerVar",9999).singleResult();
    assertNull(execution);
    execution=runtimeService.createExecutionQuery().variableValueNotEquals("integerVar",12345).singleResult();
    assertNotNull(execution);
    assertEquals(processInstance3.getId(),execution.getId());
    execution=runtimeService.createExecutionQuery().variableValueGreaterThan("integerVar",44444).singleResult();
    assertNotNull(execution);
    assertEquals(processInstance3.getId(),execution.getId());
    assertEquals(0,runtimeService.createExecutionQuery().variableValueGreaterThan("integerVar",55555).count());
    assertEquals(3,runtimeService.createExecutionQuery().variableValueGreaterThan("integerVar",1).count());
    execution=runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("integerVar",44444).singleResult();
    assertNotNull(execution);
    assertEquals(processInstance3.getId(),execution.getId());
    execution=runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("integerVar",55555).singleResult();
    assertNotNull(execution);
    assertEquals(processInstance3.getId(),execution.getId());
    assertEquals(3,runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("integerVar",1).count());
    executions=runtimeService.createExecutionQuery().variableValueLessThan("integerVar",55555).list();
    assertEquals(2,executions.size());
    List<String> expectedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
    List<String> ids=new ArrayList<String>(Arrays.asList(executions.get(0).getId(),executions.get(1).getId()));
    ids.removeAll(expectedIds);
    assertTrue(ids.isEmpty());
    assertEquals(0,runtimeService.createExecutionQuery().variableValueLessThan("integerVar",12345).count());
    assertEquals(3,runtimeService.createExecutionQuery().variableValueLessThan("integerVar",66666).count());
    executions=runtimeService.createExecutionQuery().variableValueLessThanOrEqual("integerVar",55555).list();
    assertEquals(3,executions.size());
    assertEquals(0,runtimeService.createExecutionQuery().variableValueLessThanOrEqual("integerVar",12344).count());
    execution=runtimeService.createExecutionQuery().variableValueEquals(55555).singleResult();
    assertNotNull(execution);
    assertEquals(processInstance3.getId(),execution.getId());
    executions=runtimeService.createExecutionQuery().variableValueEquals(12345).list();
    assertEquals(2,executions.size());
    expectedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
    ids=new ArrayList<String>(Arrays.asList(executions.get(0).getId(),executions.get(1).getId()));
    ids.removeAll(expectedIds);
    assertTrue(ids.isEmpty());
    execution=runtimeService.createExecutionQuery().variableValueEquals(99999).singleResult();
    assertNull(execution);
    runtimeService.deleteProcessInstance(processInstance1.getId(),"test");
    runtimeService.deleteProcessInstance(processInstance2.getId(),"test");
    runtimeService.deleteProcessInstance(processInstance3.getId(),"test");
  }
  