这几天搭建了spring3+hibernate3+activiti5.1.6的一个项目(用了咖啡猫部分开源项目内容),使用activiti部署流程(自动部署bar方式)之后,用restful方式访问获取流程列表的接口(repository/deployments),比正常返回参数少了url和tenantid。
-------------------------**我是分割线**--------------------------
我访问时候的返回参数:
API手册上写的返回参数:
配置代码如下:
<?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:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
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/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<context:property-placeholder ignore-unresolvable="true" local-override="true"
location="config/application.properties"/>
<util:properties id="APP_PROPERTIES" location="config/application.properties" local-override="true"/>
<!-- 数据源配置, 使用DBCP数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<!-- Connection Info -->
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<!-- Connection Pooling Info -->
<property name="maxActive" value="20"/>
<property name="maxIdle" value="10"/>
<property name="defaultAutoCommit" value="false"/>
<!-- 连接Idle一个小时后超时 -->
<property name="timeBetweenEvictionRunsMillis" value="3600000"/>
<property name="minEvictableIdleTimeMillis" value="3600000"/>
</bean>
<!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
<context:component-scan base-package="me.kafeitu.demo.activiti">
<!-- <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> -->
</context:component-scan>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transManager" proxy-target-class="true"/>
<!-- 引擎内部提供的UUID生成器,依赖fastxml的java-uuid-generator模块 -->
<bean id="uuidGenerator" class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />
<!-- 创建SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan">
<list><value>me.kafeitu.demo.activiti.entity</value></list>
</property>
<!-- 配置映射文件 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
</bean>
<!-- 1.配置事务管理器 -->
<bean id="transManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 配置基础的Dao,在其他的DAO中只需要继承即可 -->
<!-- <bean id="baseDao" abstract="true" class="me.kafeitu.demo.activiti.base.BaseDao">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean> -->
<!-- spring负责创建流程引擎的配置文件 -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource" />
<!-- 配置事务管理器,统一事务 -->
<property name="transactionManager" ref="transManager" />
<!-- 设置建表策略,如果没有表,自动创建表 -->
<property name="databaseSchemaUpdate" value="true" />
<!-- 自动部署 -->
<property name="deploymentResources">
<list>
<value>config/leave-dynamic-from.bar</value>
<value>config/dispatch.bar</value>
</list>
</property>
<!-- 自定义表单字段类型 -->
<property name="customFormTypes">
<list>
<bean class="me.kafeitu.demo.activiti.activiti.form.UsersFormType"/>
</list>
</property>
<!-- 全局事件 -->
<property name="typedEventListeners">
<map>
<entry key="VARIABLE_CREATED" >
<list>
<ref bean="variableCreateListener"/>
</list>
</entry>
</map>
</property>
</bean>
<!-- 创建流程引擎对象 -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
<bean id="formService" factory-bean="processEngine" factory-method="getFormService"/>
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"/>
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>
<!-- Activiti end -->
<!-- <jaxws:endpoint id="leaveWebService" implementor="me.kafeitu.demo.activiti.webservice.LeaveWebServiceImpl" address="/leave"/> -->
</beans>