让zheng支持activiti工作流

我公司采用分布式敏捷架构zheng:https://gitee.com/shuzheng/zheng。不过,如果要让此架构支持activiti工作流,需要进行一定的配置。

一、打开zheng-common项目的pom.xml文件,添加activiti包。

<dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-engine</artifactId>
    <version>5.14</version>
  </dependency>

  <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-spring</artifactId>
    <version>5.14</version>
  </dependency>
二、在 zheng-rpc-service资源项目里添加activiti.cfg.xml文件。内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="activityFontName" value="微软雅黑"></property>

        <property name="dataSource" ref="dataSource"></property>
        <property name="transactionManager" ref="transactionManager"></property>
        <!-- 建表策略 -->
        <property name="databaseSchemaUpdate" value="true"></property>
        <!-- 历史控制级别 -->
        <property name="history" value="full"></property>
    </bean>

    <bean id="processEngineFactoryBean" class="org.activiti.spring.ProcessEngineFactoryBean">
        <property name="processEngineConfiguration" ref="processEngineConfiguration"></property>
    </bean>

    <bean id="repositoryService" factory-bean="processEngineFactoryBean" factory-method="getRepositoryService"></bean>
    <bean id="runtimeService" factory-bean="processEngineFactoryBean" factory-method="getRuntimeService"></bean>
    <bean id="taskService" factory-bean="processEngineFactoryBean" factory-method="getTaskService"></bean>
    <bean id="historyService" factory-bean="processEngineFactoryBean" factory-method="getHistoryService"></bean>
    <bean id="formService" factory-bean="processEngineFactoryBean" factory-method="getFormService"></bean>
    <bean id="identityService" factory-bean="processEngineFactoryBean" factory-method="getIdentityService"></bean>
    <bean id="managementService" factory-bean="processEngineFactoryBean" factory-method="getManagementService"></bean>

</beans>


三、在applicationContext-jdbc.xml文件添加一行导入资源代码:

 <import resource="activiti.cfg.xml"/>

添加好后的示例如图所示:





  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值