Examples of singleResult()


Examples of org.camunda.bpm.engine.runtime.EventSubscriptionQuery.singleResult()

    assertNotNull(execution);
   
    ClockUtil.setCurrentTime(new Date(ClockUtil.getCurrentTime().getTime() +10000));
    try {
    
      EventSubscription messageEventSubscription = messageEventSubscriptionQuery.singleResult();
      runtimeService.messageEventReceived(messageEventSubscription.getEventName(), messageEventSubscription.getExecutionId());
     
      assertEquals(0, runtimeService.createEventSubscriptionQuery().count());   
      assertEquals(1, runtimeService.createProcessInstanceQuery().count());   
      assertEquals(0, managementService.createJobQuery().count());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.ExecutionQuery.singleResult()

  private void createExecutionMock() {
    Execution mockExecution = MockProvider.createMockExecution();

    ExecutionQuery mockExecutionQuery = mock(ExecutionQuery.class);
    when(mockExecutionQuery.processInstanceId(eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))).thenReturn(mockExecutionQuery);
    when(mockExecutionQuery.singleResult()).thenReturn(mockExecution);
    when(mockRuntimeService.createExecutionQuery()).thenReturn(mockExecutionQuery);
  }

  private void createTaskMock() {
    Task mockTask = MockProvider.createMockTask();
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.IncidentQuery.singleResult()

    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("failingProcess");

    executeAvailableJobs();

    IncidentQuery query = runtimeService.createIncidentQuery().processInstanceId(processInstance.getId());
    Incident incident = query.singleResult();
    assertNotNull(incident);

    JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();

    // set retries to 1 by job definition id
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    // suspended job definitions and corresponding jobs
    managementService.suspendJobDefinitionByProcessDefinitionKey("suspensionProcess", true);

    // the failed job
    JobQuery jobQuery = managementService.createJobQuery();
    Job job = jobQuery.singleResult();
    assertTrue(job.isSuspended());

    // when
    // the job will be activated
    managementService.activateJobById(job.getId());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    // the job definition
    JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();

    // the failed job
    JobQuery jobQuery = managementService.createJobQuery();
    Job job = jobQuery.singleResult();
    assertTrue(job.isSuspended());

    // when
    // the job will be activated
    managementService.activateJobByJobDefinitionId(jobDefinition.getId());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    // the job definition
    JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();

    // the failed job
    JobQuery jobQuery = managementService.createJobQuery();
    Job job = jobQuery.singleResult();
    assertTrue(job.isSuspended());

    // when
    // the job will be activate
    managementService.activateJobByProcessInstanceId(processInstance.getId());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    // suspended job definitions and corresponding jobs
    managementService.suspendJobDefinitionByProcessDefinitionKey("suspensionProcess", true);

    // the failed job
    JobQuery jobQuery = managementService.createJobQuery();
    Job job = jobQuery.singleResult();
    assertTrue(job.isSuspended());

    // when
    // the job will be activated
    managementService.activateJobByProcessDefinitionId(processDefinition.getId());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    // suspended job definitions and corresponding jobs
    managementService.suspendJobDefinitionByProcessDefinitionKey("suspensionProcess", true);

    // the failed job
    JobQuery jobQuery = managementService.createJobQuery();
    Job job = jobQuery.singleResult();
    assertTrue(job.isSuspended());

    // when
    // the job will be activated
    managementService.activateJobByProcessDefinitionKey(processDefinition.getKey());
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.JobQuery.singleResult()

    Task task = taskQuery.singleResult();
    assertNotNull(task);
    assertEquals("taskBeforeInterruptingEventSuprocess", task.getTaskDefinitionKey());

    Job timer = jobQuery.singleResult();
    assertNotNull(timer);

    runtimeService.messageEventReceived("newMessage", pi.getId());

    task = taskQuery.singleResult();
View Full Code Here

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

  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() {
    Execution mockExecution = MockProvider.createMockExecution();
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.