Advertisement
Guest User

Untitled

a guest
May 17th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <beans xmlns="http://www.springframework.org/schema/beans"
  2. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://www.springframework.org/schema/context
  7. http://www.springframework.org/schema/context/spring-context-2.5.xsd
  8. http://www.springframework.org/schema/tx
  9. http://www.springframework.org/schema/tx/spenter code herering-tx-3.0.xsd">
  10.  
  11. <tx:annotation-driven transaction-manager="transactionManager"/>
  12.  
  13. <bean id="dataSource"
  14. class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
  15. <property name="driverClass" value="org.postgresql.Driver" />
  16. <property name="url" value="jdbc:postgresql://localhost:5432/activiti_ex_db" />
  17. <property name="username" value="postgres" />
  18. <property name="password" value="user" />
  19. </bean>
  20.  
  21. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  22. <property name="dataSource" ref="dataSource" />
  23. </bean>
  24.  
  25. <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  26. <property name="dataSource" ref="dataSource" />
  27. <property name="transactionManager" ref="transactionManager" />
  28. <property name="databaseSchemaUpdate" value="create-drop" />
  29. <property name="jobExecutorActivate" value="false" />
  30. </bean>
  31.  
  32. <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
  33. <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  34. </bean>
  35.  
  36. <!-- <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  37. <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
  38. <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
  39. <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
  40. <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" /> -->
  41.  
  42. import org.activiti.spring.ProcessEngineFactoryBean;
  43.  
  44. public static void main(String[] args) {
  45. ClassPathXmlApplicationContext applicationContext = null;
  46. try {
  47. applicationContext = new ClassPathXmlApplicationContext("/spring-context.xml");
  48. ProcessEngineFactoryBean processEngin =(ProcessEngineFactoryBean) applicationContext.getBean("processEngine");
  49. System.out.println(processEngin);
  50. } catch (Exception e) {
  51. e.printStackTrace();
  52. applicationContext = null;
  53. }
  54. }
  55.  
  56. May 17, 2016 7:20:35 PM org.activiti.engine.impl.interceptor.CommandContext close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement