Package org.camunda.bpm.engine.runtime

Examples of org.camunda.bpm.engine.runtime.VariableInstanceQuery


    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("stringVar", "test");
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableValueEquals("stringVar", "notFoundValue");

    // then
    List<VariableInstance> result = query.list();
    assertTrue(result.isEmpty());

    assertEquals(0, query.count());
  }
View Full Code Here


    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("nullValue", null);
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableValueEquals("nullValue", null);

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(1, result.size());

    assertEquals(1, query.count());

    VariableInstance var = result.get(0);
    assertEquals("nullValue", var.getName());
    assertEquals(null, var.getValue());
    assertEquals("null", var.getTypeName());
View Full Code Here

    Map<String, Object> variables3 = new HashMap<String, Object>();
    variables3.put("value", "abc");
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables3);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableValueNotEquals("value", null);

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(2, result.size());

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertEquals("value", var.getName());
      if (var.getValue().equals((short) 999)) {
        assertEquals((short) 999, var.getValue());
View Full Code Here

    variables.put("stringVar", "test");
    variables.put("myVar", "test123");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().processInstanceIdIn(processInstance.getId());

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(2, result.size());

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertEquals("string", var.getTypeName());
      if (var.getName().equals("myVar")) {
        assertEquals("myVar", var.getName());
View Full Code Here

    variables.put("myVar", "test123");
    ProcessInstance processInstance1 = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
    ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("oneTaskProcess");

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().processInstanceIdIn(processInstance1.getId(), processInstance2.getId());

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(2, result.size());

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertEquals("string", var.getTypeName());
      if (var.getName().equals("myVar")) {
        assertEquals("myVar", var.getName());
View Full Code Here

    variables.put("stringVar", "test");
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
    runtimeService.startProcessInstanceByKey("oneTaskProcess");

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().processInstanceIdIn("aProcessInstanceId");

    // then
    List<VariableInstance> result = query.list();
    assertTrue(result.isEmpty());

    assertEquals(0, query.count());
  }
View Full Code Here

    variables.put("stringVar", "test");
    variables.put("myVar", "test123");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().executionIdIn(processInstance.getId());

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(2, result.size());

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertEquals("string", var.getTypeName());
      if (var.getName().equals("myVar")) {
        assertEquals("myVar", var.getName());
View Full Code Here

    Map<String, Object> variables2 = new HashMap<String, Object>();
    variables2.put("myVar", "test123");
    ProcessInstance processInstance2 = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables2);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().executionIdIn(processInstance1.getId(), processInstance2.getId());

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(3, result.size());

    assertEquals(3, query.count());

    for (VariableInstance var : result) {
      assertEquals("string", var.getTypeName());
      if (var.getName().equals("myVar")) {
        assertEquals("myVar", var.getName());
View Full Code Here

    variables.put("stringVar", "test");
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
    runtimeService.startProcessInstanceByKey("oneTaskProcess");

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().executionIdIn("anExecutionId");

    // then
    List<VariableInstance> result = query.list();
    assertTrue(result.isEmpty());

    assertEquals(0, query.count());
  }
View Full Code Here

    Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();

    taskService.setVariableLocal(task.getId(), "taskVariable", "aCustomValue");

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().taskIdIn(task.getId());

    // then
    List<VariableInstance> result = query.list();
    assertFalse(result.isEmpty());
    assertEquals(1, result.size());

    assertEquals(1, query.count());

    VariableInstance var = result.get(0);
    assertEquals("taskVariable", var.getName());
    assertEquals("aCustomValue", var.getValue());
    assertEquals("string", var.getTypeName());
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.runtime.VariableInstanceQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.