好及怪的jbpm4与spring集成问题

ncu_jjq 2010-11-15
再集成的时候有个如下配置
<process-engine-context>
    <string name="spring.cfg" value="applicationContext-system.xml" />
</process-engine-context>

请问上面的这个配置有什么用,我去掉后做了很多测试没有影响啊。那个value值我也改了,改成根本不存在的也没有什么影响,这是怎么回事呢?
xyz20003 2010-11-15
没啥用,只有在spring没启动,先启动jbpm4的情况下,才会有用。
eminemning 2010-11-15

这是applicationContext.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: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.xsd  http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd 
           http://www.springframework.org/schema/tx
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
	
	<context:annotation-config/>
	<context:component-scan base-package="com.shhjx.poc"/>
	<!--jbpm4.4工作流  -->
	<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
		<property name="jbpmCfg" value="spring-jbpm4.cfg.xml" />
	</bean>
  	<bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
	<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
	<bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
	<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
	<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
	<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"/>
  	  
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
		<property name="url" value="jdbc:oracle:thin:@bm-tp:1521:orcl" />
		<property name="username" value="dsgh" />
		<property name="password" value="```" />
	</bean>  
	
		
	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
		<property name="dataSource" ref="dataSource"/>
	</bean>
	
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.Oracle10gDialect
				</prop>
				<prop key="hibernate.default_batch_fetch_size">10</prop>
				<prop key="hibernate.max_fetch_depth">0</prop>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
		
		<property name="mappingLocations">
			<list>
				<value>classpath*:com/shhjx/poc/model/**/*.hbm.xml</value>
				<value>classpath:jbpm.execution.hbm.xml</value>
				<value>classpath:jbpm.history.hbm.xml</value>
				<value>classpath:jbpm.identity.hbm.xml</value>
				<value>classpath:jbpm.repository.hbm.xml</value>
				<value>classpath:jbpm.task.hbm.xml</value>
		    </list>
		</property>
		
	</bean>

	<bean id="txManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
		<property name="nestedTransactionAllowed" value="true" />
	</bean>

	<tx:annotation-driven transaction-manager="txManager" />

	<bean id="ehcacheManager"
		class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
		<property name="configLocation" value="/WEB-INF/classes/ehcache.xml" />
	</bean>
	
		
</beans>

 

 

 这是spring-jbpm4.cfg.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
	<process-engine-context>
    	<string name="spring.cfg" value="spring-jbpm4.xml" />
  	</process-engine-context>
	<import resource="jbpm.default.cfg.xml" />
	<import resource="jbpm.tx.spring.cfg.xml" />
	<import resource="jbpm.jpdl.cfg.xml" />
	<import resource="jbpm.bpmn.cfg.xml" />
	<import resource="jbpm.identity.cfg.xml" />
	<import resource="jbpm.businesscalendar.cfg.xml" />
	<import resource="jbpm.console.cfg.xml" />
	<!--  
	<import resource="jbpm.jobexecutor.cfg.xml" />
	-->
</jbpm-configuration>

 

 

 按照这样的配置一定能搞定!

 

 

黄永杰 2011-08-04
我在jpdl.xml中调用了一个类,写法如下:
   <task form="manager.html" g="172,225,92,52"  name="经理审批">
     <assignment-handler class="com.zwl.action.JointlySignAction">
       <field name="participants">
         <list>
         <string value="#{manager}"/>
         </list>
       </field>
     </assignment-handler>

类文件:
package com.zwl.action;

import java.util.List;

import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.TaskService;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.task.Assignable;
import org.jbpm.api.task.AssignmentHandler;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.task.OpenTask;


public class JointlySignAction  implements
AssignmentHandler {

/**
*
*/
private static final long serialVersionUID = 1L;


private ProcessEngine processEngine = Configuration.getProcessEngine();
//    private RepositoryService repositoryService;
//    private ExecutionService executionService;
private TaskService taskService = processEngine.getTaskService();
private List<String> participants;


@Override
public void assign(Assignable assignable, OpenExecution execution) throws Exception {
// TODO Auto-generated method stub
// String pid = execution.getProcessInstance().getId();
// Task task = taskService.createTaskQuery().processInstanceId(pid).
// activityName(execution.getName()).uniqueResult();
// createSubTasks(task);
return;
}

// public void createSubTasks(Task task) {
// if(participants != null) {
// for(String participant : participants) {
// Task subTask = ((OpenTask)task).createSubTask();
// subTask.setAssignee(participant);
// taskService.addTaskParticipatingUser(task.getId(), participant, Participation.CLIENT);
// }
// }
// }

public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
}


}

然后,每次调用这个类的时候,都会报classpath下无法找到spring-jbpm4.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<process-engine-context>
    <string name="spring.cfg" value="spring-jbpm4.xml" />
  </process-engine-context>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.tx.spring.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" />
<import resource="jbpm.console.cfg.xml" />
<!-- 
<import resource="jbpm.jobexecutor.cfg.xml" />
-->
</jbpm-configuration>

求教啊!
729251283 2012-01-12
请问一下,事务你们是怎么配置的。
Global site tag (gtag.js) - Google Analytics