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; }
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()); }
@Test public void testExceptionStacktraceBinary() { // given BpmnModelInstance instance = createFailingProcess(); testRule.deploy(instance); runtimeService.startProcessInstanceByKey("Process"); String jobId = managementService.createJobQuery().singleResult().getId(); // when try { managementService.executeJob(jobId); fail(); } catch (Exception e) { // expected } JobEntity job = (JobEntity) managementService.createJobQuery().singleResult(); assertNotNull(job); ByteArrayEntity byteArrayEntity = configuration.getCommandExecutorTxRequired().execute(new GetByteArrayCommand(job.getExceptionByteArrayId())); checkBinary(byteArrayEntity); }
@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()); }
@Test public void testExceptionStacktraceBinary() { // given BpmnModelInstance instance = createFailingProcess(); testRule.deploy(instance); runtimeService.startProcessInstanceByKey("Process"); String jobId = managementService.createJobQuery().singleResult().getId(); // when try { managementService.executeJob(jobId); fail(); } catch (Exception e) { // expected } JobEntity job = (JobEntity) managementService.createJobQuery().singleResult(); assertNotNull(job); ByteArrayEntity byteArrayEntity = configuration.getCommandExecutorTxRequired().execute(new GetByteArrayCommand(job.getExceptionByteArrayId())); checkBinary(byteArrayEntity); }