Examples of processInstanceId()


Examples of org.camunda.bpm.engine.runtime.ProcessInstanceQuery.processInstanceId()

  private void createProcessInstanceMock() {
    ProcessInstance mockInstance = MockProvider.createMockInstance();

    ProcessInstanceQuery mockInstanceQuery = mock(ProcessInstanceQuery.class);
    when(mockInstanceQuery.processInstanceId(eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))).thenReturn(mockInstanceQuery);
    when(mockInstanceQuery.singleResult()).thenReturn(mockInstance);
    when(mockRuntimeService.createProcessInstanceQuery()).thenReturn(mockInstanceQuery);
  }

  private void createExecutionMock() {
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.ProcessInstanceQuery.processInstanceId()

  @Test
  public void testGetSingleInstance() {
    ProcessInstance mockInstance = MockProvider.createMockInstance();
    ProcessInstanceQuery sampleInstanceQuery = mock(ProcessInstanceQuery.class);
    when(runtimeServiceMock.createProcessInstanceQuery()).thenReturn(sampleInstanceQuery);
    when(sampleInstanceQuery.processInstanceId(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)).thenReturn(sampleInstanceQuery);
    when(sampleInstanceQuery.singleResult()).thenReturn(mockInstance);

    given().pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)
      .then().expect().statusCode(Status.OK.getStatusCode())
      .body("id", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.ProcessInstanceQuery.processInstanceId()

  @Test
  public void testGetNonExistingProcessInstance() {
    ProcessInstanceQuery sampleInstanceQuery = mock(ProcessInstanceQuery.class);
    when(runtimeServiceMock.createProcessInstanceQuery()).thenReturn(sampleInstanceQuery);
    when(sampleInstanceQuery.processInstanceId(anyString())).thenReturn(sampleInstanceQuery);
    when(sampleInstanceQuery.singleResult()).thenReturn(null);

    given().pathParam("id", "aNonExistingInstanceId")
      .then().expect().statusCode(Status.NOT_FOUND.getStatusCode()).contentType(ContentType.JSON)
      .body("type", equalTo(InvalidRequestException.class.getSimpleName()))
View Full Code Here

Examples of org.camunda.bpm.engine.task.TaskQuery.processInstanceId()

    List<EventSubscription> subscriptions = eventSubscriptionQuery.list();
    assertEquals(2, subscriptions.size());

    // start the message interrupting event sub process
    runtimeService.correlateMessage("newMessage");
    Task taskAfterMessageStartEvent = taskQuery.processInstanceId(calledProcessInstanceId).singleResult();
    assertEquals("taskAfterMessageStartEvent", taskAfterMessageStartEvent.getTaskDefinitionKey());

    // no subscriptions left
    assertEquals(0, eventSubscriptionQuery.count());
View Full Code Here

Examples of org.camunda.bpm.engine.task.TaskQuery.processInstanceId()

    List<EventSubscription> subscriptions = eventSubscriptionQuery.list();
    assertEquals(2, subscriptions.size());

    // start the signal interrupting event sub process
    runtimeService.signalEventReceived("newSignal");
    Task taskAfterSignalStartEvent = taskQuery.processInstanceId(calledProcessInstanceId).singleResult();
    assertEquals("taskAfterSignalStartEvent", taskAfterSignalStartEvent.getTaskDefinitionKey());

    // no subscriptions left
    assertEquals(0, eventSubscriptionQuery.count());
View Full Code Here

Examples of org.jbpm.api.ProcessInstanceQuery.processInstanceId()

    try
    {
      ExecutionService execService = this.processEngine.getExecutionService();
      ProcessInstanceQuery query = execService.createProcessInstanceQuery();
      query.processInstanceId(instanceId);
      ProcessInstance processInstance = query.uniqueResult();
      return ModelAdaptor.adoptExecution( (ExecutionImpl)processInstance);
    }
    finally
    {
View Full Code Here

Examples of org.jbpm.api.history.HistoryProcessInstanceQuery.processInstanceId()

      // TODO: optimize w. batch query
      HistoryService histService = this.processEngine.getHistoryService();
      for(ProcessInstanceRef inst : results)
      {
        HistoryProcessInstanceQuery hQuery = histService.createHistoryProcessInstanceQuery();
        hQuery.processInstanceId(inst.getId());
        HistoryProcessInstance entry = hQuery.uniqueResult();
        inst.setStartDate(entry.getStartTime());
      }

      return results;
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.