use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testSuccessfulHistoricJobLogEntryStoredForLongActivityId.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuationWithLongId.bpmn20.xml" })
public void testSuccessfulHistoricJobLogEntryStoredForLongActivityId() {
runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false));
Job job = managementService.createJobQuery().singleResult();
managementService.executeJob(job.getId());
HistoricJobLog historicJob = historyService.createHistoricJobLogQuery().successLog().singleResult();
assertNotNull(historicJob);
assertEquals("serviceTaskIdIsReallyLongAndItShouldBeMoreThan64CharsSoItWill" + "BlowAnyActivityIdColumnWhereSizeIs64OrLessSoWeAlignItTo255LikeEverywhereElse", historicJob.getActivityId());
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testDeletedProcessInstance.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testDeletedProcessInstance() {
// given
String processInstanceId = runtimeService.startProcessInstanceByKey("process").getId();
String jobId = managementService.createJobQuery().singleResult().getId();
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId);
HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog();
HistoricJobLogQuery deletedQuery = historyService.createHistoricJobLogQuery().jobId(jobId).deletionLog();
// there exists one historic job log entry
assertEquals(1, query.count());
assertEquals(1, createdQuery.count());
assertEquals(0, deletedQuery.count());
// when
runtimeService.deleteProcessInstance(processInstanceId, null);
// then
assertEquals(2, query.count());
assertEquals(1, createdQuery.count());
assertEquals(1, deletedQuery.count());
HistoricJobLog createdJobLogEntry = createdQuery.singleResult();
assertEquals(3, createdJobLogEntry.getJobRetries());
HistoricJobLog deletedJobLogEntry = deletedQuery.singleResult();
assertEquals(3, deletedJobLogEntry.getJobRetries());
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testAsyncAfterJobHandlerType.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testAsyncAfterJobHandlerType() {
runtimeService.startProcessInstanceByKey("process", Variables.createVariables().putValue("fail", false));
Job job = managementService.createJobQuery().singleResult();
managementService.executeJob(job.getId());
Job anotherJob = managementService.createJobQuery().singleResult();
assertFalse(job.getId().equals(anotherJob.getId()));
HistoricJobLog historicJob = historyService.createHistoricJobLogQuery().jobId(anotherJob.getId()).singleResult();
assertNotNull(historicJob);
assertNull(historicJob.getJobDueDate());
assertEquals(anotherJob.getJobDefinitionId(), historicJob.getJobDefinitionId());
assertEquals("serviceTask", historicJob.getActivityId());
assertEquals(AsyncContinuationJobHandler.TYPE, historicJob.getJobDefinitionType());
assertEquals(MessageJobDeclaration.ASYNC_AFTER, historicJob.getJobDefinitionConfiguration());
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testStartTimerEventInsideEventSubProcessJobHandlerType.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testStartTimerEventInsideEventSubProcess.bpmn20.xml" })
public void testStartTimerEventInsideEventSubProcessJobHandlerType() {
runtimeService.startProcessInstanceByKey("process");
Job job = managementService.createJobQuery().singleResult();
HistoricJobLog historicJob = historyService.createHistoricJobLogQuery().jobId(job.getId()).singleResult();
assertNotNull(historicJob);
assertEquals(job.getId(), historicJob.getJobId());
assertEquals(job.getJobDefinitionId(), historicJob.getJobDefinitionId());
assertEquals("subprocessStartEvent", historicJob.getActivityId());
assertEquals(TimerStartEventSubprocessJobHandler.TYPE, historicJob.getJobDefinitionType());
assertEquals("DURATION: PT1M", historicJob.getJobDefinitionConfiguration());
assertEquals(job.getDuedate(), historicJob.getJobDueDate());
}
use of org.camunda.bpm.engine.history.HistoricJobLog in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testAsyncBeforeJobHandlerType.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testAsyncBeforeJobHandlerType() {
runtimeService.startProcessInstanceByKey("process");
Job job = managementService.createJobQuery().singleResult();
HistoricJobLog historicJob = historyService.createHistoricJobLogQuery().jobId(job.getId()).singleResult();
assertNotNull(historicJob);
assertNull(historicJob.getJobDueDate());
assertEquals(job.getJobDefinitionId(), historicJob.getJobDefinitionId());
assertEquals("serviceTask", historicJob.getActivityId());
assertEquals(AsyncContinuationJobHandler.TYPE, historicJob.getJobDefinitionType());
assertEquals(MessageJobDeclaration.ASYNC_BEFORE, historicJob.getJobDefinitionConfiguration());
}
Aggregations