@Deployment(resources={"org/activiti/engine/test/api/oneTaskProcess.bpmn20.xml"}) public void testQueryDoubleVariable(){
  Map<String,Object> vars=new HashMap<String,Object>();
  vars.put("doubleVar",12345.6789);
  ProcessInstance processInstance1=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
  vars=new HashMap<String,Object>();
  vars.put("doubleVar",12345.6789);
  vars.put("doubleVar2",9876.54321);
  ProcessInstance processInstance2=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
  vars=new HashMap<String,Object>();
  vars.put("doubleVar",55555.5555);
  ProcessInstance processInstance3=runtimeService.startProcessInstanceByKey("oneTaskProcess",vars);
  ExecutionQuery query=runtimeService.createExecutionQuery().variableValueEquals("doubleVar",12345.6789);
  List<Execution> executions=query.list();
  assertNotNull(executions);
  assertEquals(2,executions.size());
  query=runtimeService.createExecutionQuery().variableValueEquals("doubleVar",12345.6789).variableValueEquals("doubleVar2",9876.54321);
  Execution execution=query.singleResult();
  assertNotNull(execution);
  assertEquals(processInstance2.getId(),execution.getId());
  execution=runtimeService.createExecutionQuery().variableValueEquals("doubleVar",9999.99).singleResult();
  assertNull(execution);
  execution=runtimeService.createExecutionQuery().variableValueNotEquals("doubleVar",12345.6789).singleResult();
  assertNotNull(execution);
  assertEquals(processInstance3.getId(),execution.getId());
  execution=runtimeService.createExecutionQuery().variableValueGreaterThan("doubleVar",44444.4444).singleResult();
  assertNotNull(execution);
  assertEquals(processInstance3.getId(),execution.getId());
  assertEquals(0,runtimeService.createExecutionQuery().variableValueGreaterThan("doubleVar",55555.5555).count());
  assertEquals(3,runtimeService.createExecutionQuery().variableValueGreaterThan("doubleVar",1.234).count());
  execution=runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("doubleVar",44444.4444).singleResult();
  assertNotNull(execution);
  assertEquals(processInstance3.getId(),execution.getId());
  execution=runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("doubleVar",55555.5555).singleResult();
  assertNotNull(execution);
  assertEquals(processInstance3.getId(),execution.getId());
  assertEquals(3,runtimeService.createExecutionQuery().variableValueGreaterThanOrEqual("doubleVar",1.234).count());
  executions=runtimeService.createExecutionQuery().variableValueLessThan("doubleVar",55555.5555).list();
  assertEquals(2,executions.size());
  List<String> expecedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
  List<String> ids=new ArrayList<String>(Arrays.asList(executions.get(0).getId(),executions.get(1).getId()));
  ids.removeAll(expecedIds);
  assertTrue(ids.isEmpty());
  assertEquals(0,runtimeService.createExecutionQuery().variableValueLessThan("doubleVar",12345.6789).count());
  assertEquals(3,runtimeService.createExecutionQuery().variableValueLessThan("doubleVar",66666.6666).count());
  executions=runtimeService.createExecutionQuery().variableValueLessThanOrEqual("doubleVar",55555.5555).list();
  assertEquals(3,executions.size());
  assertEquals(0,runtimeService.createExecutionQuery().variableValueLessThanOrEqual("doubleVar",12344.6789).count());
  execution=runtimeService.createExecutionQuery().variableValueEquals(55555.5555).singleResult();
  assertNotNull(execution);
  assertEquals(processInstance3.getId(),execution.getId());
  executions=runtimeService.createExecutionQuery().variableValueEquals(12345.6789).list();
  assertEquals(2,executions.size());
  expecedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
  ids=new ArrayList<String>(Arrays.asList(executions.get(0).getId(),executions.get(1).getId()));
  ids.removeAll(expecedIds);
  assertTrue(ids.isEmpty());
  execution=runtimeService.createExecutionQuery().variableValueEquals(9999.9999).singleResult();
  assertNull(execution);
  runtimeService.deleteProcessInstance(processInstance1.getId(),"test");
  runtimeService.deleteProcessInstance(processInstance2.getId(),"test");
  runtimeService.deleteProcessInstance(processInstance3.getId(),"test");
}
