jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8 Consolidation Example

Source: Internet
Author: User
Tags documentation jbpm

jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8 consolidation examples (with complete absence process examples).

1. The jbpm4.4 test environment constructs

2. jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1. Integration of the environment to build

3. jbpm4.4 Basic Knowledge

4. The solution of common problems in the process of integration

5. Example of leave process (S2SH+JBPM)

6. Summary and Reference articles

jbpm4.4 Test Environment Setup

Just contact jbpm first thing is to quickly build the environment, test jbpm given examples. JBPM is a workflow engine framework, and if there is no Java EE development environment, JBPM also provides installation scripts (ant), one-click provides the installation running environment. You can also integrate jbpm into Eclipse or myeclipse.

The steps to quickly build an environment are:

1. Install the Jbpm-myeclipse plug-in, this plugin with jbpm4.4 release, located in JBPM-4.4/INSTALL/SRC/GPD directory, this installation, you can edit the flowchart in MyEclipse (visual process design)

In Myeclipse->help->myeclipse configuration Centre->software->add site->add from archive file selection jbpm-4.4 /INSTALL/SRC/GPD under the Jbpm-gpd-site.zip

Install this plugin should pay attention to break the net, avoid it to update on the net. Also note: You need to select

Double-click each item to ensure that each item is added to the

(Note: In fact, do not have to choose, with source parts do not choose, in order to save the choice of all)

Tip: If the installation of continuous network, JBPM Plug-ins will be automatically updated online. An error window will also pop up with an unusually slow installation speed. After the installation is complete, the MyEclipse references menu becomes unrecognizable.

2. Build JBPM operating environment.

3. Then configure JPDL support

4. Determine if the JBPM is configured correctly

In myeclipse->new->other->

For configuration jbpm in MyEclipse please refer to the JBPM Help documentation for configuring JBPM under Eclipse.

5. Test Run Environment:

Create a new Java project that will jbpm-4.4/examples the SRC directory and copy it to the project. Then introduce the relevant jar package, Jbpm.jar and all the packages under LIB, regardless of the jar pack selection problem. SRC includes the use of the basic elements in the JBPM. such as start, State, end, SQL, script, fork, join, etc. Then follow JBPM's help documentation, 1.1 points of study.

Talk about the role of the above file: The first is the JBPM configuration file, in which another file was introduced, and in the file that was introduced there was a file containing

Used to create the Hibernate sessionfactory and give it to JBPM's IOC container management.

The second file is the Hibernate configuration file, which contains the Hbm.xml configuration file for the tables required by the JBPM framework.

jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1. Integration of the environment to build

My development environment:

tomcat6.0.28+mysql5.1.30+ Jbpm4.4+hibernate3.5.4+spring3.0.4+struts2.1.8+myeclipse8.6+java JDK 6.0.23

Before setting up the environment, know JBPM first. JBPM, when managing a process, requires the support of a database table, because the underlying logic is so complex. The default downloaded configuration, using the (HSQLDB) memory database. In practical applications, we need to connect to our database. So to build the relevant table in advance, the corresponding SQL file under/jbpm-4.4/install/src/db, of course, you can also use the Hibernate Hibernate.hbm2ddl.auto Automatic table, I suggest that I use to build a statement, will be a lot less trouble (I do not have less trouble here). If the entire development is not integrated with other frameworks (e.g. spring, hibernate), JBPM4 also has its own set of IOC containers that can then configure its services in the IOC container to easily run the services configured by the container. It can also reduce the invocation of code such as a single piece of factory class in the code, reducing the parity, but if you combine the spring framework for the entire development, then there are two containers, two sessionfactory, but only one container is considered in the system. To manage the service, we're going to migrate the JBPM4 services into the spring's IOC container and let spring do the unified management so that we can manage services and transactions through spring's containers.

Consolidation goal: Porting JBPM4 's IOC to spring, let Spring manage a sessionfactory, and need to be clear: JBPM4 's service to the outside world is processengine. Such as:

Private Repositoryservicerepositoryservice;

Private Executionserviceexecutionservice;

Private Historyservicehistoryservice;

Private Taskservicetaskservice;

Private Identityserviceidentityservice;

The above services are obtained through Processengine.

Spring configuration file:

<!--jbpm4.4 Workflow-->

<beanid= "Springhelper" class = "Org.jbpm.pvm.internal.processengine.SpringHelper" >

<propertyname= "jbpmcfg" value = "Jbpm.cfg.xml"/>

</bean>

<beanid= "Sessionfactory"

class = "Org.springframework.orm.hibernate3.LocalSessionFactoryBean" >

<!--

<property name= "Configlocation" >

<value>classpath:jbpm.hibernate.cfg.xml</value> </property>

-->

<propertyname= "DataSource" ref = "DataSource"/>

<propertyname= "Hibernateproperties" >

<props>

<propkey= "Hibernate.dialect" > org.hibernate.dialect.mysqlinnodbdialect</prop >

<propkey= "Hibernate.show_sql" > True </prop >

<propkey= "Hibernate.connection.pool_size" > 1 </prop >

<propkey= "Hibernate.format_sql" > True </prop >

<propkey= "Hibernate.hbm2ddl.auto" > update </prop >

<!--

<prop key= "Hibernate.current_session_context_class" >thread</prop>

-->

</props>

</property>

<propertyname= "Mappinglocations" >

<list>

<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

class = "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >

<propertyname= "Locations" value = "Classpath:jdbc.properties" ></property >

</bean>

<beanid=

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.