org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator Java Examples

The following examples show how to use org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator. 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: CamundaIdGeneratorConfiguration.java    From camunda-spring-boot-amqp-microservice-cloud-example with Apache License 2.0 4 votes vote down vote up
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
  configuration.setIdGenerator(new StrongUuidGenerator());
}
 
Example #2
Source File: CamundaIdGeneratorConfiguration.java    From flowing-retail with Apache License 2.0 4 votes vote down vote up
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
  configuration.setIdGenerator(new StrongUuidGenerator());
}
 
Example #3
Source File: CamundaEngineIdGeneratorConfiguration.java    From trip-booking-saga-java with Apache License 2.0 4 votes vote down vote up
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
  configuration.setIdGenerator(new StrongUuidGenerator());
}
 
Example #4
Source File: IdGeneratorConfiguration.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(IdGenerator.class)
@ConditionalOnProperty(prefix = CamundaBpmProperties.PREFIX, name = PROPERTY_NAME, havingValue = STRONG, matchIfMissing = true)
public IdGenerator strongUuidGenerator() {
  return new StrongUuidGenerator();
}
 
Example #5
Source File: StrongUuidGeneratorIT.java    From camunda-bpm-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
@Test
public void configured_idGenerator_is_uuid() throws Exception {
  IdGenerator idGenerator = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getIdGenerator();

  assertThat(idGenerator).isOfAnyClassIn(StrongUuidGenerator.class);
}
 
Example #6
Source File: IdGeneratorConfiguration.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(IdGenerator.class)
@ConditionalOnProperty(prefix = CamundaBpmProperties.PREFIX, name = PROPERTY_NAME, havingValue = STRONG, matchIfMissing = true)
public IdGenerator strongUuidGenerator() {
  return new StrongUuidGenerator();
}
 
Example #7
Source File: StrongUuidGeneratorIT.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
@Test
public void configured_idGenerator_is_uuid() throws Exception {
  IdGenerator idGenerator = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getIdGenerator();

  assertThat(idGenerator).isOfAnyClassIn(StrongUuidGenerator.class);
}
 
Example #8
Source File: StartProcessEngineStep.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void performOperationStep(DeploymentOperation operationContext) {

    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);

    ClassLoader classLoader = null;

    if(processApplication != null) {
      classLoader = processApplication.getProcessApplicationClassloader();
    }

    String configurationClassName = processEngineXml.getConfigurationClass();

    if(configurationClassName == null || configurationClassName.isEmpty()) {
      configurationClassName = StandaloneProcessEngineConfiguration.class.getName();
    }

    // create & instantiate configuration class
    Class<? extends ProcessEngineConfigurationImpl> configurationClass = loadClass(configurationClassName, classLoader, ProcessEngineConfigurationImpl.class);
    ProcessEngineConfigurationImpl configuration = createInstance(configurationClass);

    // set UUid generator
    // TODO: move this to configuration and use as default?
    ProcessEngineConfigurationImpl configurationImpl = configuration;
    configurationImpl.setIdGenerator(new StrongUuidGenerator());

    // set configuration values
    String name = processEngineXml.getName();
    configuration.setProcessEngineName(name);

    String datasourceJndiName = processEngineXml.getDatasource();
    configuration.setDataSourceJndiName(datasourceJndiName);

    // apply properties
    Map<String, String> properties = processEngineXml.getProperties();
    setJobExecutorActivate(configuration, properties);
    PropertyHelper.applyProperties(configuration, properties);

    // instantiate plugins:
    configurePlugins(configuration, processEngineXml, classLoader);

    if(processEngineXml.getJobAcquisitionName() != null && !processEngineXml.getJobAcquisitionName().isEmpty()) {
      JobExecutor jobExecutor = getJobExecutorService(serviceContainer);
      ensureNotNull("Cannot find referenced job executor with name '" + processEngineXml.getJobAcquisitionName() + "'", "jobExecutor", jobExecutor);

      // set JobExecutor on process engine
      configurationImpl.setJobExecutor(jobExecutor);
    }

    // start the process engine inside the container.
    JmxManagedProcessEngine managedProcessEngineService = createProcessEngineControllerInstance(configuration);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, configuration.getProcessEngineName(), managedProcessEngineService);

  }