use of org.camunda.bpm.engine.runtime.Job in project camunda-bpm-platform by camunda.
the class SpringTransactionIntegrationTest method testTransactionRollbackInServiceTaskWithCustomRetryCycle.
@Deployment
public void testTransactionRollbackInServiceTaskWithCustomRetryCycle() throws Exception {
runtimeService.startProcessInstanceByKey("txRollbackServiceTaskWithCustomRetryCycle");
waitForJobExecutorToProcessAllJobs(WAIT_TIME_MILLIS);
Job job = managementService.createJobQuery().singleResult();
assertNotNull(job);
assertEquals(0, job.getRetries());
assertEquals("Transaction rolled back because it has been marked as rollback-only", job.getExceptionMessage());
String stacktrace = managementService.getJobExceptionStacktrace(job.getId());
assertNotNull(stacktrace);
assertTrue("unexpected stacktrace, was <" + stacktrace + ">", stacktrace.contains("Transaction rolled back because it has been marked as rollback-only"));
}
use of org.camunda.bpm.engine.runtime.Job in project camunda-bpm-platform by camunda.
the class JobAuthorizationTest method testSetJobRetriesByJobDefinitionIdWithUpdateInstancePermissionOnAnyProcessDefinition.
public void testSetJobRetriesByJobDefinitionIdWithUpdateInstancePermissionOnAnyProcessDefinition() {
// given
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, UPDATE_INSTANCE);
String jobId = selectJobByProcessInstanceId(processInstanceId).getId();
// when
managementService.setJobRetries(jobId, 1);
// then
Job job = selectJobById(jobId);
assertNotNull(job);
assertEquals(1, job.getRetries());
}
use of org.camunda.bpm.engine.runtime.Job in project camunda-bpm-platform by camunda.
the class JobAuthorizationTest method testSuspendJobByProcessInstanceIdWihtUpdatePermissionOnProcessDefinition.
public void testSuspendJobByProcessInstanceIdWihtUpdatePermissionOnProcessDefinition() {
// given
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, TIMER_BOUNDARY_PROCESS_KEY, userId, UPDATE_INSTANCE);
// when
managementService.suspendJobByProcessInstanceId(processInstanceId);
// then
Job job = selectJobByProcessInstanceId(processInstanceId);
assertNotNull(job);
assertTrue(job.isSuspended());
}
use of org.camunda.bpm.engine.runtime.Job in project camunda-bpm-platform by camunda.
the class JobAuthorizationTest method testSetJobDueDateWithUpdatePermissionOnAnyProcessInstance.
public void testSetJobDueDateWithUpdatePermissionOnAnyProcessInstance() {
// given
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, UPDATE);
String jobId = selectJobByProcessInstanceId(processInstanceId).getId();
// when
managementService.setJobDuedate(jobId, null);
// then
Job job = selectJobById(jobId);
assertNull(job.getDuedate());
}
use of org.camunda.bpm.engine.runtime.Job in project camunda-bpm-platform by camunda.
the class JobAuthorizationTest method testQueryWithReadInstancePermissionOnTimerBoundaryProcessDefinition.
public void testQueryWithReadInstancePermissionOnTimerBoundaryProcessDefinition() {
// given
String processInstanceId = startProcessInstanceByKey(TIMER_BOUNDARY_PROCESS_KEY).getId();
createGrantAuthorization(PROCESS_DEFINITION, TIMER_BOUNDARY_PROCESS_KEY, userId, READ_INSTANCE);
// when
JobQuery query = managementService.createJobQuery();
// then
verifyQueryResults(query, 1);
Job job = query.singleResult();
assertEquals(processInstanceId, job.getProcessInstanceId());
assertEquals(TIMER_BOUNDARY_PROCESS_KEY, job.getProcessDefinitionKey());
}
Aggregations