Package org.activiti.engine.runtime

Examples of org.activiti.engine.runtime.ProcessInstanceQuery.list()


      .variableValueEquals("doubleVar", 1.2)
      .variableValueEquals("integerVar", 1234)
      .variableValueEquals("booleanVar", true)
      .variableValueEquals("shortVar", (short) 123);
   
    List<ProcessInstance> processInstances = query.list();
    Assert.assertNotNull(processInstances);
    Assert.assertEquals(1, processInstances.size());
    Assert.assertEquals(processInstance.getId(), processInstances.get(0).getId());
 
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
View Full Code Here


    runtimeService.startProcessInstanceByKey("oneTaskProcess2", "2");
  
    ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery().processInstanceIds(processInstanceIds);
    assertEquals(5, processInstanceQuery.count());
   
    List<ProcessInstance> processInstances = processInstanceQuery.list();
    assertNotNull(processInstances);
    assertEquals(5, processInstances.size());
   
    for (ProcessInstance processInstance : processInstances) {
      assertTrue(processInstanceIds.contains(processInstance.getId()));
View Full Code Here

        RuntimeService runtimeService = mock(RuntimeService.class);
        when(processEngine.getRuntimeService()).thenReturn(runtimeService);

        ProcessInstanceQuery allInstancesQuery = mock(ProcessInstanceQuery.class);
        when(allInstancesQuery.list()).thenReturn(instances);
        when(runtimeService.createProcessInstanceQuery()).thenReturn(allInstancesQuery);

        for (ProcessInstance instance : instances) {
            ProcessInstanceQuery singleResultQuery = mock(ProcessInstanceQuery.class);
View Full Code Here

        when(runtimeService.createProcessInstanceQuery()).thenReturn(allInstancesQuery);

        for (ProcessInstance instance : instances) {
            ProcessInstanceQuery singleResultQuery = mock(ProcessInstanceQuery.class);

            when(singleResultQuery.list()).thenReturn(ImmutableList.of(instance));
            when(allInstancesQuery.processInstanceBusinessKey(instance.getBusinessKey()))
                .thenReturn(singleResultQuery);
        }

        if (instances.isEmpty()) {
View Full Code Here

        }

        if (instances.isEmpty()) {
            ProcessInstanceQuery emptyQuery = mock(ProcessInstanceQuery.class);

            when(emptyQuery.list()).thenReturn(Collections.<ProcessInstance>emptyList());
            when(allInstancesQuery.processInstanceBusinessKey(Matchers.<String>any()))
                .thenReturn(emptyQuery);
        }

        return processEngine;
View Full Code Here

        when(runtimeService.createProcessInstanceQuery()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.variableValueEquals(CoreProcessVariables.POOL_BUSINESS_KEY, BUSINESS_KEY))
            .thenReturn(processInstanceQuery);
        when(processInstanceQuery.orderByProcessInstanceId()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.desc()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.list()).thenReturn(processes);

        return engine;
    }

    private ProcessInstance newProcessInstanceMock(String id, String businessKey, boolean isSuspended) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.