Package org.camunda.bpm.engine.runtime

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


    // add another new variable
    runtimeService.setVariableLocal(execution.getId(), "anotherVariableName", "anotherVariableValue");

    // update job reference
    job = jobQuery.singleResult();
    // execute available job
    managementService.executeJob(job.getId());

    // get current task
    Task task = taskQuery.singleResult();
View Full Code Here


    Execution execution = executionQuery.singleResult();

    // update existing variable
    runtimeService.setVariableLocal(execution.getId(), "anotherVariableName", "aNewFinalValue");

    Job job = jobQuery.singleResult();
    managementService.executeJob(job.getId());

    // the process instance is completed
    Assert.assertEquals(0, processInstanceQuery.count());
View Full Code Here

    // ...and a suspended job of the provided job definition
    JobQuery jobQuery = managementService.createJobQuery().suspended();

    assertEquals(1, jobQuery.count());

    Job suspendedJob = jobQuery.singleResult();
    assertEquals(jobDefinition.getId(), suspendedJob.getJobDefinitionId());
    assertTrue(suspendedJob.isSuspended());

  }
View Full Code Here

    // ...and a suspended job of the provided job definition
    JobQuery jobQuery = managementService.createJobQuery().suspended();

    assertEquals(1, jobQuery.count());

    Job suspendedJob = jobQuery.singleResult();
    assertEquals(jobDefinition.getId(), suspendedJob.getJobDefinitionId());
    assertTrue(suspendedJob.isSuspended());

  }
View Full Code Here

    // the corresponding job is still active
    jobQuery = managementService.createJobQuery().active();

    assertEquals(1, jobQuery.count());

    Job activeJob = jobQuery.singleResult();
    assertEquals(jobDefinition.getId(), activeJob.getJobDefinitionId());

    assertFalse(activeJob.isSuspended());

    jobQuery = managementService.createJobQuery().suspended();
View Full Code Here

    // ...and a suspended job of the provided job definition
    JobQuery jobQuery = managementService.createJobQuery().suspended();

    assertEquals(1, jobQuery.count());

    Job suspendedJob = jobQuery.singleResult();
    assertEquals(jobDefinition.getId(), suspendedJob.getJobDefinitionId());
    assertTrue(suspendedJob.isSuspended());

  }
View Full Code Here

    // ...and a suspended job of the provided job definition
    JobQuery jobQuery = managementService.createJobQuery().suspended();

    assertEquals(1, jobQuery.count());

    Job suspendedJob = jobQuery.singleResult();
    assertEquals(jobDefinition.getId(), suspendedJob.getJobDefinitionId());
    assertTrue(suspendedJob.isSuspended());

  }
View Full Code Here

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

    Job timerJob = query.singleResult();

    assertNotNull("No job found for process instance", timerJob);
    assertEquals(0, timerJob.getRetries());

    managementService.setJobRetriesByJobDefinitionId(jobDefinition.getId(), 5);
View Full Code Here

    assertNotNull("No job found for process instance", timerJob);
    assertEquals(0, timerJob.getRetries());

    managementService.setJobRetriesByJobDefinitionId(jobDefinition.getId(), 5);

    timerJob = query.singleResult();
    assertEquals(5, timerJob.getRetries());
  }

  public void testSetJobRetriesByJobDefinitionIdEmptyJobDefinitionId() {
    try {
View Full Code Here

    params.put("fail", Boolean.TRUE);
    runtimeService.startProcessInstanceByKey("suspensionProcess", params);

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

    // when
    // the job will be suspended
    managementService.suspendJobById(job.getId());
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.