示例#1
0
        public static HistoricJobLogDto fromHistoricJobLog(HistoricJobLog historicJobLog)
        {
            HistoricJobLogDto result = new HistoricJobLogDto();

            result.id          = historicJobLog.Id;
            result.timestamp   = historicJobLog.Timestamp;
            result.removalTime = historicJobLog.RemovalTime;

            result.jobId               = historicJobLog.JobId;
            result.jobDueDate          = historicJobLog.JobDueDate;
            result.jobRetries          = historicJobLog.JobRetries;
            result.jobPriority         = historicJobLog.JobPriority;
            result.jobExceptionMessage = historicJobLog.JobExceptionMessage;

            result.jobDefinitionId            = historicJobLog.JobDefinitionId;
            result.jobDefinitionType          = historicJobLog.JobDefinitionType;
            result.jobDefinitionConfiguration = historicJobLog.JobDefinitionConfiguration;

            result.activityId            = historicJobLog.ActivityId;
            result.executionId           = historicJobLog.ExecutionId;
            result.processInstanceId     = historicJobLog.ProcessInstanceId;
            result.processDefinitionId   = historicJobLog.ProcessDefinitionId;
            result.processDefinitionKey  = historicJobLog.ProcessDefinitionKey;
            result.deploymentId          = historicJobLog.DeploymentId;
            result.tenantId              = historicJobLog.TenantId;
            result.rootProcessInstanceId = historicJobLog.RootProcessInstanceId;

            result.creationLog = historicJobLog.CreationLog;
            result.failureLog  = historicJobLog.FailureLog;
            result.successLog  = historicJobLog.SuccessLog;
            result.deletionLog = historicJobLog.DeletionLog;

            return(result);
        }
