Administration And Configuration Guide
The Administration and Configuration Guide for Red Hat JBoss BPM Suite
Abstract
Part I. Introduction
Chapter 1. Business Process Model and Notation
1.1. About Red Hat JBoss BPM Suite
1.2. Components
Execution Engine- provides the runtime environment for Processes and Business Rules. It encompasses a workflow library that can be embedded into a user web application. Runtime manager is the root object and contains the following components:Runtime Engine- implements the core behavior of the computer language and it is provided by the runtime manager.Process Engine- is the environment for business process model execution.Task Service- handles human task lifecycles.
Rule Engine- can be used with the process engine or on its own.Rules Evaluation- executes business rules on the provided set of facts.Complex Event Processing- applies business rules on incoming stream of events.
Business Central- a web-based application that accommodates tooling for asset creation, management, and monitoring by providing an integrated web environment.Asset Repository- is the central sharing location (Knowledge Store) for business assets, processes, rules, forms, etc. Users access this repository through the Project Explorer view of Business Central via → . By default, the product initializes a local GIT repository as its Asset Repository. However, other repositories may be added or removed as necessary.Artifact Repository- is a Maven based repository for storage of project jar artifacts.Execution Server- provides an execution environment for business process instances and tasks.Business Activity Monitor- provides customizable view on business performance.
Note
1.3. Use Case: Process-based solutions in the loan industry

Figure 1.1. High-level loan application process flow

