use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByActive.
public void testQueryByActive() {
JobQuery query = managementService.createJobQuery().active();
verifyQueryResults(query, 4);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByActivityId.
public void testQueryByActivityId() {
JobDefinition jobDefinition = managementService.createJobDefinitionQuery().singleResult();
JobQuery query = managementService.createJobQuery().activityId(jobDefinition.getActivityId());
verifyQueryResults(query, 3);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByDuedateLowerThenOrEqual.
public void testQueryByDuedateLowerThenOrEqual() {
JobQuery query = managementService.createJobQuery().duedateLowerThenOrEquals(testStartTime);
verifyQueryResults(query, 0);
query = managementService.createJobQuery().duedateLowerThenOrEquals(timerOneFireTime);
verifyQueryResults(query, 1);
query = managementService.createJobQuery().duedateLowerThenOrEquals(timerTwoFireTime);
verifyQueryResults(query, 2);
query = managementService.createJobQuery().duedateLowerThenOrEquals(timerThreeFireTime);
verifyQueryResults(query, 3);
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testTimeCycleQueryByProcessDefinitionId.
@Deployment
public void testTimeCycleQueryByProcessDefinitionId() {
String processDefinitionId = repositoryService.createProcessDefinitionQuery().processDefinitionKey("process").singleResult().getId();
JobQuery query = managementService.createJobQuery().processDefinitionId(processDefinitionId);
verifyQueryResults(query, 1);
String jobId = query.singleResult().getId();
managementService.executeJob(jobId);
verifyQueryResults(query, 1);
String anotherJobId = query.singleResult().getId();
assertFalse(jobId.equals(anotherJobId));
}
use of org.camunda.bpm.engine.runtime.JobQuery in project camunda-bpm-platform by camunda.
the class JobQueryTest method testQueryByNoRetriesLeft.
public void testQueryByNoRetriesLeft() {
JobQuery query = managementService.createJobQuery().noRetriesLeft();
verifyQueryResults(query, 0);
setRetries(processInstanceIdOne, 0);
// Re-running the query should give only one jobs now, since three job has retries>0
verifyQueryResults(query, 1);
}
Aggregations