示例#2
0
        // historic job log query (standalone job) ///////////////////////

        public virtual void testQueryAfterStandaloneJob()
        {
            // given
            disableAuthorization();
            repositoryService.suspendProcessDefinitionByKey(TIMER_BOUNDARY_PROCESS_KEY, true, DateTime.Now);
            enableAuthorization();

            // when
            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

            // then
            verifyQueryResults(query, 1);

            HistoricJobLog jobLog = query.singleResult();

            assertNull(jobLog.ProcessDefinitionKey);

            deleteDeployment(deploymentId);

            disableAuthorization();
            string jobId = managementService.createJobQuery().singleResult().Id;

            managementService.deleteJob(jobId);
            enableAuthorization();
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getHistoricJobLogExceptionStacktraceWithAuthenticatedTenant()
        public virtual void getHistoricJobLogExceptionStacktraceWithAuthenticatedTenant()
        {
            testRule.deployForTenant(TENANT_ONE, FAILING_BPMN_PROCESS);
            string processInstanceId = startProcessInstance(null);

            testRule.executeAvailableJobs();

            HistoricJobLog log = historyService.createHistoricJobLogQuery().processInstanceId(processInstanceId).failureLog().listPage(0, 1).get(0);

            identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

            string historicJobLogExceptionStacktrace = historyService.getHistoricJobLogExceptionStacktrace(log.Id);

            assertThat(historicJobLogExceptionStacktrace, notNullValue());
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricSeedJobLogForBatchDeletion()
        public virtual void testHistoricSeedJobLogForBatchDeletion()
        {
            Batch batch = helper.migrateProcessInstancesAsync(1);

            // when
            DateTime deletionDate = helper.addSecondsToClock(12);

            managementService.deleteBatch(batch.Id, false);

            // then a deletion historic job log was added
            HistoricJobLog jobLog = helper.getHistoricSeedJobLog(batch)[1];

            assertNotNull(jobLog);
            assertTrue(jobLog.DeletionLog);
            assertEquals(deletionDate, jobLog.Timestamp);
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricSeedJobLogForBatchDeletion()
        public virtual void testHistoricSeedJobLogForBatchDeletion()
        {
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
            Batch             batch             = helper.startBeforeAsync("process1", 1, "user1", processDefinition.Id);

            // when
            DateTime deletionDate = helper.addSecondsToClock(12);

            rule.ManagementService.deleteBatch(batch.Id, false);

            // then a deletion historic job log was added
            HistoricJobLog jobLog = helper.getHistoricSeedJobLog(batch)[1];

            assertNotNull(jobLog);
            assertTrue(jobLog.DeletionLog);
            assertEquals(deletionDate, jobLog.Timestamp);
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricBatchJobLog()
        public virtual void testHistoricBatchJobLog()
        {
            Batch batch = helper.migrateProcessInstancesAsync(1);

            helper.executeSeedJob(batch);

            string sourceDeploymentId = helper.SourceProcessDefinition.DeploymentId;

            // when
            DateTime executionDate = helper.addSecondsToClock(12);

            helper.executeJobs(batch);

            // then a historic job log exists for the batch job
            HistoricJobLog jobLog = helper.getHistoricBatchJobLog(batch)[0];

            assertNotNull(jobLog);
            assertTrue(jobLog.CreationLog);
            assertEquals(batch.BatchJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(org.camunda.bpm.engine.batch.Batch_Fields.TYPE_PROCESS_INSTANCE_MIGRATION, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(START_DATE, jobLog.Timestamp);
            assertEquals(sourceDeploymentId, jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);

            jobLog = helper.getHistoricBatchJobLog(batch)[1];
            assertNotNull(jobLog);
            assertTrue(jobLog.SuccessLog);
            assertEquals(batch.BatchJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(org.camunda.bpm.engine.batch.Batch_Fields.TYPE_PROCESS_INSTANCE_MIGRATION, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(executionDate, jobLog.Timestamp);
            assertEquals(sourceDeploymentId, jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);
        }
示例#7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricBatchJobLog()
        public virtual void testHistoricBatchJobLog()
        {
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
            Batch             batch             = helper.startAfterAsync("process1", 1, "user1", processDefinition.Id);

            helper.executeSeedJob(batch);

            // when
            DateTime executionDate = helper.addSecondsToClock(12);

            helper.executeJobs(batch);

            // then a historic job log exists for the batch job
            HistoricJobLog jobLog = helper.getHistoricBatchJobLog(batch)[0];

            assertNotNull(jobLog);
            assertTrue(jobLog.CreationLog);
            assertEquals(batch.BatchJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(org.camunda.bpm.engine.batch.Batch_Fields.TYPE_PROCESS_INSTANCE_MODIFICATION, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(START_DATE, jobLog.Timestamp);
            assertEquals(processDefinition.DeploymentId, jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);

            jobLog = helper.getHistoricBatchJobLog(batch)[1];
            assertNotNull(jobLog);
            assertTrue(jobLog.SuccessLog);
            assertEquals(batch.BatchJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(org.camunda.bpm.engine.batch.Batch_Fields.TYPE_PROCESS_INSTANCE_MODIFICATION, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(executionDate, jobLog.Timestamp);
            assertEquals(processDefinition.DeploymentId, jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);
        }
示例#8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricSeedJobLog()
        public virtual void testHistoricSeedJobLog()
        {
            // when
            ProcessDefinition processDefinition = testRule.deployAndGetDefinition(instance);
            Batch             batch             = helper.cancelAllAsync("process1", 1, "user1", processDefinition.Id);

            // then a historic job log exists for the seed job
            HistoricJobLog jobLog = helper.getHistoricSeedJobLog(batch)[0];

            assertNotNull(jobLog);
            assertTrue(jobLog.CreationLog);
            assertEquals(batch.SeedJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(BatchSeedJobHandler.TYPE, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(START_DATE, jobLog.Timestamp);
            assertNull(jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);

            // when the seed job is executed
            DateTime executionDate = helper.addSecondsToClock(12);

            helper.executeSeedJob(batch);

            // then a new historic job log exists for the seed job
            jobLog = helper.getHistoricSeedJobLog(batch)[1];
            assertNotNull(jobLog);
            assertTrue(jobLog.SuccessLog);
            assertEquals(batch.SeedJobDefinitionId, jobLog.JobDefinitionId);
            assertEquals(BatchSeedJobHandler.TYPE, jobLog.JobDefinitionType);
            assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
            assertEquals(executionDate, jobLog.Timestamp);
            assertNull(jobLog.DeploymentId);
            assertNull(jobLog.ProcessDefinitionId);
            assertNull(jobLog.ExecutionId);
            assertEquals(currentTime, jobLog.JobDueDate);
        }
示例#9
0
 protected internal virtual void assertCommonMonitorJobLogProperties(Batch batch, HistoricJobLog jobLog)
 {
     assertNotNull(jobLog);
     assertEquals(batch.MonitorJobDefinitionId, jobLog.JobDefinitionId);
     assertEquals(BatchMonitorJobHandler.TYPE, jobLog.JobDefinitionType);
     assertEquals(batch.Id, jobLog.JobDefinitionConfiguration);
     assertNull(jobLog.DeploymentId);
     assertNull(jobLog.ProcessDefinitionId);
     assertNull(jobLog.ExecutionId);
 }
示例#10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricMonitorJobLog()
        public virtual void testHistoricMonitorJobLog()
        {
            Batch batch = helper.migrateProcessInstancesAsync(1);

            // when the seed job is executed
            helper.executeSeedJob(batch);

            Job monitorJob = helper.getMonitorJob(batch);
            IList <HistoricJobLog> jobLogs = helper.getHistoricMonitorJobLog(batch, monitorJob);

            assertEquals(1, jobLogs.Count);

            // then a creation historic job log exists for the monitor job without due date
            HistoricJobLog jobLog = jobLogs[0];

            assertCommonMonitorJobLogProperties(batch, jobLog);
            assertTrue(jobLog.CreationLog);
            assertEquals(START_DATE, jobLog.Timestamp);
            assertEquals(currentTime, jobLog.JobDueDate);

            // when the monitor job is executed
            DateTime executionDate     = helper.addSecondsToClock(15);
            DateTime monitorJobDueDate = helper.addSeconds(executionDate, 30);

            helper.executeMonitorJob(batch);

            jobLogs = helper.getHistoricMonitorJobLog(batch, monitorJob);
            assertEquals(2, jobLogs.Count);

            // then a success job log was created for the last monitor job
            jobLog = jobLogs[1];
            assertCommonMonitorJobLogProperties(batch, jobLog);
            assertTrue(jobLog.SuccessLog);
            assertEquals(executionDate, jobLog.Timestamp);
            assertEquals(currentTime, jobLog.JobDueDate);

            // and a creation job log for the new monitor job was created with due date
            monitorJob = helper.getMonitorJob(batch);
            jobLogs    = helper.getHistoricMonitorJobLog(batch, monitorJob);
            assertEquals(1, jobLogs.Count);

            jobLog = jobLogs[0];
            assertCommonMonitorJobLogProperties(batch, jobLog);
            assertTrue(jobLog.CreationLog);
            assertEquals(executionDate, jobLog.Timestamp);
            assertEquals(monitorJobDueDate, jobLog.JobDueDate);

            // when the migration and monitor jobs are executed
            executionDate = helper.addSecondsToClock(15);
            helper.executeJobs(batch);
            helper.executeMonitorJob(batch);

            jobLogs = helper.getHistoricMonitorJobLog(batch, monitorJob);
            assertEquals(2, jobLogs.Count);

            // then a success job log was created for the last monitor job
            jobLog = jobLogs[1];
            assertCommonMonitorJobLogProperties(batch, jobLog);
            assertTrue(jobLog.SuccessLog);
            assertEquals(executionDate, jobLog.Timestamp);
            assertEquals(monitorJobDueDate, jobLog.JobDueDate);
        }