protected boolean isFirstJobExecution(JobEntity job) { // check if this is jobs' first execution (recognize // this because no exception is set. Only the first // execution can be without exception - because if // no exception occurred the job would have been completed) // see https://app.camunda.com/jira/browse/CAM-1039 return job.getExceptionByteArrayId() == null && job.getExceptionMessage() == null; }
protected boolean isFirstJobExecution(JobEntity job) { // check if this is jobs' first execution (recognize // this because no exception is set. Only the first // execution can be without exception - because if // no exception occurred the job would have been completed) // see https://app.camunda.com/jira/browse/CAM-1039 return job.getExceptionByteArrayId() == null && job.getExceptionMessage() == null; }
public void testJobExceptionMessageCutoff() { JobEntity threeByteJobEntity = new MessageEntity(); String message = repeatCharacter("a", JobEntity.MAX_EXCEPTION_MESSAGE_LENGTH * 2); threeByteJobEntity.setExceptionMessage(message); assertEquals(JobEntity.MAX_EXCEPTION_MESSAGE_LENGTH, threeByteJobEntity.getExceptionMessage().length()); }
protected boolean isFirstJobExecution(JobEntity job) { // check if this is jobs' first execution (recognize // this because no exception is set. Only the first // execution can be without exception - because if // no exception occurred the job would have been completed) // see https://app.camunda.com/jira/browse/CAM-1039 return job.getExceptionByteArrayId() == null && job.getExceptionMessage() == null; }
@Test public void testHistoryCleanupJobResolveIncident() { //given String jobId = historyService.cleanUpHistoryAsync(true).getId(); imitateFailedJob(jobId); assertEquals(5, processEngineConfiguration.getDefaultNumberOfRetries()); //when //call to cleanup history means that incident was resolved jobId = historyService.cleanUpHistoryAsync(true).getId(); //then JobEntity jobEntity = getJobEntity(jobId); assertEquals(5, jobEntity.getRetries()); assertEquals(null, jobEntity.getExceptionByteArrayId()); assertEquals(null, jobEntity.getExceptionMessage()); }
public void testJobExceptionMessageCutoff() { JobEntity threeByteJobEntity = new MessageEntity(); String message = repeatCharacter("a", JobEntity.MAX_EXCEPTION_MESSAGE_LENGTH * 2); threeByteJobEntity.setExceptionMessage(message); assertEquals(JobEntity.MAX_EXCEPTION_MESSAGE_LENGTH, threeByteJobEntity.getExceptionMessage().length()); }
@Test public void testHistoryCleanupJobResolveIncident() { //given String jobId = historyService.cleanUpHistoryAsync(true).getId(); imitateFailedJob(jobId); assertEquals(5, processEngineConfiguration.getDefaultNumberOfRetries()); //when //call to cleanup history means that incident was resolved jobId = historyService.cleanUpHistoryAsync(true).getId(); //then JobEntity jobEntity = getJobEntity(jobId); assertEquals(5, jobEntity.getRetries()); assertEquals(null, jobEntity.getExceptionByteArrayId()); assertEquals(null, jobEntity.getExceptionMessage()); }