本文整理汇总了Java中org.activiti.spring.SpringProcessEngineConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java SpringProcessEngineConfiguration类的具体用法?Java SpringProcessEngineConfiguration怎么用?Java SpringProcessEngineConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringProcessEngineConfiguration类属于org.activiti.spring包,在下文中一共展示了SpringProcessEngineConfiguration类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: springProcessEngineConfiguration
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
@Bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration() {
SpringProcessEngineConfiguration springConfiguration = new SpringProcessEngineConfiguration();
springConfiguration.setProcessEngineName("CFI Workflow Engine");
springConfiguration.setDatabaseType("postgres");
springConfiguration.setDataSource(mainConfig.dataSource());
springConfiguration.setTransactionManager(mainConfig.transactionManager());
springConfiguration.setDatabaseSchemaUpdate("true");
springConfiguration.setJobExecutorActivate(false);
springConfiguration.setHistory("full");
List<SessionFactory> sf = new ArrayList<SessionFactory>();
sf.add(userManagerFactory);
sf.add(groupManagerFactory);
springConfiguration.setCustomSessionFactories(sf);
return springConfiguration;
}
示例2: getCamelContextObject
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
@Override
public Object getCamelContextObject(String camelContextValue) {
SpringProcessEngineConfiguration springConfiguration = (SpringProcessEngineConfiguration) getProcessEngine().getProcessEngineConfiguration();
if (StringUtils.isEmpty(camelContextValue)) {
camelContextValue = springConfiguration.getDefaultCamelContext();
}
// Get the CamelContext object and set the super's member variable.
Object ctx = springConfiguration.getApplicationContext().getBean(camelContextValue);
return ctx;
}
示例3: activitiProcessEngine
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
/**
* Gets the Activiti Process Engine.
*
* @param activitiProcessEngineConfiguration the Activiti process engine configuration to use.
*
* @return the Activiti Process Engine.
*/
@Bean(destroyMethod = "destroy")
public ProcessEngineFactoryBean activitiProcessEngine(SpringProcessEngineConfiguration activitiProcessEngineConfiguration)
{
// Create and return a factory bean that can return an Activiti process engine based on our Activiti process engine configuration bean.
ProcessEngineFactoryBean bean = new ProcessEngineFactoryBean();
bean.setProcessEngineConfiguration(activitiProcessEngineConfiguration);
return bean;
}
示例4: testNoStringAndLongStringType
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
/**
* Activiti by default configures StringType and LongStringType VariableType in configuration.
* This method tests the scenarios where no StringType and LongStringType is already configured in configuration.
*/
@Test
public void testNoStringAndLongStringType() throws Exception
{
SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
configuration.setVariableTypes(new DefaultVariableTypes());
herdProcessEngineConfigurator.configure(configuration);
VariableType type = configuration.getVariableTypes().findVariableType(StringUtils.repeat("a", 2000));
assertEquals(StringType.class, type.getClass());
type = configuration.getVariableTypes().findVariableType(StringUtils.repeat("a", 2001));
assertEquals(LongStringType.class, type.getClass());
}
示例5: createProcessEngineConfigurationDef
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
private AbstractBeanDefinition createProcessEngineConfigurationDef(){
BeanDefinitionBuilder sef = genericBeanDefinition(SpringProcessEngineConfiguration.class);
sef.addPropertyReference("dataSource",dataSourceBeanName);
sef.addPropertyReference("transactionManager", transactionManagerBeanName);
sef.addPropertyValue("databaseSchemaUpdate", "true");
sef.addPropertyValue("activityFontName",properties.getProperty("activityFontName"));
sef.addPropertyValue("labelFontName",properties.getProperty("labelFontName"));
sef.addPropertyValue("history",properties.getProperty("history"));
sef.addPropertyValue("jobExecutorActivate",properties.getProperty("jobExecutorActivate"));
return sef.getBeanDefinition();
}
示例6: processEngineConfiguration
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
public ProcessEngineConfigurationImpl processEngineConfiguration() {
SpringProcessEngineConfiguration springProcessEngineConfiguration = new SpringProcessEngineConfiguration();
springProcessEngineConfiguration.setDatabaseSchemaUpdate(SpringProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE);
springProcessEngineConfiguration.setTransactionManager(platformTransactionManager());
springProcessEngineConfiguration.setJobExecutorActivate(false);
springProcessEngineConfiguration.setDataSource(dataSource());
return springProcessEngineConfiguration;
}
示例7: activitiProcessEngineConfiguration
import org.activiti.spring.SpringProcessEngineConfiguration; //导入依赖的package包/类
/**
* Gets the Activiti Process Engine Configuration.
*
* @param activitiAsyncExecutor the async executor to set on the configuration.
*
* @return the Activiti Process Engine Configuration.
*/
@Bean
public SpringProcessEngineConfiguration activitiProcessEngineConfiguration(AsyncExecutor activitiAsyncExecutor)
{
// Initialize a new process engine configuration for Activiti that is Spring enabled.
SpringProcessEngineConfiguration configuration = new SpringProcessEngineConfiguration();
// Share the herd data source and transaction manager with Activiti so all DB operations between the herd schema and the Activiti schema will occur
// within the same transaction that can be committed or rolled back together.
configuration.setDataSource(herdDataSource);
configuration.setTransactionManager(herdTransactionManager);
// Set the database schema update approach. This will be different for the main application and JUnits which is why we get it from a bean
// via the method below.
configuration.setDatabaseSchemaUpdate(getActivitiDbSchemaUpdateParamBeanName());
// Enable the async executor so threads can be picked up and worked on.
configuration.setAsyncExecutorActivate(true);
// Explicitly wire in our "Spring" async executor which in turn is configured with our own task executor.
configuration.setAsyncExecutorEnabled(true);
configuration.setAsyncExecutor(activitiAsyncExecutor);
// Set the allowed beans to an empty map so the Activiti workflows won't be able to call any arbitrary bean (e.g. services, etc.).
configuration.setBeans(new HashMap<>());
// Explicitly set a custom herd delegate interceptor that allows us to autowire in Spring beans onto our Java delegate tasks.
configuration.setDelegateInterceptor(herdDelegateInterceptor);
// Explicitly set a custom herd command invoker that allows us to perform specialized logging for asynchronous tasks.
configuration.setCommandInvoker(herdCommandInvoker);
// Initialize the scripting engines.
initScriptingEngines(configuration);
configuration.setMailServerDefaultFrom(configurationHelper.getProperty(ConfigurationValue.ACTIVITI_DEFAULT_MAIL_FROM));
// Attach a custom herd process engine configurator that will allow us to modify the configuration before the engine is built.
List<ProcessEngineConfigurator> herdConfigurators = new ArrayList<>();
herdConfigurators.add(herdProcessEngineConfigurator);
configuration.setConfigurators(herdConfigurators);
// Return the configuration.
return configuration;
}