当前位置: 首页>>代码示例>>Java>>正文


Java SpringProcessEngineConfiguration.setDataSource方法代码示例

本文整理汇总了Java中org.activiti.spring.SpringProcessEngineConfiguration.setDataSource方法的典型用法代码示例。如果您正苦于以下问题:Java SpringProcessEngineConfiguration.setDataSource方法的具体用法?Java SpringProcessEngineConfiguration.setDataSource怎么用?Java SpringProcessEngineConfiguration.setDataSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.activiti.spring.SpringProcessEngineConfiguration的用法示例。


在下文中一共展示了SpringProcessEngineConfiguration.setDataSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:rafizanbaharum,项目名称:cfi-gov,代码行数:17,代码来源:CfBizWorkflowConfig.java

示例2: 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;
}
 
开发者ID:joshlong,项目名称:javaconfig-ftw,代码行数:9,代码来源:DefaultActivitiConfigurer.java

示例3: 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;
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:52,代码来源:ServiceSpringModuleConfig.java


注:本文中的org.activiti.spring.SpringProcessEngineConfiguration.setDataSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。