Figure 1.2. Loan Application Process Automation
Part II. Configuration
Chapter 2. Business Central configuration
DEPLOY_DIRECTORY/business-central.war/WEB-INF/web.xml and the referenced files, and if deployed on Red Hat JBoss EAP 6, also in jboss-web.xml and jboss-deployment-structure.xml.
2.1. Access control
$JBOSS_HOME/standalone/deployments/business-central.war/WEB-INF/classes/userinfo.properties.
admin: administrates BPMS system and has full access rights to make any changes necessary including the ability to add and remove users from the system.developer: implements code required for processes to work and has access to everything except administration tasks.analyst: creates and designs processes and forms and instantiates the processes. This role is the similar to a developer, without access to asset repository and deployments.user: claims, performs, and invokes other actions (such as, escalation, rejection, etc.) on the assigned Tasks and has no access to authoring functions.manager: monitors the system and its statistics and only has access to the dashboard.business user: takes action on business tasks that are required for processes to continue forward. Works primarily with the task list.
$JBOSS_HOME/add-user.sh script and create an Application User in the ApplicationRealm with the respectives roles.
Workbench Configuration
$JBOSS_HOME business-central.war/WEB-INF/classes/workbench-policy.propeties
Authentication in Human Tasks
Warning
Chapter 3. Command line configuration
kie-config-cli tool is a command line configuration tool that provides capabilities to manage the system repository from the command line and can be used in an online or offline mode.
Online mode(default and recommended) - on startup, the tool connects to a Git repository using a Git server provided bykie-wb. All changes are made locally and published to upstream only after explicitly executing the push-changes command. Use the exit command to publish local changes. To discard local changes on exit, use the discard command.Offline mode(a kind of installer style) - creates and manipulates the system repository directly on the server (there is no discard option).
- Go to the Red Hat Customer Portal and log in.
- Click → .
- In the Product Downloads page that opens, click Red Hat JBoss BPM Suite.
- From the Version drop-down menu, select 6.0.3.
- In the displayed table, navigate to the Supplementary Tools row and then click Download.
kie-config-cli-6.MINOR_VERSION-redhat-x-dist with file kie-config-cli.sh.
3.1. Starting the kie-config-cli tool in online mode
- To start the kie-config-cli tool in online mode, navigate to the
kie-config-cli-6.MINOR_VERSION-redhat-x-distdirectory where you installed the tool and then execute the following command. - In a Unix environment run:
./kie-config-cli.sh
In a Windows environment run:./kie-config-cli.bat
git://kie-wb-host:9148/system
3.2. Starting the kie-config-cli tool in offline mode
- Navigate to the
kie-config-cli-6.MINOR_VERSION-redhat-x-distdirectory where you installed the tool. - In a Unix environment, run:
./kie-config-cli.sh offline
In a Windows environment, run:./kie-config-cli.bat offline
.niogit) is located. If .niogit does not yet exist, the folder value can be left empty and a brand new setup is created.
3.3. Commands available for the kie-config-cli tool
add-deployment- adds a new deployment unitadd-repo-org-unit- adds a repository to the organizational unitadd-role-org-unit- adds role(s) to an organizational unitadd-role-project- adds role(s) to a projectadd-role-repo- adds role(s) to a repositorycreate-org-unit- creates new organizational unitcreate-repo- creates a new git repositorydiscard- does not publish local changes, cleans up temporary directories and closes the toolexit- publishes work, cleans up temporary directories and closes the toolhelp- prints available commands with descriptionslist-deployment- lists available deploymentslist-org-units- lists available organizational unitslist-repo- lists available repositoriespush-changes- pushes changes to upstream repository (in online mode only)remove-deployment- removes existing deploymentremove-org-unit- removes existing organizational unitremove-repo- removes an existing repository from config onlyremove-repo-org-unit- removes a repository from the organizational unitremove-role-org-unit- removes role(s) from an organizational unitremove-role-project- removes role(s) from a projectremove-role-repo- removes role(s) from a repository
Chapter 4. Migration
4.1. Data Migration
- Download the migration tool by logging in at the Red Hat Customer Portal and then navigating to Red Hat JBoss BPM Suite Software Downloads section. Click on Red Hat JBoss BPM Suite Migration Tool to download the zip archive.
- Unzip the downloaded zip archive in a directory of your choice, navigate to this directory in a command prompt and then run the following command:
./bin/runMigration.sh -i <source-path> -o <destination-path> -r <repository-name>
- <source-path> is a path to a source JCR repository.
- <desintation-path> is a path to a destination GIT VFS. This folder must not exist already.
- <repository-name> an arbitrary name for the new repository.
Importing the repository in Business Central
Note
Importing the repository in JBDS
- Start JBoss Developer Studio.
- Start the Red Hat JBoss BPM Suite server (if not already running) by selecting the server from the server tab and click the start icon.
- Select → and navigate to the Git folder. Open the Git folder to select and click next.
- Select the repository source as and click next.
- Select the repository that is to be configured from the list of available repositories.
- Import the project as a general project in the next window and click next. Name this project and click Finish.
4.2. Runtime Migration
- Set the system property
jbpm.v5.id.strategyto true in the BPMSstandalone.xml:<property name="jbpm.v5.id.strategy" value="true"/>
- Load the KieSession like the following:
KieSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionID, kbase, sessionConf, env);
- Continue the normal execution of the process using KieSession methods:
ksession.signalEvent("SomeEvent", null);
4.3. API and Backwards Compatibility
knowledge-api jar for backwards compatible code. This API is the public interface for working with BPMS and BRMS and is backwards compatible.
4.4. Migrating task service
LocalHTWorkItemHandler.
Chapter 5. Data management
5.1. Data backups
- any customized deployment descriptors (such as,
web.xml,jboss-web.xml,jboss.xml) - any customized properties files
Note
Consider backing up the entirebusiness-central.waranddashbuilder.warfiles.
5.2. Setup Indexes
Setup foreign key indexes
5.3. Setting up the Database
- Postgres
- The following sql sentence is used to create a Postgres database:
CREATE DATABASE dashbuilder WITH ENCODING='UTF8' OWNER=dashbuilder CONNECTION LIMIT=-1Note
The database encoding must be UTF8 - DB2
- DB2 database can be created using the following sql sentence:
CREATE DATABASE dashb PAGESIZE 16384
Note
The default pagesize for DB2 systems is 4k which is not enough for the dashbuilder table columns size. The pagesize should be forced to 16384 as shown in the above sentence.
<datasource jndi-name="java:jboss/datasources/jbpmDS" enabled="true" use-java-context="true" pool-name="postgresqlDS">
<connection-url>jdbc:postgresql://localhost/test</connection-url>
<driver>postgresql</driver>
<pool></pool>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>5.4. Editing the Database
java:jboss/datasources/ExampleDS
standalone.xml.
Note
Procedure 5.1. Changing Database
- Install the database driver on JBoss (refer to JBoss driver documentation).
- Create an empty database and a JBoss data source which connects to the database driver.
- Modify the file
dashbuilder.war/WEB-INF/jboss-web.xml:<jboss-web> <context-root>/dashbuilder</context-root> <resource-ref> <res-ref-name>jdbc/dashbuilder</res-ref-name> <res-type>javax.sql.DataSource</res-type> <jndi-name>java:jboss/datasources/myDataSource</jndi-name> </resource-ref> ... - Replace the jndi-name parameter value by the JNDI path of the JBoss data source you've just created.
- Modify the file
dashbuilder.war/WEB-INF/jboss-deployment-structure.xml - Add the following snippet of configuration inside the
deploymenttag, wherejdbcDriverModuleNameis the name of the JBoss JDBC driver module:<dependencies> <module name="jdbcDriverModuleName" /> </dependencies>
Chapter 6. Asset repository
Project Explorer from the unified environment of Red Hat JBoss BPM Suite.
6.1. Creating a repository
Important
ADMIN role can create a repository.
Procedure 6.1. Creating a New Repository
- Open the Administration perspective: on the main menu, click → .
- On the perspective menu, click → .
- The Create Repository pop-up window is displayed.

Figure 6.1. Create Repository Pop-up
- Enter the mandatory details:
- Repository name.
Note
Note that the repository name should be a valid filename. Avoid using a space or any special character that might lead to an invalid folder name. - Select an organizational unit in which the repository is to be created from the Organizational Unit drop-down option.
- Click Create
- A confirmation prompt with an OK button is displayed which notifies the user that the repository is created successfully. Click OK.
6.2. Cloning a repository
Important
ADMIN role can clone a repository.
Procedure 6.2. Cloning a repository
- Open the Administration perspective.
- On the Repositories menu, select .
- The Clone Repository pop-up window is displayed.

