Java源码示例:org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator
示例1
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
configuration.setIdGenerator(new StrongUuidGenerator());
}
示例2
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
configuration.setIdGenerator(new StrongUuidGenerator());
}
示例3
@Override
public void preInit(SpringProcessEngineConfiguration configuration) {
configuration.setIdGenerator(new StrongUuidGenerator());
}
示例4
@Bean
@ConditionalOnMissingBean(IdGenerator.class)
@ConditionalOnProperty(prefix = CamundaBpmProperties.PREFIX, name = PROPERTY_NAME, havingValue = STRONG, matchIfMissing = true)
public IdGenerator strongUuidGenerator() {
return new StrongUuidGenerator();
}
示例5
@Test
public void configured_idGenerator_is_uuid() throws Exception {
IdGenerator idGenerator = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getIdGenerator();
assertThat(idGenerator).isOfAnyClassIn(StrongUuidGenerator.class);
}
示例6
@Bean
@ConditionalOnMissingBean(IdGenerator.class)
@ConditionalOnProperty(prefix = CamundaBpmProperties.PREFIX, name = PROPERTY_NAME, havingValue = STRONG, matchIfMissing = true)
public IdGenerator strongUuidGenerator() {
return new StrongUuidGenerator();
}
示例7
@Test
public void configured_idGenerator_is_uuid() throws Exception {
IdGenerator idGenerator = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getIdGenerator();
assertThat(idGenerator).isOfAnyClassIn(StrongUuidGenerator.class);
}
示例8
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);
}