use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class HistoryCleanupOnEngineStartTest method clearDatabase.
@After
public void clearDatabase() {
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) engineRule.getProcessEngine().getProcessEngineConfiguration();
processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<Void>() {
public Void execute(CommandContext commandContext) {
List<Job> jobs = engineRule.getProcessEngine().getManagementService().createJobQuery().list();
if (jobs.size() > 0) {
assertEquals(1, jobs.size());
String jobId = jobs.get(0).getId();
commandContext.getJobManager().deleteJob((JobEntity) jobs.get(0));
commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(jobId);
}
return null;
}
});
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ModificationExecutionAsyncTest method storeEngineSettings.
@Before
public void storeEngineSettings() {
ProcessEngineConfigurationImpl configuration = rule.getProcessEngineConfiguration();
defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
defaultInvocationsPerBatchJob = configuration.getInvocationsPerBatchJob();
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ModificationExecutionAsyncTest method restoreEngineSettings.
@After
public void restoreEngineSettings() {
ProcessEngineConfigurationImpl configuration = rule.getProcessEngineConfiguration();
configuration.setBatchJobsPerSeed(defaultBatchJobsPerSeed);
configuration.setInvocationsPerBatchJob(defaultInvocationsPerBatchJob);
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class ModificationExecutionAsyncTest method testModificationJobsExecutionByJobExecutorWithAuthorizationEnabledAndTenant.
@Test
public void testModificationJobsExecutionByJobExecutorWithAuthorizationEnabledAndTenant() {
ProcessEngineConfigurationImpl processEngineConfiguration = rule.getProcessEngineConfiguration();
processEngineConfiguration.setAuthorizationEnabled(true);
ProcessDefinition processDefinition = testRule.deployForTenantAndGetDefinition("tenantId", instance);
try {
Batch batch = helper.startAfterAsync("process1", 10, "user1", processDefinition.getId());
helper.executeSeedJob(batch);
testRule.waitForJobExecutorToProcessAllJobs();
// then all process instances where modified
for (String processInstanceId : helper.currentProcessInstances) {
ActivityInstance updatedTree = runtimeService.getActivityInstance(processInstanceId);
assertNotNull(updatedTree);
assertEquals(processInstanceId, updatedTree.getProcessInstanceId());
assertThat(updatedTree).hasStructure(describeActivityInstanceTree(processDefinition.getId()).activity("user1").activity("user2").done());
}
} finally {
processEngineConfiguration.setAuthorizationEnabled(false);
}
}
use of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl in project camunda-bpm-platform by camunda.
the class BatchModificationHistoryTest method storeEngineSettings.
@Before
public void storeEngineSettings() {
ProcessEngineConfigurationImpl configuration = rule.getProcessEngineConfiguration();
defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
defaultInvocationsPerBatchJob = configuration.getInvocationsPerBatchJob();
}
Aggregations