本章讨论用jBPM库和配置文件的发布问题. 发布流程到jPBM数据库,参看 章节 13.1.1, “发布流程文档”
核心jBPM代码唯一相关的库是commons logging. 其他的库都是可选的. 当然, xml解析和永久化依赖其他的库.
大多数的jBPM的发布依赖hibernate 3.0 库来做永久化.
表格 5.1.
| 库 | 用法 | 描述 | 目录 |
|---|---|---|---|
| commons-logging-1.0.4.jar | logging in jbpm and hibernate | The 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.jar | 流程定义和hibernate 永久化 | xml解析 | lib/hibernate |
| jaxen-1.1-beta-4.jar | 流程定义和hibernate 永久化 | xml解析(这个库是dom4j要使用) | lib/hibernate |
| antlr-2.7.4.jar | hibernate 永久化 | hibernate查询解析的时候要用来生成解析 | lib/hibernate |
| c3p0-0.8.5.jar | hibernate 永久化 (默认的配置) | 连接池. When configuring a different connection pooling (e.g. an appserver datasource), this library is not required. | lib/hibernate |
| cglib-full-2.0.2.jar | hibernate 永久化 | code generation library | lib/hibernate |
| commons-collections-2.1.1.jar | hibernate 永久化 | lib/hibernate | |
| ehcache-1.1.jar | hibernate 永久化 (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.jar | hibernate 永久化 | the best O/R mapper | lib/hibernate |
| jdbc2_0-stdext.jar | hibernate 永久化 | lib/hibernate | |
| jta.jar | hibernate 永久化 | lib/hibernate | |
| bsh-2.0b2.jar | beanshell script interpretion | Only 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.xml | lib/bsh |
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.
下列属性都是在配置文件jbpm.properties中使用的
Table 5.2.
| 属性 | 默认值 | Description |
|---|---|---|
| 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.xml | hibernate.cfg.xml | the 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.authenticator | org.jbpm.security.authenticator.JbpmDefaultAuthenticator | a fully qualified classname of a class that implements the org.jbpm.security.authenticator.Authenticator interface. |
| jbpm.authorizer | no 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.class | org.jbpm.taskmgmt.exe.TaskInstance | the fully qualified classname to use for task instances. this allows for customizations of the task list entries. |
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
Contains the definition of business hours and free time.
Location: org/jbpm/calendar/jbpm.business.calendar.properties
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
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
specifies which modules are added to a new ProcessDefinition by default.
Location: org/jbpm/graph/def/jbpm.default.modules.properties
Simply put the runtime libraries in the WEB-INF/lib folder of your web application archive (.war).