JBPM and Spring Integration

Source: Internet
Author: User
Tags jbpm

Spring with the Jbpm the Integration

1, the necessity of integration:

Business data operations and process operations in the process need to be implemented in the same transaction

For example: leave process--leave the person to submit a leave request, the process jumps to the next node task (JBPM data ) record the leave person information to the user table ( Business Data )

an operation that may involve both JBPM data and business data, if used with two transactions, can lead to inconsistencies in business-to-process data.

2, integration diagram


Integration principle:

( 1 ) using Spring Container IOC provided by beanfactory function Initialization JBPM of the Configuration .

( 2 ) to make business data and JBPM Public sessionfactory .

3,the core ofSpring and Jbpm integration:

(1) generated by the Spring container processengine

(2)Jbpm 's affairs are given to spring processing

4, integration steps

* Import JBPM Jar Package

* Delete the jar packages for DB and Hibernate

* Create a configuration file under Config

config/jbpm

Jbpm.cfg.xml

Jbpm.hibernate.cfg.xml

* in Jbpm.cfg.xml file

<import resource= "Jbpm.tx.hibernate.cfg.xml"/>

instead     

<import resource= "Jbpm.tx.spring.cfg.xml"/>

Unification is handled by spring, and by the configuration on the right it is possible to open a transaction by creating a new session

* in Jbpm.hibernate.cfg.xml file

* Connection Configuration of database

<propertyname= "Current_session_context_class" >thread</property>

This line of configuration cannot be written and cannot be retrieved from the current thread

* Map file for the table of OA project itself

* Mapping file for JBPM tables

* Spring configuration file

* Path modification of hibernate configuration file

<bean id= "Sessionfactory" class= "Org.springframework.orm.hibernate3.LocalSessionFactoryBean" >       < Property name= "Configlocation" >           <value>classpath:jbpm/jbpm.hibernate.cfg.xml</value>       </property> </bean>

* Let Spring produce processengine

<bean id= "Springhelper" class= "Org.jbpm.pvm.internal.processengine.SpringHelper" >      <property name= " Jbpmcfg "value=" Jbpm/jbpm.cfg.xml "></property> </bean> <bean id=" Processengine "factory-bean=" Springhelper "      factory-method=" Createprocessengine "/>

Note the path to the Jbpm.cfg.xml configuration file

5, Summary:

JBPM with the SSH Integration--Let Spring Manage Builds Processengine , let Hibernate Build JBPM entity database tables.

JBPM and Spring Integration

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.