Activiti中的流程配置文件

Activiti中的流程配置文件类型可以分为以下两种:

1)普通配置,即Activiti的配置风格,通常情况下,使用该方式的文件名称为activiti.cfg.xml。

2)Spring配置,即Spring配置风格,使用该方式的文件名称可以自定义,例如activiti-context.xml、spring-activiti.xml等。

 

Activiti配置风格

activiti.cfg.xml配置文件的内容如下:

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         
    xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
		http://www.springframework.org/schema/mvc 
		http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd 
		http://www.springframework.org/schema/context 
	    http://www.springframework.org/schema/context/spring-context-3.1.xsd 
		http://www.springframework.org/schema/aop 
		http://www.springframework.org/schema/aop/spring-aop-3.1.xsd 
		http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx-3.1.xsd ">
    <!-- 定义一个id为processEngineConfiguration的流程引擎配置类,然后为它设置属性值 -->
    <bean id="processEngineConfiguration" 
            class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
        <!-- 数据库连接配置 -->
        <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti_test?
            createDatabaseIfNotExist=true"></property>
        <property name="jdbcDriver" value="com.mysql.jdbc.Driver"></property>
        <property name="jdbcUsername" value="root"></property>
        <property name="jdbcPassword" value="root"></property>
        <!-- 建表策略 -->
        <property name="databaseSchemaUpdate" value="true"></property>
        <!-- 其它省略 -->
    </bean>
</beans>

 

Spring配置风格

 

spring方式创建流程引擎与Activiti单独创建流程引擎是不一样的,区别在于:使用的引擎配置类不一样。

Activiti单独创

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值