Integrate jbpm4.4 with spring

Source: Internet
Author: User

Integration with spring is simple:

1) Submit the transaction to spring for management.

2) use spring to obtain the Process Engine processengine.

 

Add the jbpm. cfg. xml file to the src directory of the project:

 <?  XML version = "1.0" encoding = "UTF-8"  ?>  <  Jbpm-Configuration  >    <  Import Resource  = "Jbpm. Default. cfg. xml"   />    <  Import  Resource  = "Jbpm. businesscalendar. cfg. xml"   />    <! --  <Import resource = "jbpm. TX. hibernate. cfg. xml"/>  -->    <! --  Integrated with spring  -->    < 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"   />    <! --  Job executor is excluded for running the example test cases.  -->    <! --  To enable timers and messages in production use, this shocould be pinned ded.  -->    <! --  <Import resource = "jbpm. jobexecutor. cfg. xml"/>  -->  </ Jbpm-Configuration  > 

Add the following configuration in the spring configuration file applicationcontext. xml:

  <  Bean  ID  = "Sessionfactory"  Class  = "Org. springframework. Orm. hibernate3.localsessionfactorybean"  >          <  Property  Name = "Datasource"  Ref  = "Mydatasource"  />          <! --  Ing the object configuration file of jbpm4.4  -->          <  Property  Name  = "Mappingjarlocations"  >                 <  Value  > WEB-INF/lib/jbpm. Jar </ Value  >          </  Property  >          <  Property  Name  = "Hibernateproperties"  >            <  Value  >  Hibernate. dialect = org. hibernate. dialect. mysql5dialect  <! --  Automatic table Creation -->  Hibernate. hbm2ddl. Auto = Update  </  Value  >          </  Property  >     </  Bean  >  <! --  Jbpm4.4 Configuration  -->       <  Bean ID  = "Springhelper"  Class  = "Org. jbpm. PVM. Internal. processengine. springhelper"  >                <  Property  Name  = "Jbpmcfg"  Value  = "Jbpm. cfg. xml"  > </  Property  >       </  Bean >           <  Bean  ID  = "Processengine"  Factory-bean  = "Springhelper"  Factory-Method  = "Createprocessengine"  /> 

Of course, the jar package of jbpm4.4 must also be copied to the project path. Pay attention to some jar package conflicts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.