spring-activiti.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="
  6. http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  8. http://www.springframework.org/schema/tx
  9. http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
  12. http://www.springframework.org/schema/context
  13. http://www.springframework.org/schema/context/spring-context-4.0.xsd">
  14. <!-- 单例json对象 -->
  15. <bean id="objectMapper" class="com.fasterxml.jackson.databind.ObjectMapper" />
  16. <!-- 数据源的配置 -->
  17. <bean id="activitiDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  18. <property name="user" value="${activitiUser}" />
  19. <property name="password" value="${activitiPassword}" />
  20. <property name="jdbcUrl" value="${activitiUrl}" />
  21. <property name="driverClass" value="${activitiDriver}" />
  22. </bean>
  23. <!-- 事物管理的配置 -->
  24. <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  25. <property name="dataSource" ref="activitiDataSource"/>
  26. </bean>
  27. <!-- 注册一个流程引擎配置对象 -->
  28. <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  29. <!-- 数据库连接池信息 -->
  30. <property name="dataSource" ref="activitiDataSource" />
  31. <property name="databaseType" value="${activitiDialect}" />
  32. <!-- 注入自动建表类型 -->
  33. <property name="databaseSchemaUpdate" value="true" />
  34. <!-- 事务管理器 -->
  35. <property name="transactionManager" ref="transactionManager" />
  36. <!-- 禁用身份模块的功能 不使用activiti中的用户也角色,使用投诉系统自带的-->
  37. <property name="dbIdentityUsed" value="true" />
  38. <!-- 部署方式 自动部署 -->
  39. <property name="deploymentMode" value="single-resource" />
  40. <!-- 部署文件 -->
  41. <property name="deploymentResources" value="/WEB-INF/flow/*.bpmn" />
  42. <!-- 防止生成的图片汉字乱码 -->
  43. <property name="activityFontName" value="宋体" />
  44. <property name="labelFontName" value="宋体" />
  45. <!-- 定时任务 -->
  46. <property name="jobExecutorActivate" value="true" />
  47. <!-- 解决Oracle中表空间中,存在多个activiti数据的错误 提示找不到表的问题请打开此注释 或者执行drop sequence act_evt_log_seq-->
  48. <!-- <property name="databaseSchema" value="ACTIVITI"></property> -->
  49. </bean>
  50. <!-- 注册一个流程引擎对象,通过一个流程引擎工厂bean创建 -->
  51. <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
  52. <!-- 注入流程引擎配置对象 -->
  53. <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  54. </bean>
  55. <!-- 注册activiti中用到的Service对象,其实这里面用到了门面模式,通过门面模式去获得他们各自想要的 -->
  56. <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  57. <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
  58. <bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
  59. <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
  60. <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
  61. <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
  62. <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
  63. </beans>