Package org.camunda.bpm.engine.runtime

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


    caseService
      .withCaseExecution(humanTaskId)
      .complete();

    // then
    VariableInstanceQuery query = runtimeService
        .createVariableInstanceQuery()
        .caseInstanceIdIn(caseInstanceId);

    assertEquals(8, query.count());

    assertTrue((Boolean) query.variableName("create").singleResult().getValue());
    assertEquals(1, query.variableName("createEventCounter").singleResult().getValue());

    assertTrue((Boolean) query.variableName("assignment").singleResult().getValue());
    assertEquals(1, query.variableName("assignmentEventCounter").singleResult().getValue());

    assertTrue((Boolean) query.variableName("complete").singleResult().getValue());
    assertEquals(1, query.variableName("completeEventCounter").singleResult().getValue());

    assertEquals(3, query.variableName("eventCounter").singleResult().getValue());

  }
View Full Code Here


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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();

    // then
    assertNotNull(query);

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

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertNotNull(var.getId());
      if (var.getName().equals("intVar")) {
        assertEquals("intVar", var.getName());
View Full Code Here

    taskService.setVariablesLocal(task.getId(), variables);
    VariableInstance result = runtimeService.createVariableInstanceQuery().variableName("var1").singleResult();
    assertNotNull(result);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableId(result.getId());

    // then
    assertNotNull(query);
    VariableInstance resultById = query.singleResult();
    assertEquals(result.getId(), resultById.getId());

    // delete task
    taskService.deleteTask(task.getId(), true);
  }
View Full Code Here

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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("stringVar");

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

    assertEquals(1, query.count());

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

    Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();
    taskService.setVariableLocal(task.getId(), "task", variableValue);
    runtimeService.setVariableLocal(task.getExecutionId(), "execution", variableValue);

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableNameIn("task", "process", "execution");

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

    assertEquals(3, query.count());

    for (VariableInstance variableInstance : result) {
      assertEquals(variableValue, variableInstance.getValue());
      assertEquals("string", variableInstance.getTypeName());
    }
View Full Code Here

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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableNameLike("%ingV%");

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

    assertEquals(1, query.count());

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

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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableNameLike("%ingV_");

    // 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("stringVar", "test");
    runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);

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

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

    assertEquals(1, query.count());

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

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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableValueNotEquals("stringVar", "test123");

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

    assertEquals(1, query.count());

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

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

    // when
    VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableValueGreaterThan("stringVar", "a");

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

    assertEquals(2, query.count());

    for (VariableInstance var : result) {
      assertEquals("stringVar", var.getName());
      assertEquals("string", var.getTypeName());
      if (var.getValue().equals("b")) {
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.