Figure 6.2. Clone Repository Pop-up
- In the Clone Repository dialog window, enter the repository details:
- Enter the Repository Name to be used as the repository identifier in the Asset repository and select the Organizational Unit it should be added to.
- Enter the URL of the GIT repository:
- For a Local Repository:
file:///path-to-repository/reponame - For a Remote or preexisting Repository:
git://hostname/reponame
Note
The file protocol is only supported for 'READ' operations. 'WRITE' operations are not supported. - If applicable, enter the User Name and Password to be used for authentication when cloning the repository.
- Click Clone.
- A confirmation prompt with an OK button is displayed which notifies the user that the repository is created successfully. Click OK.
6.3. Removing a repository
DELETE REST API call. This call relies on the user having created an authenticated HTTP session before issuing this command.
Example 6.1. Removing a repository using curl
curl -H 'Accept: application/json' -H 'Content-Type: application/json' -X DELETE 'localhost:8080/business-central/rest/repositories/REPOSITORY_NAME'
6.4. System Configuration
Procedure 6.3. Changing System Properties
- Edit the file
$JBOSS_HOME/domain/configuration/host.xml - Locate the XML elements server that belong to the main-server-group and add a system property, for example:
<system-properties> <property name="org.uberfire.nio.git.dir" value="..." boot-time="false"/> ... </system-properties>
org.uberfire.nio.git.dir: Location of the directory .niogit. Default: working directoryorg.uberfire.nio.git.daemon.enabled: Enables/disables git daemon. Default: trueorg.uberfire.nio.git.daemon.host: If git daemon enabled, uses this property as local host identifier. Default: localhostorg.uberfire.nio.git.daemon.port: If git daemon enabled, uses this property as port number. Default: 9418org.uberfire.nio.git.ssh.enabled: Enables/disables ssh daemon. Default: trueorg.uberfire.nio.git.ssh.host: If ssh daemon enabled, uses this property as local host identifier. Default: localhostorg.uberfire.nio.git.ssh.port: If ssh daemon enabled, uses this property as port number. Default: 8001org.uberfire.nio.git.ssh.cert.dir: Location of the directory .security where local certtificates will be stored. Default: working directoryorg.uberfire.metadata.index.dir: Place where Lucene .index folder will be stored. Default: working directoryorg.uberfire.cluster.id: Name of the helix cluster, for example: kie-clusterorg.uberfire.cluster.zk: Connection string to zookeeper. This is of the form host1:port1,host2:port2,host3:port3, for example: localhost:2188org.uberfire.cluster.local.id: Unique id of the helix cluster node, note that ':' is replaced with '_', for example: node1_12345org.uberfire.cluster.vfs.lock: Name of the resource defined on helix cluster, for example: kie-vfsorg.uberfire.cluster.autostart: Delays VFS clustering until the application is fully initialized to avoid conflicts when all cluster members create local clones. Default: falseorg.uberfire.sys.repo.monitor.disabled: Disable configuration monitor (do not disable unless you know what you're doing). Default: falseorg.uberfire.secure.key: Secret password used by password encryption. Default: org.uberfire.adminorg.uberfire.secure.alg: Crypto algorithm used by password encryption. Default: PBEWithMD5AndDESorg.guvnor.m2repo.dir: Place where Maven repository folder will be stored. Default: working-directory/repositories/kieorg.kie.example.repositories: Folder from where demo repositories will be cloned. The demo repositories need to have been obtained and placed in this folder. Demo repositories can be obtained from the kie-wb-6.0.1.Final-example-repositories.zip artifact. This System Property takes precedence over org.kie.demo and org.kie.example. Default: Not used.org.kie.demo: Enables external clone of a demo application from GitHub. This System Property takes precedence over org.kie.example. Default: trueorg.kie.example: Enables example structure composed by Repository, Organization Unit and Project. Default: false
Chapter 7. Process export and import
7.1. Creating a Process definition
- Open the Project Authoring perspective ( → ).
- In
Project Explorer( → ), navigate to the project where you want to create the Process definition (in the Project view, select the respective repository and project in the drop-down lists; in the Repository view, navigate toREPOSITORY/PROJECT/src/main/resources/directory).Note
It is recommended to create your resources, including your Process definitions, in a package of a Project to allow importing of resources and their referencing. To create a package, do the following:- In the Repository view of the Project Explorer, navigate to the
REPOSITORY/PROJECT/src/main/resources/directory. - Go to → .
- In the New resource dialog, define the package name and check the location of the package in the repository.
- From the perspective menu, go to → .
- In the New Processes dialog box, enter the Process name and click . Wait until the Process Editor with the Process diagram appears.
7.2. Importing a Process definition
- In the Project Explorer, select a Project and the respective package to which you want to import the Process definition.
- Create a new Business Process to work in by going to → .
- In the Process Designer toolbar, click the Import
icon in the editor toolbar and pick the format of the imported process definition. Note that you have to choose to overwrite the existing process definition in order to import.
- From the Import window, locate the Process file and click .

Figure 7.1. Import Window
7.3. Importing jPDL 3.2 to BPMN2

Figure 7.2. Migrate jPDL 3.2 to BPMN2

Figure 7.3. Migrate to BPMN2 dialog box
7.4. Exporting a process
Procedure 7.1. Exporting a business process
- Open the Project Authoring perspective: on the main menu, click → .
- Select the business process which is to be exported, to view it in the Process Designer.
- Click on the (
) button of the process designer toolbar and select View Process Sources from the drop-down options.
- The Process Sources window is displayed
- Click on the Download BPMN2 button and save the business process at the desired location.
Part III. Integration
Chapter 8. Integration
8.1. Configuring Red Hat JBoss BPM Suite with Apache Spring
jboss-bpms-engine.zip file and is called kie-spring-VERSION-redhat-MINORVERSION.jar.
As a Self Managed Process Engine
RuntimeManager API, perfect synchronization between process engine and task service is managed internally and the end user does not have to deal with the internal code to make these two work together.
As a Shared Task Service
TaskService, you have more flexibility in configuring the task service instance as it is independent of the RuntimeManager. Once configured it is then used by the RuntimeManager when requested.
org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean class. This factory class is responsible for producing instances of RuntimeEnvironment that are consumed by RuntimeManager upon creation. Illustrated below is a configured RuntimeEnvironment with the entity manager, transaction manager, and resources for the class org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean:
<bean id="runtimeEnvironment" class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">
<property name="type" value="DEFAULT"/>
<property name="entityManagerFactory" ref="jbpmEMF"/>
<property name="transactionManager" ref="jbpmTxManager"/>
<property name="assets">
<map>
<entry key-ref="process"><util:constant static-field="org.kie.api.io.ResourceType.BPMN2"/></entry>
</map>
</property>
</bean>
- DEFAULT - default (most common) configuration for RuntimeManager
- EMPTY - completely empty environment to be manually populated
- DEFAULT_IN_MEMORY - same as DEFAULT but without persistence of the runtime engine
- DEFAULT_KJAR - same as DEFAULT but knowledge asset are taken from KJAR identified by releaseid or GAV
- DEFAULT_KJAR_CL - build directly from classpath that consists kmodule.xml descriptor
- knowledgeBase
- assets
- releaseId
- groupId, artifactId, version
entity manager factory and transaction manager. Illustrated below is an example RuntimeManager for org.kie.spring.factorybeans.RuntimeManagerFactoryBean:
<bean id="runtimeManager" class="org.kie.spring.factorybeans.RuntimeManagerFactoryBean" destroy-method="close"> <property name="identifier" value="spring-rm"/> <property name="runtimeEnvironment" ref="runtimeEnvironment"/> </bean>
8.2. CDI Integration
- entity manager and entity manager factory
- user group callback for human tasks
- identity provider to pass authenticated user information to the services
public class EnvironmentProducer {
@PersistenceUnit(unitName = "org.jbpm.domain")
private EntityManagerFactory emf;
@Inject
@Selectable
private UserGroupCallback userGroupCallback;
@Produces
public EntityManagerFactory getEntityManagerFactory() {
return this.emf;
}
@Produces
@RequestScoped
public EntityManager getEntityManager() {
EntityManager em = emf.createEntityManager();
return em;
}
public void close(@Disposes EntityManager em) {
em.close();
}
@Produces
public UserGroupCallback produceSelectedUserGroupCalback() {
return userGroupCallback;
}
@Produces
public IdentityProvider produceIdentityProvider {
return new IdentityProvider() {
// implement IdentityProvider
};
}
}
deployments/business-central.war/WEB-INF/beans.xml file may be configured to change the current settings of the new usergroupcallback implementation.
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd"> <alternatives> <class>org.jbpm.services.task.identity.JAASUserGroupCallbackImpl</class> </alternatives> </beans>
Note
org.jbpm.services.task.identity.JAASUserGroupCallbackImpl is just an example here to demonstrate the settings of the application server regardless of what it actually is (LDAP, DB, etc).
Chapter 9. Deploying Red Hat JBoss BPM Suite artifacts to SOA Repository Artifact Model and Protocol (S-RAMP) repository
9.1. Deploying Red Hat JBoss BPM Suite artifacts to SOA Repository Artifact Model and Protocol (S-RAMP) using Maven
pom.xml file as shown below:
<build>
<extensions>
<extension>
<groupId>org.overlord.sramp</groupId>
<artifactId>s-ramp-wagon</artifactId>
<version>${s-ramp-wagon.version}</version>
</extension>
</extensions>
</build>- Clone the git repository where you have saved the BPM Suite project by running this command:
git clone http://localhost:8001/REPOSITORY_NAME
- On the command line, move into the folder that contains the project.
- Follow the instructions in Red Hat JBoss Fuse Service Works 6 Development Guide, Volume 3: Governance, section Deploying to S-RAMP. Use the URL from the example below:
<distributionManagement> <repository> <id>local-sramp-repo</id> <name>S-RAMP Releases Repository</name> <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/</url> </repository> <snapshotRepository> <id>local-sramp-repo-snapshots</id> <name>S-RAMP Snapshots Repository</name> <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/</url> </snapshotRepository> </distributionManagement>With these settings, Maven deployments are sent directly to the S-RAMP repository using the S-RAMP API. Note that artifacts are added to the S-RAMP repository with an artifact type based on the Maven type of the project. You can override this behavior by adding a query parameter to the repository URL in thepom.xmlfile. For example:<distributionManagement> <repository> <id>local-sramp-repo</id> <name>S-RAMP Releases Repository</name> <url>sramp://S-RAMP_SERVER_URL/s-ramp-server/?artifactType=KieJarArchive</url> </repository> </distributionManagement>The above example causes the Maven artifact to be uploaded with an S-RAMP artifact type of KieJarArchive. - Amend the maven plug-in in file
pom.xmland add a dependency to it as follows in case the project does not contain decision tables:<plugins> <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>6.0.2-redhat-6</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bpmn2</artifactId> <version>6.0.2-redhat-6</version> </dependency> </dependencies> </plugin> </plugins>If the project contains decision tables, use this dependency for the kie-maven-plugin instead:<plugins> <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>6.0.2-redhat-6</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>org.drools</groupId> <artifactId>drools-decisiontables</artifactId> <version>6.0.2-redhat-6</version> </dependency> </dependencies> </plugin> </plugins> - Run a clean Maven deployment using the following command:
mvn -s sramp-settings.xml deploy
.
Note
settings.xml file. For further details on the credentials, refer to Red Hat JBoss Fuse Service Works (FSW) documentation on Authentication.
9.2. Deploying Red Hat JBoss BPM Suite artifacts to SOA Repository Artifact Model and Protocol (S-RAMP) using graphical user interface (GUI)
- In a web browser, navigate to http://localhost:8080/s-ramp-ui/. If the user interface has been configured to run from a domain name, substitute
localhostfor the domain name. For example http://www.example.com:8080/s-ramp-ui/. - Click on .
- In the Manage Artifacts section, select .
- Locate the kie archive you want to deploy. In the dialog that opens, fill out
KieJarArchiveas the type, and select . - The deployment then creates these entries in the S-RAMP repository:
KieJarArchive, from which it derives:KieXmlDocument(if the archive containskmodule.xml)BpmnDocument(if the archive containsbpmndefinitions)DroolsDocument(if the archive containsdrldefinitions)
Chapter 10. Persistence
Note
- Session state: this includes the session ID, date of last modification, the session data that business rules would need for evaluation, state of timer jobs.
- Process instance state: this includes the process instance ID, process ID, date of last modification, date of last read access, process instance start date, runtime data (the execution status including the node being executed, variable values, etc.)and the eventtypes .
- Work item runtime state: this includes the work item ID, creation date, name, process instance ID, and the work item state itself.
10.1. Session
sessioninfo entities. These persist the state of the runtime knowledge session, and store the following data:
Table 10.1.
| Field | Description | Nullable |
|---|---|---|
|
id
|
primary key
|
false
|
|
lastmodificationdate
|
last saved to data store
|
N/A
|
|
rulesbytearray
|
binary dataset with session state (binary blob
)
|
false
|
|
startdate
|
session start
| |
|
optlock
|
version number used lock value for optimistic locking
| |
10.2. Process Instance
ProcessInstanceInfo entities, which persist the state of a process instance on runtime and store the following data:
Table 10.2.
| Field | Description | Nullable |
|---|---|---|
|
instanceid
|
primary key
|
false
|
|
lastmodificationdate
|
last saved to data store
|
N/A
|
|
lastreaddate
|
last read from data store
|
N/A
|
|
processid
|
ID of the process the instance is based on
|
false
|
|
processinstancebytearray
|
binary dataset with process instance state (binary blob
)
|
false
|
|
startdate
|
Process instance start
| |
|
optlock
|
version number used lock value for optimistic locking
| |
|
state
|
Process instance state
|
false
|
ProcessInstanceInfo has a 1:N relationship to the EventTypes entity.
EventTypes entity contains the following data:
Table 10.3.
| Field | Description | Nullable |
|---|---|---|
|
instanceid
|
reference to the Process instance (foreign key to the
processinstanceinfo)
|
false
|
|
element
|
text field related to an event the Process instance has undergone
| |
10.3. Work Item
workiteminfo entities, which persist the state of the particular work item instance on runtime and store the following data:
Table 10.4.
| Field | Description | Nullable |
|---|---|---|
|
workitemid
|
primary key
|
false
|
|
name
|
work item name
| |
|
processinstanceid
|
parent Process instance id
|
false
|
|
state
|
integer representing work item state
|
false
|
|
optlock
|
version number used lock value for optimistic locking
| |
|
workitembytearray
|
binary dataset with work item state (binary blob
)
|
false
|
|
creationDate
|
timestampe on which the work item was created
|
false
|
10.4. Persistence configuration
10.4.1. Persistence configuration
JBPMHelper class after you create a session or using the JPAKnowledgeService to create your session. The latter option provides more flexibility, while JBPMHelper has a method to create a session, and uses a configuration file to configure this session.
10.4.2. Configuring persistence using JBPMHelper
- Define your application to use an appropriate JBPMHelper session construtor:
KieSession ksession = JBPMHelper.newKieSession(kbase);KieSession ksession = JBPMHelper.loadKieSession(kbase, sessionId);
- Configure the persistence in the
jBPM.propertiesfile.Example 10.1. A sample jBPM.properties file with persistence for the in-memory H2 database
# for creating a datasource persistence.datasource.name=jdbc/jbpm-ds persistence.datasource.user=sa persistence.datasource.password= persistence.datasource.url=jdbc:h2:tcp://localhost/~/jbpm-db persistence.datasource.driverClassName=org.h2.Driver # for configuring persistence of the session persistence.enabled=true persistence.persistenceunit.name=org.jbpm.persistence.jpa persistence.persistenceunit.dialect=org.hibernate.dialect.H2Dialect # for configuring the human task service taskservice.enabled=true taskservice.datasource.name=org.jbpm.task taskservice.transport=mina taskservice.usergroupcallback=org.jbpm.task.service.DefaultUserGroupCallbackImpl
JBPMHelper.startH2Server(); method call and register it with the engine using JBPMHelper.setupDataSource(); method call.
10.4.3. Configuring persistence using JPAKnowledgeService
- Define your application to use the knowledge session created by JPAKnowledgeService:
- Define the session based on a knowledge base, a knowledge session configuration, and an environment. The environment must contain a reference to your Entity Manager Factory:
// create the entity manager factory and register it in the environment EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" ); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf ); // create a new knowledge session that uses JPA to store the runtime state KieSession ksession = JPAKnowledgeService.newKieSession( kbase, null, env ); int sessionId = ksession.getId(); // invoke methods on your method here ksession.startProcess( "MyProcess" ); ksession.dispose();
- Define the session based on a specific session id.
// recreate the session from database using the sessionId ksession = JPAKnowledgeService.loadKieSession(sessionId, kbase, null, env );
- Configure the persistence in the
META-INF/persistence.xmlfile: configure JPA to use Hibernate and the respective database.Information on how to configure data source on your application server should be available in the documentation delivered with the application server. For this information for JBoss Enterprise Application Platform, see the Administration and Configuration Guide for this product.Example 10.2. A sample persistence.xml file with persistence for an H2 data source
jdbc/jbpm-ds<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <persistence version="1.0" xsi:schemaLocation= "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/jbpm-ds</jta-data-source> <mapping-file>META-INF/JBPMorm.xml</mapping-file> <class>org.drools.persistence.info.SessionInfo</class> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.info.WorkItemInfo</class> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.max_fetch_depth" value="3"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup"/> </properties> </persistence-unit> </persistence>
JBPMHelper.startH2Server(); method call and register it with the engine using JBPMHelper.setupDataSource(); method call.
Note
PoolingDataSource ds = new PoolingDataSource();
ds.setUniqueName("jdbc/jbpm-ds");
ds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource");
ds.setMaxPoolSize(3);
ds.setAllowLocalTransactions(true);
ds.getDriverProperties().put("user", "sa");
ds.getDriverProperties().put("password", "sasa");
ds.getDriverProperties().put("URL", "jdbc:h2:tcp://localhost/~/jbpm-db");
ds.getDriverProperties().put("driverClassName", "org.h2.Driver");
ds.init();Chapter 11. Logging
- Process instance as
processinstancelog - Element instance as
nodeinstancelog - Variable instance as
variableinstancelog
Table 11.1. Fields of the ProcessInstanceLog table
| Field | Description | Nullable |
|---|---|---|
|
id
|
The primary key of the log entity
|
No
|
|
end_date
|
The end date of the process instance
|
Yes
|
|
processid
|
The name (id) of the underlying process
|
Yes
|
|
processinstanceid
|
The id of the process instance
|
No
|
|
start_date
|
The start date of the process instance
|
Yes
|
|
status
|
The status of the process instance
|
Yes
|
|
parentProcessInstanceId
|
The process instance id of the parent process instance if applicable
|
Yes
|
|
outcome
|
The outcome of the process instance (details on the process finish, such as error code)
|
Yes
|
Table 11.2. Fields of the NodeInstanceLog table
| Field | Description | Nullable |
|---|---|---|
|
id
|
The primary key of the log entity
|
No
|
|
log_date
|
The date of the event
|
Yes
|
|
nodeid
|
The node id of the underlying Process Element
|
Yes
|
|
nodeinstanceid
|
The id of the node instance
|
Yes
|
|
nodename
|
The name of the underlying node
|
Yes
|
|
processid
|
The id of the underlying process
|
Yes
|
|
processinstanceid
|
The id of the parent process instance
|
No
|
|
type
|
The type of the event (
0 = enter event, 1 = exit event)
|
No
|
Table 11.3. Fields of the VariableInstanceLog table
| Field | Description | Nullable |
|---|---|---|
|
id
|
The primary key of the log entity
|
No
|
|
log_date
|
The date of the event
|
Yes
|
|
processid
|
The name (id) of the underlying process
|
Yes
|
|
processinstanceid
|
The id of the process instance
|
No
|
|
value
|
The value of the variable at log time
|
Yes
|
|
variableid
|
The variable id as defined in the process definition
|
Yes
|
|
variableinstanceid
|
The id of the variable instance
|
Yes
|
|
outcome
|
The outcome of the process instance (details on the process finish, such as error code)
|
Yes
|
11.1. Logging events to database
- Map the Log classes to the data source, so that the given data source accepts the log entries. On Red Hat JBoss EAP, edit the data source properties in the
persistence.xmlfile.Example 11.1. The ProcessInstanceLog, NodeInstanceLog and VariableInstanceLog classes enabled for processInstanceDS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <persistence version="1.0" xsi:schemaLocation= "http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="org.jbpm.persistence.jpa"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/processInstanceDS</jta-data-source> <class>org.drools.persistence.info.SessionInfo</class> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.info.WorkItemInfo</class> <class>org.jbpm.process.audit.ProcessInstanceLog</class> <class>org.jbpm.process.audit.NodeInstanceLog</class> <class>org.jbpm.process.audit.VariableInstanceLog</class> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.max_fetch_depth" value="3"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup"/> </properties> </persistence-unit> </persistence> - Register a logger on your Kie Session.
Example 11.2. Import the Loggers
import org.jbpm.process.audit.AuditLogService; import org.jbpm.process.audit.AuditLoggerFactory; import org.jbpm.process.audit.AuditLoggerFactory.Type; import org.jbpm.process.audit.JPAAuditLogService; ...
Example 11.3. Registering a Logger to a Kie Session
@PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME) private EntityManagerFactory emf; private AuditLogService auditLogService; @PostConstruct public void configure() { auditLogService = new JPAAuditLogService(emf); ((JPAAuditLogService) auditLogService).setPersistenceUnitName(PERSISTENCE_UNIT_NAME); if( emf == null ) { ((JPAAuditLogService) auditLogService).setPersistenceUnitName(PERSISTENCE_UNIT_NAME); } RuntimeEngine runtime = singletonManager.getRuntimeEngine(EmptyContext.get()); KieSession ksession = runtime.getKieSession(); AuditLoggerFactory.newInstance(Type.JPA, ksession, null); } - Optionally, call the method
addFilteron the logger to filter out irrelevant information. Only information accepted by all filters appears in the database. - Logger classes can be viewed in the Audit View:
<dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-audit</artifactId> <version>6.0.1.Final</version> </dependency>
Chapter 12. Localization and customization
12.1. Available Languages
- United States English (
en_US) - Spanish (
es_ES) - Japanese (
ja_JP) - Chinese (
zh_CN) - Portuguese (
pt_BR) - French (
fr_CA) - German (
de_DE)
Note
12.2. Changing language settings
Changing the User Interface Language in Business Central
http://localhost:8080/business-central/?locale=pt_BR
Changing the User Interface Language in Dashbuilder
- Log into the dashbuilder after the server has been successfully started by navigating to http://localhost:8080/dashbuilder in a web browser.
- Select the language of your choice by clicking on the available locales on the top center of the dashbuilder user interface to change the language.
Setting a Default User Interface Language in Dashbuilder
Procedure 12.1. Setting the default language as French
- Navigate to
jboss-eap-6.1/standalone/configurationand define the following in thestandalone.xmlfile.<system-properties> <property name="org.jboss.dashboard.LocaleManager.installedLocaleIds" value="en,es,de,fr,ja,pt,zh"/> <property name="org.jboss.dashboard.LocaleManager.defaultLocaleId" value="fr"/> </system-properties> - The default user interface language of the dashbuilder is now set to French.
Defining the Installed Locales in Dashbuilder
Procedure 12.2. Defining the installed locale
- Navigate to
jboss-eap-6.1/standalone/configurationand define the following in thestandalone.xmlfile.<system-properties> <property name="org.jboss.dashboard.LocaleManager.installedLocaleIds" value="en,es,de,fr,ja,pt"/> <property name="org.jboss.dashboard.LocaleManager.defaultLocaleId" value="fr"/> </system-properties>
Note
12.3. Running the JVM with UTF-8 Encoding
Part IV. Execution
Chapter 13. Execution server
13.1. Assignment rules
13.1.1. Defining assignment rules
- Create a file that will contain the rule definition on the Business Central classpath (the recommended location is
$DEPLOY_DIR/standalone/deployments/business-central.war/WEB-INF/classes/):default-add-task.drlwith the rules to be checked when the Human Task is createddefault-complete-task.drlwith the rules to be checked when the Human Task is completed
- Define the rules in the file.
Example 13.1. The default-add-task.drl content
package defaultPackage
import org.kie.api.task.model.Task;
import org.kie.api.task.model.User;
import org.kie.api.task.model.Status;
import org.kie.api.task.model.PeopleAssignments;
import org.jbpm.services.task.rule.TaskServiceRequest;
import org.jbpm.services.task.exception.PermissionDeniedException;
import org.jbpm.services.task.impl.model.*;
import java.util.HashMap;
import java.util.List;
global TaskServiceRequest request;
rule "Don't allow Mary to complete task when rejected"
when
$task : Task()
$actualOwner : User( id == 'mary') from $task.getTaskData().getActualOwner()
$params : HashMap(this["approved"] == false)
then
request.setAllowed(false);
request.setExceptionClass(PermissionDeniedException.class);
request.addReason("Mary is not allowed to complete task with approved false");
endMary, the task will be automatically assigned to the user mary.
Example 13.2. The default-complete-task.drl content
package defaultPackage
import org.kie.api.task.model.Task;
import org.kie.api.task.model.User;
import org.kie.api.task.model.Status;
import org.kie.api.task.model.PeopleAssignments;
import org.jbpm.services.task.rule.TaskServiceRequest;
import org.jbpm.services.task.exception.PermissionDeniedException;
import org.jbpm.services.task.impl.model.*;
import java.util.HashMap;
import java.util.List;
global TaskServiceRequest request;
rule "Don't allow Mary to complete task when rejected"
when
$task : Task()
$actualOwner : User( id == 'mary') from $task.getTaskData().getActualOwner()
$params : HashMap(this["approved"] == false)
then
request.setAllowed(false);
request.setExceptionClass(PermissionDeniedException.class);
request.addReason("Mary is not allowed to complete task without approval.");
endMary, the task will be automatically assigned to the user mary.
13.2. Mail session
13.2.1. Setting up mail session
- Open the respective profile configuration file (
standalone.xmlorhost.xml) for editing. - Add the mail session to the
urn:jboss:domain:mail:1.1subsystem.Example 13.3. New mail session on localhost
<subsystem xmlns="urn:jboss:domain:mail:1.1"> <!-- omitted code --> <mail-session jndi-name="java:/mail/bpmsMailSession" debug="true" from="bpms@company.com"> <smtp-server outbound-socket-binding-ref="bpmsMail"/> </mail-session> </subsystem> - Define the session outbound socket in the profile configuration file.
Example 13.4. Outbound socket definition
<outbound-socket-binding name="bpmsMail"> <remote-destination host="localhost" port="12345"/> </outbound-socket-binding>
Chapter 14. Plug-in for Red Hat JBoss Developer Studio
Part V. Monitoring
Chapter 15. Process monitoring
15.1. JBoss Operations Network
15.2. Installing the BRMS Plug-in into JBoss ON
Procedure 15.1. Copying the JBoss BRMS plug-in JAR files
- Extract the JBoss BRMS plug-in pack archive to a temporary location. This creates a subdirectory with the name jon-plugin-pack-brms-bpms-3.2.0.GA. For example:
[root@server rhq-agent]# unzip jon-plugin-pack-brms-bpms-3.2.0.GA.zip -d /tmp
- Copy the extracted BRMS plug-in JAR files from the jon-plugin-pack-brms-bpms-3.2.0.GA/ directory to the JBoss ON server plug-in directory. For example:
[root@server rhq-agent]# cp /tmp/jon-plugin-pack-brms-bpms-3.2.0.GA/*.jar /opt/jon/jon-server-3.2.0.GA1/plugins
- Start the JBoss Operations Network server to update the BRMS plug-in.
Procedure 15.2. Uploading the BRMS plug-in through GUI
- Start the JBoss Operations Network Server and Log in to access the GUI.
- In the top navigation of the GUI, open the Administration menu.
- In the Configuration area on the left, select the Server Plugins link.
- At the bottom of the list of loaded server plug-ins, click the Upload a plugin button and choose the BRMS plugin.
- The BRMS plug-in for JBoss Operations Network is now uploaded.
15.3. Monitoring Kie Bases and Kie Sessions
-kie.mbeans = enabled
KieBaseConfiguration kbconf = KieServices.Factory.get().newKieBaseConfiguration();
kbconf.setOption(MBeansOption.ENABLED);Note
Kie Services have been implemented for BRMS 6; for BRMS 5, Drools Services was the naming convention used and it had different measurements on sessions. For example, → renaming occured in the updated version.
Chapter 16. Managing Security for Red Hat JBoss BPM Suite Dashbuilder
16.1. Accessing Red Hat JBoss BPM Suite Dashbuilder
16.2. Managing security
- admin - Administrates the BPMS system. Has full access rights to make any changes necessary. Also has the ability to add and remove users from the system.
- developer - Implements code required for process to work. Mostly uses the JBDS connection to view processes, but may use the web tool occasionally.:
- analyst - Responsible for creating and designing processes into the system. Creates process flows and handles process change requests. Needs to test processes that they create. Also creates forms and dashboards.
- user - Daily user of the system to take actions on business tasks that are required for the processes to continue forward. Works primarily with the task lists.
- manager - Viewer of the system that is interested in statistics around the business processes and their performance, business indicators, and other reporting of the system and people who interact with the system.
16.3. Workspace permissions
Procedure 16.1. Accessing Workspace Permissions
- Log into Business Dashboards from Business Central (as described in the Accessing Red Hat JBoss BPM Suite Dashbuilder topic).
- Select the appropriate Dashboard from the Wokspace drop-down.

