Use jbpm to develop enterprise process applications and deploy the process engine and console on Tomcat

Source: Internet
Author: User
Tags jbpm

Jbpm is a sub-project of JBoss, so its deployment on JBoss is quite simple, basically no nonsense, because in the jbpm Suite version (suite) the server directory in is a JBoss that has already deployed jbpm. However, this JBoss must start a lot of applications when it is started, which is too slow to handle. Therefore, we 'd better deploy a pure and independent jbpm application on Tomcat for research.

 

First, we need to create a database. The database directory contains scripts for various databases. For convenience, we use the default jbpm. jpdl. HSQLDB. SQL to create a database on HSQLDB.

HSQLDB is a lightweight and easy-to-use memory/text database. It is an excellent product for demo. How to Use HSQLDB is not the focus of this discussion. You can run the HSQLDB console to create a database:

Java-cp hsqldb. Jar org. HSQLDB. util. databasemanager

At the same time, assume that you store data in text files:

D:/_ tech/jbpm-jpdl-Suite/_ HSQLDB/huqi_jbpm.txt

Then, our database connection description is:

JDBC: HSQLDB: file: D: // _ tech/jbpm-jpdl-Suite/_ HSQLDB/huqi_jbpm.txt

 

After the database is installed and the table is created, we can start to deploy the war package of the console and workflow engine. The jbpm-console.war in the deploy directory is exactly this war package, which is deployed on Tomcat and needs to be modified and configured.

Locate the el-api.jar and el-ri.jar jar packages and add them to the corresponding lib directory in the war package.

Find the file hibernate. cfg. XML in the classes directory of the war package, first modify the data source, and change the hibernate. Connection. url attribute:

<Property name = "hibernate. Connection. url"> JDBC: HSQLDB: file: D: _techjbpmjbpm-jpdl-suite_hsqldbhuqi_jbpm.txt </property>

The complete hibernate data source configuration is:

<! -- Hibernate Dialect -->
<Property name = "hibernate. dialect"> org. hibernate. dialect. hsqldialect </property>

<! -- JDBC Connection Properties (BEGIN) -->
<Property name = "hibernate. Connection. driver_class"> org. HSQLDB. jdbcdriver </property>
<Property name = "hibernate. Connection. url"> JDBC: HSQLDB: file: D: _techjbpmjbpm-jpdl-suite_hsqldbhuqi_jbpm.txt </property>
<Property name = "hibernate. Connection. username"> SA </property>
<Property name = "hibernate. Connection. Password"> </property>
<! -- JDBC Connection Properties (end) -->

In addition, you can see this section:

<! -- Following Mapping Files have a dependendy on -->
<! -- 'Jbpm-identity. jar', Mapping Files -->
<! -- Of the pluggable jbpm identity component. -->
<! -- Uncomment the following 3 lines if you -->
<! -- Want to use the jbpm identity mgmgt -->
<! -- Component. -->
<! -- Identity mappings (BEGIN) -->
<Mapping Resource = "org/jbpm/identity/user. HBM. xml"/>
<Mapping Resource = "org/jbpm/identity/group. HBM. xml"/>
<Mapping Resource = "org/jbpm/identity/membership. HBM. xml"/>
<! -- Identity mappings (end) -->

This is an organizational system that comes with jbpm and is used to assign Process participants. These three tables are not found in our database creation script (you can also create these three tables if you are interested), so please comment out these three rows! Then jbpm will use the user system of Tomcat to allocate participants.

By the way, this version of jbpm must run at least the tomcat5.0 version. Otherwise, it will tell you that the Web. XML format is incorrect.

Tomcat's user systems are all defined in tomcat_home/CONF/tomcat-users.xml, And the jbpm designer can create a default test flow in which the participants involved can be defined in the tomcat-users.xml, example:

<? XML version = '1. 0' encoding = 'utf-8'?>
<Tomcat-users>
<Role rolename = "Administrator"/>
<Role rolename = "Tomcat"/>
<Role rolename = "role1"/>
<Role rolename = "manager"/>
<Role rolename = "admin"/>
<Role rolename = "participant ipant"/>
<User Username = "Ernie" Password = "Ernie" roles = "Administrator, Manager, participant"/>
<User Username = "Bert" Password = "Bert" roles = "participant"/>
<User Username = "Tomcat" Password = "Tomcat" roles = "Tomcat"/>
<User Username = "both" Password = "Tomcat" roles = "tomcat, role1"/>
<User Username = "role1" Password = "Tomcat" roles = "role1"/>
<User Username = "Grover" Password = "Grover" roles = "participant"/>
<User Username = "monster" Password = "monster" roles = "participant"/>
<User Username = "huqi" Password = "huqi" roles = "Administrator, Manager, participant"/>
<User Username = "cookie" Password = "cookie" roles = "participant"/>
<User Username = "admin" Password = "" roles = "Admin, Manager"/>
</Tomcat-users>

 

Finally, copy the modified war package to the Tomcat webapps directory, start Tomcat, and access the console:

Http: // MAID: 8080/jbpm-console/

OK!

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.