Java Code Examples for org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl#setBatchJobsPerSeed()

The following examples show how to use org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl#setBatchJobsPerSeed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BatchPriorityTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Before
public void saveAndReduceBatchConfiguration() {
  ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
  defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
  defaultBatchJobPriority = configuration.getBatchJobPriority();
  // reduce number of batch jobs per seed to not have to create a lot of instances
  configuration.setBatchJobsPerSeed(1);
}
 
Example 2
Source File: BatchStatisticsQueryTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Before
public void saveAndReduceBatchJobsPerSeed() {
  ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
  defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
  // reduce number of batch jobs per seed to not have to create a lot of instances
  configuration.setBatchJobsPerSeed(10);
}
 
Example 3
Source File: BatchSuspensionTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Before
public void saveAndReduceBatchJobsPerSeed() {
  ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
  defaultBatchJobsPerSeed = configuration.getBatchJobsPerSeed();
  // reduce number of batch jobs per seed to not have to create a lot of instances
  configuration.setBatchJobsPerSeed(1);
}
 
Example 4
Source File: BatchMigrationTest.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
@Test
public void testCustomNumberOfJobsCreateBySeedJob() {
  ProcessEngineConfigurationImpl configuration = engineRule.getProcessEngineConfiguration();
  configuration.setBatchJobsPerSeed(2);
  configuration.setInvocationsPerBatchJob(5);

  // when
  Batch batch = helper.migrateProcessInstancesAsync(20);

  // then the configuration was saved in the batch job
  assertEquals(2, batch.getBatchJobsPerSeed());
  assertEquals(5, batch.getInvocationsPerBatchJob());

  // and the size was correctly calculated
  assertEquals(4, batch.getTotalJobs());

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

  // then there exist the first batch of migration jobs
  assertEquals(2, helper.getExecutionJobs(batch).size());

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

  // then the full batch of migration jobs exist
  assertEquals(4, helper.getExecutionJobs(batch).size());

  // and the seed job is removed
  assertNull(helper.getSeedJob(batch));
}
 
Example 5
Source File: BatchPriorityTest.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@After
public void resetBatchJobsPerSeed() {
  ProcessEngineConfigurationImpl processEngineConfiguration = engineRule.getProcessEngineConfiguration();
  processEngineConfiguration.setBatchJobsPerSeed(defaultBatchJobsPerSeed);
  processEngineConfiguration.setBatchJobPriority(defaultBatchJobPriority);
}