Package org.camunda.bpm.engine.runtime

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


    // 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

    // 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

    // 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

    // 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

    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

  }

  public void testQueryByExecutionId() {
    Job job = managementService.createJobQuery().processInstanceId(processInstanceIdOne).singleResult();
    JobQuery query = managementService.createJobQuery().executionId(job.getExecutionId());
    assertEquals(query.singleResult().getId(), job.getId());
    verifyQueryResults(query, 1);
  }

  public void testQueryByInvalidExecutionId() {
    JobQuery query = managementService.createJobQuery().executionId("invalid");
View Full Code Here

    // After process start, there should be timer created
    JobQuery jobQuery = managementService.createJobQuery();
    assertEquals(1, jobQuery.count());

    // ensure that the deployment Id is set on the new job
    Job job = jobQuery.singleResult();
    assertNotNull(job.getDeploymentId());

    final ProcessInstanceQuery piq = runtimeService.createProcessInstanceQuery().processDefinitionKey("startTimerEventExampleCycle");

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

    executeAllJobs();
    assertEquals(1, piq.count());
    assertEquals(1, jobQuery.count());

    // ensure that the deployment Id is set on the new job
    job = jobQuery.singleResult();
    assertNotNull(job.getDeploymentId());

    moveByMinutes(5);
    executeAllJobs();
    assertEquals(2, piq.count());
View Full Code Here

    ExecutionQuery executionQuery = runtimeService.createExecutionQuery().processInstanceId(pi.getId());
    JobQuery jobQuery = managementService.createJobQuery().processInstanceId(pi.getId());
    TaskQuery taskQuery = taskService.createTaskQuery().processInstanceId(pi.getId());

    Execution execution = executionQuery.singleResult();
    Job job = jobQuery.singleResult();

    // add a variable
    runtimeService.setVariableLocal(execution.getId(), "aVariableName", "aVariableValue");

    // execute available job
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.