Figure 16.1. Dashbuilder Workspace
- Click the Edit selected workspace properties
button to access the Workspace Dashboard.
- Click the Permissions label to view the permission management screen.

Figure 16.2. Permissions Screen
- Access: permission to login into the application.
- Administrate: permission to access the toolbar and system configuration features.
- Create pages: ability to create new project pages.
- Edit: permission to change the workspace properties.
- Clear: ability to delete the workspace.
- Edit permissions: ability to grant/deny permissions.
- Change allowed panels: permission to restrict the type of panels that can be used in this workspace.

Figure 16.3. Permissions Assignation
- Target roles (who): What user will be granted/denied with the permissions defined.
- Allowed actions: depending on the type of the resource we can enable/disable what the user can do on this resource.
- Reverse (optional): when we have a set of roles and we want to grant/deny a permission to all the roles but one.
Note
16.4. Page permissions
- To access Page permissions, locate the Pages drop-down under the jBPM Dashboard (or whatever Dashboard you selected).
- After expanding Pages, expand the Process dashboard option.
- Select the Page permissions option.

Figure 16.4. Page Permissions
- Visualize: permission to make the page visible.
- Edit: ability to change the page properties.
- Clear: ability to delete the page.
- Edit permissions: ability to grant/deny permissions for the page.
16.5. Panel permissions
- To access the Panel permissions page, expand the Panel instances option under the jBPM Dashboard (or whatever Dashboard you are using).
- Expand the Dashboard option and then expand the Process dashboard.
- Expand the Panels choice and select the appropriate process.
- Open the Panel permissions page.

Figure 16.5. Panel permissions configuration screen
- Visualize: make the panel visible.
- Edit: change the panel properties.
- Edit permissions: ability to grant/deny permissions for the panel.
Appendix A. Revision History
| Revision History | |||
|---|---|---|---|
| Revision 1.0.0-30 | Thu Mar 05 2015 | ||
| |||
