当前位置:七道奇文章资讯编程技术Java编程
日期:2011-03-22 16:14:00  来源:本站整理

Jbpm 4.1与Spring集成[Java编程]

赞助商链接



  本文“Jbpm 4.1与Spring集成[Java编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

Jbpm4.1特点:

4.1与Tomcat集成的很好

4.1供应基于Web的流程编辑功效

在开辟指南中有相关整合章节:

16.2. Configuration

Replace the standard-transaction-interceptor with the spring-transaction-interceptor. The hibernate session needs the attribute current=”true”. Also, the <transaction/> must be removed from the transaction-context if you want the transactions to be handled by Spring only. This forces jBPM to search for the current session, which will be provided by Spring.

 <process-engine-context>
<command-service>
<spring-transaction-interceptor />
...
</command-service>
...
</process-engine-context>
<transaction-context>
...
<hibernate-session current="true"/>
</transaction-context>

The Spring integration provides a special context, which is added to the set of context where the jBPM engine will look for beans. Using this SpringContext, it is now possible to retrieve beans from the Spring Application Context. For the Spring context to be known, a SpringConfiguration must be created. This class extends the JbpmConfiguration but will add itself as a context. The single constructor take the location of the jBPM configuration.

 <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
<constructor-arg value="be/inze/spring/demo/jbpm.cfg.xml" />
</bean>

The jBPM services can also be defined in the Spring applicationContext, as following:

<bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />

16.3. Usage

The previous section already showed how the jBPM services can be made accessible for other Spring services. The other use case is calling Spring beans from within a process. This can be done by using an expression which resolves to the name of a Spring bean.

<java name="echo" expr="#{echoService}" method="sayHello" >
<transition name="to accept" to="join1"/>
</java>

The scripting engine will look into all contexts from the bean named echoService. If you configured the ScriptManager as above, Spring will be the last context to search for. You can also add a Spring bean to the Spring Application context (eg IdentitySessionImpl with id identitySession) and use it in the jBPM config (eg by adding <env class="identitySession" />)

整合历程与 4 基本相同.

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.identity.cfg.xml" />
   <import resource="jbpm.businesscalendar.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" />
   -->
   <import resource="jbpm.jobexecutor.cfg.xml" />
   <import resource="jbpm/jbpm.mail.templates.examples.xml" />

</jbpm-configuration>

工作日历从 default中别离

整合XML在原生的jbpm.tx.spring.cfg.xml 中


  以上是“Jbpm 4.1与Spring集成[Java编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
  • Liferay Portal之jbpm配置
  • JBPM4 4.0操纵问题 -- 2: jbpm 4 在Tomcat 6.0上 运行问题
  • <b>JBPM 4.0操纵问题 -- 3:也谈 JBPM 4 整合Spring..</b>
  • JBPM4 4.0操纵问题 -- 1:结合Sqlserver操纵问题
  • Jbpm 4.1与Spring集成
  • 基于JBPM的简单报销实例
  • jBPM4 PVM的流程定义模子与历程调度
  • <b>jBPM-Side流程筹划器架构阐明</b>
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .