站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss JBPM 3.0.4 userguide 英文版文档

Chapter 5. Deployment - JBoss JBPM 3.0.4 userguide 英文版文档

Chapter 5. Deployment

This chapter discusses the deployment issues for using jBPM like required libraries and configuration files. For deploying processes to a jBPM database, see Section 13.1.1, “Deploying a process archive”

5.1. Runtime Dependencies

5.1.1. Java runtime environment

jBPM 3 requires J2SE 1.4.2+

5.1.2. jBPM libraries

jbpm-[version].jar is the library with the core jbpm functionality.

jbpm-identity-[version].jar is the (optional) library containing an identity component as described in Section 9.9, “The identity component”.

5.1.3. Runtime libraries

The only dependency of the core jBPM code is on commons logging. All other libraries are optional. Of course, features such as xml parsing and persistence are dependent on other libraries.

For instance for most deployments jBPM will be used with persistence the only dependencies are the hibernate 3.0 libraries.

Table 5.1. 

LibraryUsageDescriptionDirectory
commons-logging-1.0.4.jarlogging in jbpm and hibernateThe jBPM code logs to commons logging. The commons logging library can be configured to dispatch the logs to e.g. java 1.4 logging, log4j, ... See the apache commons user guide for more information on how to configure commons logging. if you're used to log4j, the easiest way is to put the log4j lib and a log4j.properties in the classpath. commons logging will automatically detect this and use that configuration. lib/hibernate
dom4j-1.6.jarprocess definitions and hibernate persistencexml parsinglib/hibernate
jaxen-1.1-beta-4.jarprocess definitions and hibernate persistencexml parsing (this library is used by dom4j)lib/hibernate
antlr-2.7.4.jarhibernate persistenceparser generator used for hibernate query parsinglib/hibernate
c3p0-0.8.5.jarhibernate persistence (in the default configuration)connection pooling. When configuring a different connection pooling (e.g. an appserver datasource), this library is not required.lib/hibernate
cglib-full-2.0.2.jarhibernate persistencecode generation librarylib/hibernate
commons-collections-2.1.1.jarhibernate persistence lib/hibernate
ehcache-1.1.jarhibernate persistence (in the default configuration)second level cache implementation. When configuring a different cache provider for hibernate, this library is not required.lib/hibernate
hibernate3-rc1.jarhibernate persistencethe best O/R mapperlib/hibernate
jdbc2_0-stdext.jarhibernate persistence lib/hibernate
jta.jarhibernate persistence lib/hibernate
bsh-2.0b2.jarbeanshell script interpretionOnly used in the script's and decision's. When you don't use these process elements, the beanshell lib can be removed, but then you have to comment out the Script.hbm.xml mapping line in the hibernate.cfg.xmllib/bsh

5.2. Configuration files

JBoss jBPM requires various configuration files. For your convenience the jbpm library jbpm-3.*.jar includes default configuration files that are packaged in the library. When jBPM loads a configuration file, it will always look first in the root directory. If the configuration file is not found in the root directory, it will look in the package directory that contains the default configuration file. So you can overwrite the default configurations by putting a modified configuration file in the root of the classpath.

5.2.1. jbpm.properties

Following properties can be specified in the jbpm.properties configuration file

Table 5.2. 

PropertyDefault ValueDescription
jbpm.session.factory.jndi.name if specified, the JbpmSessionFactory.getInstance() method will fetch the singleton instance from the given JNDI location. Otherwise a new JbpmSessionFactory will be created upon initialization of the singleton instance.
jbpm.hibernate.cfg.xmlhibernate.cfg.xmlthe resource location of the hibernate.cfg.xml configuration file
jbpm.hibernate.properties if specified, it will overrde *ALL* properties that are specified in the hibernate.cfg.xml file.
jbpm.authenticatororg.jbpm.security.authenticator.JbpmDefaultAuthenticatora fully qualified classname of a class that implements the org.jbpm.security.authenticator.Authenticator interface.
jbpm.authorizerno default (means no authorization is enforced)a fully qualified classname of a class that implements the org.jbpm.security.authorizer.Authorizer interface.
jbpm.task.instance.classorg.jbpm.taskmgmt.exe.TaskInstancethe fully qualified classname to use for task instances. this allows for customizations of the task list entries.

5.2.2. Hibernate cfg xml file

This file contains hibernate configurations and references to the hibernate mapping resource files.

Location: hibernate.cfg.xml unless specified otherwise in the jbpm.hibernate.cfg.xml property in the jbpm.properties file. In the jbpm project the default hibernate cfg xml file is located in directory src/config.files/hibernate.cfg.xml

5.2.3. Business calendar configuration file

Contains the definition of business hours and free time.

Location: org/jbpm/calendar/jbpm.business.calendar.properties

5.2.4. Variable mapping configuration file

Specifies how the values of the process variables (java objects) are converted to variable instances for storage in the jbpm database.

Location: org/jbpm/context/exe/jbpm.varmapping.properties

5.2.5. Converter configuration file

Specifies the id-to-classname mappings. The id's are stored in the database. The org.jbpm.db.hibernate.ConverterEnumType is used to map the ids to the singleton objects.

Location: org/jbpm/db/hibernate/jbpm.converter.properties

5.2.6. Default modules configuration file

specifies which modules are added to a new ProcessDefinition by default.

Location: org/jbpm/graph/def/jbpm.default.modules.properties

5.2.7. Process archive parsers configuration file

specifies the phases of process archive parsing

Location: org/jbpm/jpdl/par/jbpm.parsers.xml

5.3. jBPM in a web application

Simply put the runtime libraries in the WEB-INF/lib folder of your web application archive (.war).

5.4. jBPM in an EJB container

JBoss jBPM is deployable on any application server. Though currently JBoss jBPM is only tested with the JBoss application server.

Simplest way is to put the runtime libraries into the global classpath of your application server.

Alternatively, you can put the runtime libraries in your application.xml and reference them as libraries.

The starters kit contains jBPM as a service archive.