06-10-2015 04:13 PM
@Configuration
public class ActivitiConfiguration {
@Bean
public SpringProcessEngineConfiguration processEngineConfiguration(DataSource dataSource,
PlatformTransactionManager transactionManager,
EntityManagerFactory entityManagerFactory) {
SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
engineConfiguration.setDataSource(dataSource);
engineConfiguration.setTransactionManager(transactionManager);
engineConfiguration.setJpaEntityManagerFactory(entityManagerFactory);
engineConfiguration.setHistory(HistoryLevel.FULL.getKey());
engineConfiguration.setDeploymentResources(deploymentResources());
engineConfiguration.setDeploymentMode("single-resource");
return engineConfiguration;
}
private Resource[] deploymentResources() {
Resource[] processResource = new Resource[1];
processResource[0] = new ClassPathResource("bpm/activiti/XPTOProcess.bpmn20.xml");
return processResource;
}
@Bean
public ProcessEngine processEngine(SpringProcessEngineConfiguration springProcessEngineConfiguration,
ApplicationContext applicationContext) throws Exception {
ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
processEngineFactoryBean.setProcessEngineConfiguration(springProcessEngineConfiguration);
processEngineFactoryBean.setApplicationContext(applicationContext);
return processEngineFactoryBean.getObject();
}
}
06-19-2015 02:05 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.