zoukankan      html  css  js  c++  java
  • activiti与spring的集成

    maven的pom文件

    <!-- https://mvnrepository.com/artifact/org.activiti/activiti-engine -->
    <dependency>
        <groupId>org.activiti</groupId>
        <artifactId>activiti-engine</artifactId>
        <version>5.22.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.activiti/activiti-spring -->
    <dependency>
        <groupId>org.activiti</groupId>
        <artifactId>activiti-spring</artifactId>
        <version>5.22.0</version>
    </dependency>

    xml文件

    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
     <property name="datasource" ref="datasource">
        <property name="transactionManager" ref="transactionManager">
     <property name="databaseSchemaUpdate" value="true">
    
    <!-- 创建流程引擎对象-->
     <bean id="processEngine" class="org.activiti.spring.ProcessEnginefactoryBean">
    <property name="processEngineConfiguration" value="processEngineConfiguration"></property>
    </bean>
    
    
    <!--实例化各个service-->
    <bean id="repositoryService" factory-bean="processEngine" factory-method="getRespositoryService" />
    ....
    以此类推,构建以下各个bean
    runtimeService,taskService,formService,historyService,managementService,identityService
    </bean>
     

    构建出需要的各个service,就可以在前台直接注入了。

    参考上一篇,spring的三种构建方式,

    这里使用的是使用实例工厂方式构建,不是静态方法。

  • 相关阅读:
    September 22nd 2016 Week 39th Thursday
    September 21st 2016 Week 39th Wednesday
    android 几个小技巧
    深入理解计算机系统----经验之谈
    输入数字如何获取
    super 和this的用法
    java程序员修炼之道
    eclipse 如何使用svn
    如何手动添加Android Dependencies包
    如何查看正在使用端口号并利用任务管理器将其关闭
  • 原文地址:https://www.cnblogs.com/sdgtxuyong/p/13265441.html
Copyright © 2011-2022 走看看