首先是安装4.4版本的插件.通过使用links方式安装好了插件,前提是7.0以上版本的myeclipse吧. 插件见附件jbpm_jpd_site.zip!
之后,由于插件对于中文支持不是太好,经常二次打开后,乱码,故修改myeclipse.ini,在最后加上 '-Dfile.encoding=UTF-8'. 这样做使得jbpm配置文件不再乱码.但是导致tomcat控制台中文乱码,再次修改tomcat目录下/bin/catalina.bat文件,在set JAVA OPT=XXX 这段话最后也加上'-Dfile.encoding=UTF-8' . 这样就搞定乱码问题了!
一 ssh整合jbpm了,其实很简单:
1.
首先写下jbpm在spring中的配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm.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="jbpmService" class="com.creditease.engine.flow.jbpm.service.JBPMServiceImpl" parent="baseService">
<property name="repositoryService" ref="repositoryService" />
<property name="taskService" ref="taskService" />
<property name="executionService" ref="executionService" />
<property name="jbpmLogService" ref="jbpmLogService" />
</bean>
<bean id="jbpmLogService" class="com.creditease.engine.flow.jbpm.log.JbpmLogServiceImpl" parent="baseService">
</bean>
</beans>
jbpmService是自己封装的工作流服务类,既然是做成组件,那当然业务对象里不能参合工作流的东西了.这个service一会再讲.
jbpmLogService是是用来做历史服务的,详细记录了什么人什么时间执行了什么流程,成功执行还是回退到某个流程.
jbpm.cfg.xml这个文件也是必须的,每天可连不上数据库哦:
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<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" />
<!-- Job executor is excluded for running the example test cases. -->
<!-- To enable timers and messages in production use, this should be included. -->
<!--
<import resource="jbpm.jobexecutor.cfg.xml" />
-->
</jbpm-configuration>
最后,事务控制别忘了做哦:
<!-- 事务控制 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="saveOrUpdate" propagation="REQUIRED" />
<tx:method name="delete" propagation="REQUIRED" />
<tx:method name="get" read-only="true" />
<tx:method name="count" read-only="true" />
<tx:method name="find" read-only="true" />
</tx:attributes>
</tx:advice>
<tx:advice id="jbpmAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="jbpmPointcut"
expression="execution(* com.creditease.engine.**.service.*.*(..))" />
<aop:pointcut id="servicePointcut"
expression="execution(* com.creditease.clic.**.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="servicePointcut" />
<aop:advisor advice-ref="jbpmAdvice" pointcut-ref="jbpmPointcut" />
</aop:config>
jbpmService最好注入在其他服务类中,使用时,调用其他服务类中带事务的方法也就保持了事务一致性了.
这样我们经过以上的一些配置,jbpm与sping就完成了结合的工作了.
二 jbpmService服务类,
下班了,下次有空再写吧.
目前在做接口,供其他开发人员调用,也就是说组件化jbpm.做完了,再上来说,继续忙!
分享到:
相关推荐
jBPM3的简单介绍,使用时遇到的问题解答
JBPM工作流引擎在JBOSS中结合各种数据库的环境搭建
jBPM的学习心得,网络资源汇总 希望对你有帮助
jbpm是一款免费开源的工作流引擎,虽然现在还不完善,但是用起来还是不错的..... 我学习jbpm的一些笔记心得
jBPM是公开源代码项目,它使用要遵循 Apache License。jBPM在2004年10月18日,发布了2.0版本,并在同一天加入了JBoss,成为了JBoss企业中间件平台的一个组成部分,它的名称也改成JBoss jBPM。 jBPM最大的特色就是它...
经过大量的失败之后,以及网上各位大哥的指点,终于将JBPM成功部署到了TOMCAT上面,本文就是一些心得.希望能给初学者带来点好处,有不明白可以加我QQ:376969488,共同交流和学习.
开源工作流产品JBPM的开发指南,是本人在学习JPBM过程中一点心得体会,希望能给各位开发者在使用JBPM过程中带来帮助.
自己学习jBPM4.2过程中的一些心得以及对官方文档的整理
jbpm 工作流开发 java j2ee 各种心得,布骤和总结
陈刚先生在多年的实际工作中,对工作流技术有深入的研究,包括jBPM和OSWorkflow这样的开源产品,都曾经在实际项目中深度使用。他翻译的OSWorkflow官方文档中文版是为数不多的高质量中文OSWorkflow文档之一...
1.2 jbpm3与jbpm4实现对比 1.3 Java、PHPRPC、Hessian、Burlap、AMF3、XML 序列化的效率对比1.4 Effective Java Second Edition中文版已出版1.5 国内开源工作流 Fire Workflow 出炉了 1.6 Word/Excel/PDF文件转换成...