public virtual void testHistoricBatchCompletion() { var processDefinition = testRule.DeployAndGetDefinition(instance); var batch = helper.StartAfterAsync("process1", 1, "user1", processDefinition.Id); helper.ExecuteSeedJob(batch); helper.ExecuteJobs(batch); var endDate = helper.AddSecondsToClock(12); // when helper.ExecuteMonitorJob(batch); // then the historic batch has an end time set var historicBatch = helper.GetHistoricBatch(batch); Assert.NotNull(historicBatch); Assert.AreEqual(endDate, historicBatch.EndTime); }
public virtual void testNoCreationOnSyncBatchJobExecution() { // given var processDefinition = testRule.DeployAndGetDefinition(instance); var processInstance = runtimeService.StartProcessInstanceById(processDefinition.Id); var batch = runtimeService.CreateModification(processDefinition.Id) .StartAfterActivity("user2") .SetProcessInstanceIds(processInstance.Id) .ExecuteAsync(); helper.ExecuteSeedJob(batch); // when rule.IdentityService.AuthenticatedUserId = "userId"; helper.ExecuteJobs(batch); rule.IdentityService.ClearAuthentication(); // then Assert.AreEqual(0, rule.HistoryService.CreateUserOperationLogQuery() .Count()); }
public virtual void createModificationJobs() { var processDefinition = testRule.DeployAndGetDefinition(instance); rule.ProcessEngineConfiguration.BatchJobsPerSeed = 10; var batch = helper.StartAfterAsync("process1", 20, "user1", processDefinition.Id); var seedJobDefinition = helper.GetSeedJobDefinition(batch); var modificationJobDefinition = helper.GetExecutionJobDefinition(batch); helper.ExecuteSeedJob(batch); var modificationJobs = helper.GetJobsForDefinition(modificationJobDefinition); Assert.AreEqual(10, modificationJobs.Count); foreach (var modificationJob in modificationJobs) { Assert.AreEqual(modificationJobDefinition.Id, modificationJob.JobDefinitionId); Assert.IsNull(modificationJob.Duedate); Assert.IsNull(modificationJob.ProcessDefinitionId); Assert.IsNull(modificationJob.ProcessDefinitionKey); Assert.IsNull(modificationJob.ProcessInstanceId); Assert.IsNull(modificationJob.ExecutionId); } // and the seed job still exists var seedJob = helper.GetJobForDefinition(seedJobDefinition); Assert.NotNull(seedJob); }