@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);
  ProcessInstanceQuery query=runtimeService.createProcessInstanceQuery().variableValueEquals("doubleVar",12345.6789);
  List<ProcessInstance> processInstances=query.list();
  assertNotNull(processInstances);
  assertEquals(2,processInstances.size());
  query=runtimeService.createProcessInstanceQuery().variableValueEquals("doubleVar",12345.6789).variableValueEquals("doubleVar2",9876.54321);
  ProcessInstance resultInstance=query.singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance2.getId(),resultInstance.getId());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueEquals("doubleVar",9999.99).singleResult();
  assertNull(resultInstance);
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueNotEquals("doubleVar",12345.6789).singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance3.getId(),resultInstance.getId());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueGreaterThan("doubleVar",44444.4444).singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance3.getId(),resultInstance.getId());
  assertEquals(0,runtimeService.createProcessInstanceQuery().variableValueGreaterThan("doubleVar",55555.5555).count());
  assertEquals(3,runtimeService.createProcessInstanceQuery().variableValueGreaterThan("doubleVar",1.234).count());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueGreaterThanOrEqual("doubleVar",44444.4444).singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance3.getId(),resultInstance.getId());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueGreaterThanOrEqual("doubleVar",55555.5555).singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance3.getId(),resultInstance.getId());
  assertEquals(3,runtimeService.createProcessInstanceQuery().variableValueGreaterThanOrEqual("doubleVar",1.234).count());
  processInstances=runtimeService.createProcessInstanceQuery().variableValueLessThan("doubleVar",55555.5555).list();
  assertEquals(2,processInstances.size());
  List<String> expectedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
  List<String> ids=new ArrayList<String>(Arrays.asList(processInstances.get(0).getId(),processInstances.get(1).getId()));
  ids.removeAll(expectedIds);
  assertTrue(ids.isEmpty());
  assertEquals(0,runtimeService.createProcessInstanceQuery().variableValueLessThan("doubleVar",12345.6789).count());
  assertEquals(3,runtimeService.createProcessInstanceQuery().variableValueLessThan("doubleVar",66666.6666).count());
  processInstances=runtimeService.createProcessInstanceQuery().variableValueLessThanOrEqual("doubleVar",55555.5555).list();
  assertEquals(3,processInstances.size());
  assertEquals(0,runtimeService.createProcessInstanceQuery().variableValueLessThanOrEqual("doubleVar",12344.6789).count());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueEquals(55555.5555).singleResult();
  assertNotNull(resultInstance);
  assertEquals(processInstance3.getId(),resultInstance.getId());
  processInstances=runtimeService.createProcessInstanceQuery().variableValueEquals(12345.6789).list();
  assertEquals(2,processInstances.size());
  expectedIds=Arrays.asList(processInstance1.getId(),processInstance2.getId());
  ids=new ArrayList<String>(Arrays.asList(processInstances.get(0).getId(),processInstances.get(1).getId()));
  ids.removeAll(expectedIds);
  assertTrue(ids.isEmpty());
  resultInstance=runtimeService.createProcessInstanceQuery().variableValueEquals(999.999).singleResult();
  assertNull(resultInstance);
  runtimeService.deleteProcessInstance(processInstance1.getId(),"test");
  runtimeService.deleteProcessInstance(processInstance2.getId(),"test");
  runtimeService.deleteProcessInstance(processInstance3.getId(),"test");
}
