User Guide
The User Guide for Red Hat JBoss BPM Suite
Abstract
Chapter 1. Introduction
1.1. 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
1.2. Components
- Business Central, which is a web-based application (
business-central.waranddashbuilder.war) and provides tools for creating, editing, building, managing, and monitoring of business assets as well as a Task client - Artifact repository (Knowledge Store), which is the set of data the application operates over and is accessed by the Execution Server
- Execution Server, which provides the runtime environment for business assets
1.3. Red Hat JBoss BPM Suite and BRMS
1.4. Business Central
- Process management capabilities allow you to start new process instances, acquire the list of running process instances, inspect the state of a specific process instances, etc.
- User Task management capabilities allow you to work with User Tasks; claim User Tasks, complete Tasks through Task forms, etc.
- Process Designer and other editors for modeling Processes and their resources (form item editor, work item editor, data model editor, etc.), as well as process model simulation tools (refer to Chapter 4, Process Designer)
- Rules Modeler for designing Business Rules models and their resources (refer to Red Hat JBoss BRMS documentation)
- Task client for managing and creating User Tasks (refer to Section 11.3, “Task Management”)
- Process Manager for managing process instances (refer to Section 11.2.2, “Process Instances”)
- Dashboard Builder, the BAM component, for monitoring and reporting (refer to Chapter 14, Red Hat JBoss Dashboard Builder)
- Business Asset Manager for accessing the Knowledge Repository resources, building and deploying business assets (refer to Chapter 3, Project)Artifact repository (Knowledge Store) is the set of data over which Business Central operates. It provides a centralized store for your business knowledge, which can consist of multiple repositories with business assets and resources.Apart from the project assets, you can also manage your pom artifacts (such as parent
pom.xmlfiles for kjars) from Business Central's Artifact repository, in case you do not have a separate repository to manage your artifacts. You can further create a child project to extend the uploaded pom artifact by adding the <parent>PARENT_GAV</parent> tag topom.xmlof the given child project. Here,PARENT_GAVdenotes group, artifact and version of the previously uploaded pom artifact.
- Process Definitions displays the Process Definition List with the Process definitions available in the connected repository.
- Process Instances displays the Process Instance List with the Process instances currently running on the Process Engine.
- Tasks displays a view of the Tasks list for the currently logged-in user. You can call a Task List in the grid view or in the calendar view from the menu.
1.4.1. Business Central Environment

|
The main menu contains the links to the Home page and all available perspectives.
|
|
The perspective menu contains menus for the selected perspective (here it is empty; note that the content differs for individual perspectives) Section 1.4.2, “Perspectives”.
|
|
The perspective area contains the perspective tools (here the home page with links to individual perspectives and their views), such as views and editors.
|
Figure 1.3. Home page
1.4.2. Perspectives
- group:
- Project Authoring perspective contains the Project Explorer view (by default on the left) with the overview of available repository structure, and information on available resources, such as, business process definitions, form definitions, etc.; the editor area on the right, where the respective editor appears when a resource is opened; and the Messages view with validation messages.
- Artifact Repository perspective contains a list of jars which can be added as dependencies. The available operations in this perspective are upload/download project artifacts and pom-packaged artifacts (
pom.xml). - Administration perspective (available only for users with the
ADMINrole) contains the File Explorer view (by default on the left) with available asset repositories; the editor area on the right, where the respective editor appears when a resource is opened. The perspective allows an administrator to connect Knowledge Store to a repository with assets and to create a new repository (refer to Administration and Configuration Guide).
- group:
- Deployments perspective contains a list of the deployed resources and allows you to build and deploy an undeploy new units.
- group:
- Process Definitions perspective contains a list of the deployed Process definitions. It allows you to instantiate and manage the deployed Processes.
- Process Instances perspective contains a list of the instantiated Processes. It allows you to view their execution worklow and its history.
- group:
- Task List perspective contains a list of Tasks produced by Human Task of the Process instances or produced manually. Only Tasks assigned to the logged-in user are visible. It allows you to claim Tasks assigned to a group you are a member of.
- group (the BAM component):
- Process & Task Dashboard perspective contains a prepared dashboard with statistics on runtime data of the Execution Server
- Business Dashboards perspective contains the full BAM component, the Dashbuilder, including administration features available for users with the
ADMINrole.
1.4.3. Embedding Business Central
Table 1.1. HTTP Query Parameters for Standalone Mode
| Parameter Name | Explanation | Allow Multiple Values | Example |
|---|---|---|---|
| standalone | This parameter switches Business Central to standalone mode. | no | (none) |
| path | Path to the asset to be edited. Note that asset should already exists. | no | git://master@uf-playground/todo.md |
| perspective | Reference to an existing perspective name. | no | org.guvnor.m2repo.client.perspectives.GuvnorM2RepoPerspective |
| header | Defines the name of the header that should be displayed (useful for context menu headers). | yes | ComplementNavArea |
===test.html===
<html>
<head>
<title>Test</title>
</head>
<body>
<iframe id="ifrm" width="1920" height="1080" src='http://localhost:8080/business-central?standalone=&perspective=AuthoringPerspective&header=AppNavBar'></iframe>
</body>
</html>web.xml of business-central. The default value for x-frame-options is as follows:
<param-name>x-frame-options</param-name> <param-value>SAMEORIGIN</param-value>
Chapter 2. Basic concepts
dispose() call is not issued, the session remains alive and causes memory leaks. Also note that the FireAllRules command is not automatically called at the end of a stateful session.

Figure 2.1. Kie Base and Kie Session relationship
Part I. Modeling
Chapter 3. Project
pom.xml) with information on how to build the output artifact. It also contains the Module Descriptor file, kmodule.xml, that contains the KIE Base and KIE Session configuration for the assets in the project.
3.1. Creating a project
- Open the Project Authoring perspective: on the main menu, click → .
- In the Project Explorer, select the organizational unit and the repository where you want to create the project.
- In the perspective menu, go to → .
- In the Create new Project dialog window, define the project details:
- In the Project text box, enter the project name.

- The explorer refreshes to show a New Project Wizard pop-up window.

- Define the Project General Settings and Group artifact version details for this new project. These parameters are stored inside the
pom.xmlMaven configuration file.- Project Name: The name for the project; for example
MortgageProject - Project Description: The description of the project which may be useful for the project documentation purpose.
- Group ID: group ID of the project; for example
org.mycompany.commons - Artifact ID: artifact ID unique in the group; for example
myframework. Avoid using a space or any special character that might lead to an invalid name. - Version ID: version of the project; for example
2.1.1
The Project Screen view is updated with the new project details as defined in the pom.xml file. Note, that you can switch between project descriptor files in the drop down-box with Project Settings and Knowledge Base Setting, and edit their contents.
3.2. Adding dependencies
- Open the Project Editor for the given project:
- In the Project Explorer view of the
Project Authoringperspective, open the project directory. - Click on the
button to open the project view.
- In the Project Screen view, select in the Project Settings drop-down box the Dependencies item.
- On the updated Project Screen, click the button to add a maven dependency or click the button to add a dependency from the Knowledge Store (Artifact repository):
- When adding a maven dependency, a user has to define the Group ID, Artifact ID and the Version ID in the new row which is created in the dependency table.
- When adding a dependency from the Knowledge Store, select the dependency in the displayed dialog box: the dependency will be added to the dependency table.
- To apply the various changes, the dependencies must be saved.
Warning
3.3. Defining Kie Bases and Sessions
kmodule.xml project descriptor file of your project. You can do so through Business Central or by editing kmodule.xml in the src/main/resources/META-INF/ folder by navigating through the Repository view.
Defining Kie Bases and Sessions in the Project Editor
- Click → and navigate to your project.
- In the Project Explorer window, click .
- Click → . This view provides a user interface for changing
kmodule.xml. - Click Add to define and add your bases.
- After you enter a name for your Knowledge Base, add Packages. For including all packages, click below Packages and enter asterisk
*.
- Below Knowledge Sessions, click and enter the name of your session.
- Mark it
Defaultand select appropriate state.For Red Hat JBoss BPM Suite, usestatefulsessions. - Click Save in the top right corner once you are done.
Defining Kie Bases and Sessions in kmodule.xml
kmodule.xml, do the following:
- Open the repository view for your project.

Figure 3.1. Changing to Repository View
- Navigate to
/src/main/resources/META-INF. Click onkmodule.xmlto edit the file directly. - Define your
kbasesandksessions. For example:<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <kbase name="myBase" default="true" eventProcessingMode="stream" equalsBehavior="identity" packages="*"> <ksession name="mySession" type="stateless" default="true" clockType="realtime"/> </kbase> </kmodule> - Click save in the top right corner.
Note
3.4. Creating a resource
Note
- 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.
3.5. Asset Metadata and Versioning
Metadata Management

Categories, Subject, Type, External Link and Source metadata for that asset. However, the most interesting metadata is the description of the asset that you can view/edit in the description field and the comments that you and other people with access to this asset can enter and view.
Important
Version Management
- Click the button in the asset toolbar and select the version that you are interested in. Business Central will load this version of the asset.

- Alternatively, open up the Overview section. The Version history section shows you all the available versions. the version that you want to restore.
3.6. Filtering Assets by Tag
Procedure 3.1. Create tags and filter assets by tags
- Open the Overview tab of an asset and click the Metadata screen.
- In the Tags field, enter a name of your new tag and click button. You can assign multiple tags to an asset at once by separating tag names by space.

Figure 3.2. Creating Tags
The assigned tags are displayed as buttons next to the Tags field:
Figure 3.3. Tags in Metadata View
In order to delete any tag, click the respective tag button. - Click button to save your metadata changes.
- Once you are done assigning tags to your assets, click the
(Customize View) button in the Project Explorer and select the Enable Tag filtering option:

Figure 3.4. Enable Tag Filtering
This displays a Filter by Tag drop-down list in the Project Explorer.
Figure 3.5. Filter by Tag
You can sort your assets through this filter to display all service tasks that include the selected metadata tag.
3.7. Asset Locking Support
Procedure 3.2. Unlocking assets
- Open the asset.
- Click on the Overview tab and open up the Metadata screen.If the asset is already being edited by another user, the following will be displayed in the Lock status field:Locked by <user_name>
- To edit the asset locked by another user, click button.The following confirmation popup message is displayed:Are you sure you want to release the lock of this asset? This might cause <user_name> to lose unsaved changes!
- Click to confirm.The asset goes back to unlocked state.
3.8. Process definition
Example 3.1. BPMN2 source of a Process definition
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"Rule Task
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<process>
PROCESS
</process>
<bpmndi:BPMNDiagram>
BPMN DIAGRAM DEFINITION
</bpmndi:BPMNDiagram>
</definitions>3.8.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.
3.8.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 3.6. Import Window
3.8.3. Importing jPDL 3.2 to BPMN2

Figure 3.7. Migrate jPDL 3.2 to BPMN2

Figure 3.8. Migrate to BPMN2 dialog box
Important
3.8.4. Deleting a Process definition
) and then (
).
3.9. System Properties
Table 3.1. System Properties
| Property | Description |
|---|---|
| org.uberfire.nio.git.dir | Location of the directory .niogit. Default: working directory |
| org.uberfire.nio.git.daemon.enabled | Enables/disables git daemon. Default: true |
| org.uberfire.nio.git.daemon.host | If git daemon enabled, uses this property as local host identifier. Default: localhost |
| org.uberfire.nio.git.daemon.port | If git daemon enabled, uses this property as port number. Default: 9418 |
| org.uberfire.nio.git.ssh.enabled | Enables/disables ssh daemon. Default: true |
| org.uberfire.nio.git.ssh.host | If ssh daemon enabled, uses this property as local host identifier. Default: localhost |
| org.uberfire.nio.git.ssh.port | If ssh daemon enabled, uses this property as port number. Default: 8001 |
| org.uberfire.nio.git.ssh.cert.dir | Location of the directory .security where local certtificates will be stored. Default: working directory |
| org.uberfire.metadata.index.dir | Place where Lucene .index folder will be stored. Default: working directory |
| org.uberfire.cluster.id | Name of the helix cluster, for example: kie-cluster |
| org.uberfire.cluster.zk | Connection string to zookeeper. This is of the form host1:port1,host2:port2,host3:port3, for example: localhost:2188 |
| org.uberfire.cluster.vfs.lock | Name of the resource defined on helix cluster, for example: kie-vfs |
| org.uberfire.cluster.autostart | Delays VFS clustering until the application is fully initialized to avoid conflicts when all cluster members create local clones. Default: false |
| org.uberfire.sys.repo.monitor.disabled | Disable configuration monitor (do not disable unless you know what you're doing). Default: false |
| org.uberfire.secure.key | Secret password used by password encryption. Default: org.uberfire.admin |
| org.uberfire.secure.alg | Crypto algorithm used by password encryption. Default: PBEWithMD5AndDES |
| org.uberfire.domain | Security-domain name used by uberfire. Default: ApplicationRealm |
| org.guvnor.m2repo.dir | Place where Maven repository folder will be stored. Default: working-directory/repositories/kie |
| org.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.2.0-SNAPSHOT-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: true |
| org.kie.example | Enables example structure composed by Repository, Organization Unit and Project. Default: false |
- Edit the file $
JBOSS_HOME/domain/configuration/host.xml. - Locate the XML elements server that belong to the
main-server-groupand add a system property, for example:<system-properties> <property name="org.uberfire.nio.git.dir" value="..." boot-time="false"/> ... </system-properties>
Chapter 4. Process Designer
- JBoss Developer Studio Process Designer
- Thick-client version of the Process Designer integrated in the JBoss Developer Studio plug-in
- Web Process Designer
- Thin-client version of the Process Designer integrated in BPM Central
|
The canvas represents the process diagram. Here you can place the elements from the palette which will constitute the Process. Note that one Process definition may contain exactly one process diagram; therefore a Process definition equals to a Process diagram (this may differ in other products).
|
|
The Object Library (palette) contains groups of BPMN2 elements. Details on execution semantics and properties of individual BPMN2 shapes are available in Appendix A, Process Elements.
|
|
The Properties panel displays the properties of the selected element. If no element is selected, the panel contains Process properties.
|
|
The editor toolbar allows you to select an operation to be applied to the Elements on the canvas.
|
Figure 4.1. Process Designer environment
Note
. This will make your current editor fill the entire Business Central screen. To go back, simply click the button again.
4.1. Configuring automatic saving

Figure 4.2. Enable autosave
4.2. Defining Process properties
- Open the Process file in the Process Designer.
- Click anywhere on the canvas: make sure, no Process element is selected.
Important
Do not use Unicode characters when defining the Process name or the Process ID: usage of such characters is not supported and results in unexpected behavior of the Process designer when saving and retrieving Process assets. - Expand the Properties panel on the left if applicable and define the Process properties on the tab by clicking individual entries. For entries that require other input that just string input, the respective editors can be user by clicking the arrow icon. Note that the editors for complex fields mostly provide validation and auto-completion features.

Figure 4.3. Opening the variable editor
- To save your changes, click File and Save changes
4.3. Designing a Process
- In the Project view of the Project Explorer, select your Project and click the respective Process under Business Processes. Alternatively, locate the process definition in the Repository view of the Project Explorer and double-click the file to open it in the Process Designer.
- Add the required shapes to the process diagram on the canvas:
- Drag and drop the shapes from the Object Library palette to the required position on the canvas.

Figure 4.4. Object Library
- Select a shape already placed on the canvas: the quick linker menu appears. The quick linker feature displays only the elements that can be connected to the selected shape and connects them with a valid Association element.
Note
To change the type of an already placed element to an element that extends this element, click it and select the Morph shape (
) icon.
- Double-click an element to provide its Name. Consider defining the element properties in the Properties view.
- Repeat the previous step until the Process Diagram defines the required workflow.
4.3.1. Aligning Elements
:
- Bottom: the selected elements will be aligned with the element located at the lowest position
- Middle: the selected elements will be aligned to the middle relative to the highest and lowest element
- Top: the selected elements will be aligned with the element located at the highest position
- Left: the selected elements will be aligned with the leftmost element
- Center: the selected elements will be aligned to the center relative to the leftmost and rightmost element
- Right: the selected elements will be aligned with the rightmost element
4.3.2. Changing Element layering
- Bring To Front : bring the selected element to foreground to the uppermost layer
- Bring To Back : send the selected element to background to the lowest layer
- Bring Forward : bring the selected element to foreground by one layer
- Bring Backward : send the selected element to background by one layer
- Center : the selected elements will be aligned to the center relative to the leftmost and rightmost element
- Right : the selected elements will be aligned with the rightmost element
4.3.3. Bending Connection Elements
button in the toolbar and then click the respective Docker. Once you delete dockers of a Connection object, no more dockers will be created automatically.
4.3.4. Resizing Elements
icon in the toolbar and then click on : all Elements will be resized to the size of the largest selected Element.
4.3.5. Grouping Elements
button in the toolbar. To ungroup such elements, select the group and click the
button.
4.3.6. Locking Elements
button in the toolbar. To unlock such Element, select them and click the
button in the toolbar.
4.3.7. Changing the color scheme
themes.json file, which is located in the global directory of each repository.
Procedure 4.1. Creating a new color schema
- Locate your project in the Project Explorer and switch to the Repository view.
- Open the
globaldirectory and locate and open thethemes.jsonfile. - In the displayed Default Editor, add your theme definition at the end of the file and click the button.
button in the toolbar and select the respective color scheme from the drop-down menu.
4.3.8. Recording local history
button and select entry. From this menu, you can also display the local history records and apply the respective status to the Process as well as disable the feature or clear the current local history log.
4.3.9. Enlarging and shrinking canvas
4.3.10. Validating a Process
) button in the toolbar of the Process Designer with the Process and click . If validation errors have been detected, the elements with errors are highlighted in orange. Click on the invalid element on the canvas to display a dialog with the summary of its validation errors. To disable continuous validation, click the (
) button in the toolbar of the Process Designer with the Process and click .
) button in the toolbar of the Process Designer with the Process and click .

Figure 4.5. Stopping continuous validation
4.3.11. Correcting Invalid Processes
- In the Project view of the Project Explorer, select your Project and open the process.If the process is valid, the Process Designer opens process diagram on the canvas.If the process is invalid, you will see the following prompt:

- Click .The invalid process opens as XML in a text editor in the Process Designer.
- You can restore previous correct version of the process by selecting the version either from the drop-down menu or from the tab.Alternately, you can edit the XML to correct the business process and click .You can now open the valid process and view it as a diagram on the canvas.
4.4. Exporting a Process

Figure 4.6. Export Icon
- - Generates PNG file into the repository.
- - Generates PDF file into the repository.
- - Generates PNG file into the repository and the browser starts downloading this file.
- - Generates PDF file into the repository and the browser starts downloading this file.
- - Opens the "Process Sources" dialog box which contains the BPMN2, JSON, SVG, and ERDF source codes. The "Download BPMN2" button allows the user to download BPMN2 files. Pressing CTRL+A allows you to select the source code in a particular format. Pressing CTRL+F enables the find tool (Use /re/ syntax for regexp search).

Figure 4.7. Process Sources
4.5. Process elements
4.5.1. Generic properties of visualized Process elements
- Background
- The background color of the element in the diagram
- Border color
- The border color of the element in the diagram
- Font color
- The color of the font in the element name
- Font size
- The size of the font in the element name
- Name
- The element name displayed on the BPMN diagram
4.5.2. Defining Process elements properties
- Core properties, which include the basic properties of an element (typically Name, Data Set, Scripts, etc.).
- Extra properties, which include the properties necessary for the element execution (refer to Section A.6, “Process Elements”), data mapping (variable mapping) and local variable definitions (see Section 4.9.1, “Globals”), properties that represent an extension of the jBPM engine, typically onExitAction, Documentation, etc.
- Graphical properties, which include graphical representation of elements (colors, text settings).
- Simulation properties are used by the Simulation engine.
#{expression} to embed a value. The value will be retrieved on element instantiation, and the substitution expression will be replaced with the result of calling the toString() method on the variable defined in the expression. The expression could be the name of a variable (in which case it resolves to the value of the variable), but more advanced MVEL expressions are possible as well, e.g., #{person.name.firstname}.
- Open the Process definition in the Process Designer:
- On the canvas, select the Element.
- Click the double arrow (
) in the upper left corner of the Process Designer to display the Properties view.
- In the displayed Properties view, click the property value fields to edit them. Note that where applicable, you can click the drop-down arrow and the relevant value editor appears in a new dialog box.
- To save your changes, click the Save icon and select option Save.
4.6. Creating a Business Process Save Point
- Synchronous (Sync Service)
- Asynchronous (Async Service)

Procedure 4.2. Define a Service Task as Asynchronous
- Open the menu on the right side of te Business Process screen.
- Select Service Task you want to make asynchronous in the Process Modelling window.
- Under the menu, set the option to
true.
Note
4.6.1. Enabling Asynchronous Execution in Embedded Mode
KIE API (KieBase and KieSession)
RuntimeManager API
jBPM Services API
4.7. Forms
form is a layout definition for a page (defined as HTML) that is displayed as a dialog window to the user on a
process instantiationor atask instantiation.
Process form or a Task form. It serves for acquiring data for the Element instance execution, be it a Process or Task, from a human user: a Process form can take as its input and output Process variables; a Task form can take as its input DataInputSet variables with assignment defined, and as its output DataOutputSet variables with assignment defined.
4.7.1. Defining Process form
- Open your Process definition in the Process Designer.
- In the editor toolbar, click the
Form(
) icon and then Edit Process Form. - Select the editor to use to edit the form. Note that this document deals only with the option.
4.7.2. Defining Task form
- Open your Process definition with the User Task in the Process Designer.
- Select the Task on the canvas and click the
Edit Process Form(
) in the User Task menu.
- In the displayed Form Editor, define the Task form.
4.7.3. Defining form fields
Note
4.8. Form Modeler
- Form Modeling WYSIWYG UI for forms
- Form autogeneration from data model / Java objects
- Data binding for Java objects
- Formula and expressions
- Customized forms layouts
- Forms embedding

Figure 4.8. Adding fields by origin

Figure 4.9. Adding classes from data model
4.8.1. Creating a Form in Form Modeler
- In Business Central, go to → .
- On the perspective menu, select → .
- In the dialog that opens, fill out the name of your form in and click .
button to place the field types onto the canvas, where you can modify them. To modify the field types, use the icons that display when you place the cursor over a field: , , , , , or . The icons enable you to change the order of the fields in the form, group the fields, or clear and edit their content.

Figure 4.10. New form
4.8.2. Opening an Existing Form in Form Modeler

Figure 4.11. Opening an Existing Form
4.8.3. Setting Properties of a Form Field in Form Modeler
- In Form Modeler, select the tab and click the arrow
button to the right of a field type. The field type is added to the canvas.
- On the canvas, place the cursor on the field and click the edit
icon.
- In the dialog that opens on the right, set the form field properties and click at the bottom of the dialog for HTML Labels. For other form field properties, the properties change once you have removed focus from the property that you are modifying.
4.8.4. Configuring a Process in Form Modeler
- Create process variables to hold values entered into forms. Variables can be simple (e.g. 'string') or complex. You can define complex variables using Data Modeler, or create them in any Java integrated development environment (Java IDE) as regular plain Java objects.
- Declare the process variables in the 'variables definition' property.
- Determine which variables you want to set as input parameters for the task, which shall receive response from the form, and establish mappings by setting the 'DataInputSet', 'DataOutputSet', and 'Assignments' properties for any human task. To do so, use the Editor for Data Input, Editor for Data Output, and Editor for Data Assignment.
Example 4.1. Defining a Variable using Data Modeler

4.8.5. Generating Forms from Task Definitions

Figure 4.12. Generating Forms Automatically
) located above a user task.

Figure 4.13.
formName-taskform in the same package as the process, the human task engine will use the form to display and capture information entered by the user. If you create a form named ProcessId-task, the application will use it as the initial form when starting the process.
4.8.6. Editing Forms
move fields, add new fields, configure fields, or set values for object properties.
4.8.7. Moving a Field in Form Modeler

Figure 4.14. Moving a Form Field in Form Modeler

Figure 4.15. Destination Areas to Move a Field
4.8.8. Adding New Fields to a Form

Figure 4.16. Adding Fields by Origin
Input binding expression and Output binding expression properties, so when the form is submitted, the values in the fields are stored in the corresponding data origin. The tab allows you to add fields to the form from the fields type palette of the Form Modeler. The fields do not store their value for any data origin until they have correct configuration of the Input binding expression and Output binding expression properties.

Figure 4.17. Adding Fields by Type
simple types are used to represent simple properties like texts, numeric values, or dates. The following table presents a complete list of supported simple field types:
Table 4.1. Simple Field Types
| Name | Description | Java Type | Default on generated forms |
|---|---|---|---|
| Short Text | Simple input to enter short texts. | java.lang.String | yes |
| Long Text | Text area to enter long text. | java.lang.String | no |
| Rich Text | HTML Editor to enter formatted texts. | java.lang.Srowing | no |
| Simple input to enter short text with email pattern. | java.lang.String | no | |
| Float | Input to enter short decimals. | java.lang.Float | yes |
| Decimal | Input to enter number with decimals. | java.lang.Double | yes |
| BigDecimal | Input to enter big decimal numbers. | java.math.BigDecimal | yes |
| BigInteger | Input to enter big integers. | java.math.BigInteger | yes |
| Short | Input to enter short integers. | java.lang.Short | yes |
| Integer | Input to enter integers. | java.lang.Integer | yes |
| Long Integer | Input to enter long integers. | java.lang.Long | yes |
| Checkbox | Checkbox to enter true/false values. | java.lang.Boolean | yes |
| Timestamp | Input to enter date and time values. | java.util.Date | yes |
| Short Date | Input to enter date values. | java.util.Date | no |
| Document | Allows the user to upload documents to the form. | org.jbpm.document.Document | No |
Complex field types are designed for work with properties that are not basic types but Java objects. To use these field types, it is necessary to create extra forms in order to display and write values to the specified Java objects.
Table 4.2. Complex Field Types
| Name | Description | Java Type | Default on generated forms |
|---|---|---|---|
| Simple subform | Renders the form; it is used to deal with 1:1 relationships. | java.lang.Object | yes |
| Multiple subform | This field type is used for 1:N relationships. It allows the user to create, edit, and delete a set child Objects.Text area to enter long text. | java.util.List | yes |
Decorators are a kind of field types that does not store data in the object displayed in the form. You can use them for decorative purposes.
Table 4.3. Decorators
| Name | Description |
|---|---|
| HTML label | Allows the user to create HTML code that will be rendered in the form. |
| Separator | Renders an HTML separator. |
4.8.9. Configuring Fields of a Form
Field Type- can change the field type to other compatible field types.Field Name- is used as an identifier in calculating of formulas.Label- the text that is displayed as a field label.Error Message- a message displayed when there is a problem with a field, for example in validation.Label CCS Class- allows you to enter a class css to apply in label visualization.Label CCS Style- allows you to directly enter the style to be applied to the label.Help Text- introduced text displayed as an alternative attribute to help the user in data introduction.Style Class- allows you to enter a class CSS to be applied in field visualization.CSS Style- allows you to directly enter the style to be applied to the label.Read Only- a field with this property allows reading only, no write access.Input Binding Expression- defines the link between the field and the process task input variable. In runtime, it is used to set the field value to the task input variable data.Output Binding Expression- defines the link between the field and the process task output variable. In runtime, it is used to set the task output variable.
4.8.10. Creating Subforms with Simple and Complex Field Types
Procedure 4.3. To create and insert a subform containing a single object inside a parent form:
- In Business Central, go to → .
- On the perspective menu, select → .A new form opens in the Form Modeler. You must now configure the new form with information of the object it must contain.
- Enter the values for the required fields in the Form data origin tab and click .

Figure 4.18. Create Subform
- Click Add fields by origin tab and add the listed fields to the form.

Figure 4.19. Add fields by origin
- Click the Edit icon on the field in the form to open the Properties tab.
- In the Properties tab, configure the form by providing required values to the fields and click to save the subform.
- Open the parent form to configure the properties of the object.
- In the parent form, click the Add fields by type tab. Select the object on the form and configure it in the Properties tab.
- In the Properties tab, select Simple subform for the Field type property. Then select the newly created subform for the Default form field property.

Figure 4.20. Configure the Parent Form
- Click to save the parent form.This inserts your subform containing a single Java object inside the parent form.
Procedure 4.4. To insert a subform with multiple objects inside a parent form:
- In Business Central, go to → .
- On the perspective menu, select → .A new form opens in the Form Modeler. You must now configure the new form with information on the object array it must contain.
- Enter the values for the required fields in the Form data origin tab and click .
- Click Add fields by origin tab and add the listed fields to the form.
- Click the Edit icon on the field in the form to open the Properties tab.
- In the Properties tab, configure the form by providing required values to the fields. You can use the Formula Engine to automatically calculate field values.
- Click to save the subform.
- Open the parent form to configure the properties of each of the objects.
- In the parent form, click the Add fields by type tab. Select each object on the form one by one and configure them in the Properties tab.
- In the Properties tab, select Multiple subform for the Field type property. Then select the newly created subform for the Default form field property.

Figure 4.21. Configure the Parent Form
- Click to save the parent form.This inserts your subform containing an array of Java objects inside the parent form.
4.8.11. Attaching Documents to a Form
Document form field. This field can be attached to any form, process or task based.
Document field to a form, click on it while creating or editing an existing form (in the Add fields by type section).

Document form fields based on the presence of a org.jbpm.document.Document variable type in your process.


Pluggable Variable Persistence
<marshalling-strategy> element. This element should name a type that provides an implementation of the org.kie.api.marshalling interface.
public boolean accept(Object object): Determines if the given object can be marshalled by the strategy.byte[] marshal( Context context, ObjectOutputStream os, Object object ): Marshals the given object and returns the marshalled object as byte[].Object unmarshal( Context context, ObjectInputStream is, byte[] object, ClassLoader classloader ): Reads the object received as byte[] and returns the unmarshalled objectvoid write(ObjectOutputStream os, Object object): same asmarshalmethod, provided for backwards compatibility.Object read(ObjectInputStream os): same asunmarshal, provided for backwards compatibility.
docs. This default implementation is defined by the DocumentStorageService class and is implemented through the DocumentStorageServiceImpl class.
4.8.12. Rendering Forms for External Use
4.8.12.1. JavaScript Library for Form Reuse
Blueprint for using the JavaScript Library
- Integrate the JavaScript library in the codebase for the external client application so that its functions are available.
- Create a new instance of the
jBPMFormsAPIclass in your own JavaScript code. This is the starting point for all interactions with this library.var jbpmRestAPI = new jBPMFormsAPI();
- Call your desired methods on this instance. For example, if you want to show a form, you would use the following method:
jbpmRestAPI.showStartProcessForm(hostUrl, deploymentId, processId, divId, onsuccess, onerror);
and provide the relevant details (hostUrl, deploymentId, processId and so on. A full list of the methods and parameters follows after this section). - Do post processing with the optional
onsuccessandonerrormethods. - Work with the form, starting processes (
startProcess()), claiming tasks (claimTask()) starting tasks (startTask()) or completing tasks (completeTask). Full list of available methods follows after this section. - Once you're finished with the form, clear the container that displayed it using
clearContainer()method.
Full list of available methods in the JavaScript Library
showStartProcessForm(hostUrl, deploymentId, processId, divId, onsuccessCallback, onerrorCallback):Makes a call to the REST endpoint to obtain the form URL. If it receives a valid response, it embeds the process start form in the stated div. You need these parameters:hostURL: The URL of the Business Central instance that holds the deployments.deploymentId: The deployment identifier that contains the process to run.processId: The identifier of the process to run.divId: The identifier of the div that has to contain the form.onsuccessCallback(optional): A JavaScript function executed if the form is going to be rendered. This function will receive the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to render the form. This function will receive the server response as a parameter.
startProcess(divId, onsuccessCallback, onerrorCallback):Submits the form loaded on the stated div and starts the process. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the process is started. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to start the process. This function receives the server response as a parameter.
showTaskForm(hostUrl, taskId, divId, onsuccessCallback, onerrorCallback):Makes a call to the REST endpoint to obtain the form URL. If it receives a valid response, it embeds the task form in the stated div. You need these parameters:hostURL: The URL of the Business Central instance that holds the deployments.taskId: The identifier of the task to show the form.divId: The identifier of the div that has to contain the form.onsuccessCallback(optional): A JavaScript function executed if the form is going to be rendered. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to render the form. This function receives the server response as a parameter.
claimTask(divId, onsuccessCallback, onerrorCallback):Claims the task whose form is being rendered. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the task is claimed. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to claim the task. This function receives the server response as a parameter.
startTask(divId, onsuccessCallback, onerrorCallback):Starts the task whose form is being rendered. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the task is claimed. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to claim the task. This function receives the server response as a parameter.
releaseTask(divId, onsuccessCallback, onerrorCallback):Releases the task whose form is being rendered. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the task is claimed. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to claim the task. This function receives the server response as a parameter.
saveTask(divId, onsuccessCallback, onerrorCallback):Submits the form and saves the state of the task whose form is being rendered. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the task is claimed. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to claim the task. This function receives the server response as a parameter.
completeTask(divId, onsuccessCallback, onerrorCallback):Submits the form and completes task whose form is being rendered. You need these parameters:divId: The identifier of the div that contains the form.onsuccessCallback(optional): A JavaScript function executed after the task is claimed. This function receives the server response as a parameter.onerrorCallback(optional): A JavaScript function executed if any error occurs and it is impossible to claim the task. This function receives the server response as a parameter.
clearContainer(divId):Cleans the div content and the related data stored on the component. You need these parameters:divId: The identifier of the div that contains the form.
4.9. Variables
null and a write access produces an error message, and the Process continues its execution. Variables are searched for based on their ID.
- Session context:
Globalsare visible to all Process instances and assets in the given Session and are intended to be used primarily by business rules and by constrains. The are created dynamically by the rules or constrains. - Process context:
Process variablesare defined as properties in the BPMN2 definition file and are visible within the Process instance. They are initialized at Process creation and destroyed on Process finish. - Element context:
Local variablesare available within their Process element, such as an Activity. They are initialized when the element context is initialized, that is, when the execution workflow enters the node and execution of the OnEntry action finished if applicable. They are destroyed when the element context is destroyed, that is, when the execution workflow leaves the element.Values of local variables can be mapped to Global or Process variables using the Assignment mechanism (refer to Section 4.12, “Assignment”). This allows you to maintain relative independence of the parent Element that accommodates the local variable. Such isolation may help prevent technical exceptions.
4.9.1. Globals
Important
NullPointerException.
4.9.1.1. Creating Globals
Procedure 4.5. Defining a Global in the Process Designer
- Open the Process in the Process Designer.
- In the Properties panel of the BPMN Diagram expand the Extra item.
- Click the empty value cell next to the Globals and click the arrow.

Figure 4.22. Global properties cell
- In the Editor for Variable Definitions window, click the button and define the variable details.

Figure 4.23. Editor for Variable Definitions
Procedure 4.6. Defining and Initializing a Global using the API
- Define the variables as a Map of the <String, Object> values.
- Provide the map as a parameter to the
startProcess()method.
Example 4.2. Code instantiating a Process with a Global
Map<String, Object> params = new HashMap<String, Object>();
params.put("var", "variable value");
ksession.startProcess("Process Definition Name", params);4.9.1.2. Accessing Globals
processInstance.getContextInstance().getVariable("globalStatus")
4.9.1.3. Process variables
4.9.2. Local variables
Note
4.9.2.1. Accessing local variables
person.setAge(10) sets the Age field of the person global variable to 10.
4.10. Action scripts
kcontext. Accordingly, kcontext is an instance of ProcessContext class and the interface content can be found at the following location: Interface ProcessContext.
person.getName() is person.name. It also provides other improvements over Java and MVEL expressions are generally more convenient for the business user.
Example 4.3. Action script that prints out the name of the person
// Java dialect System.out.println( person.getName() ); // MVEL dialect System.out.println( person.name );
4.11. Interceptor actions
4.12. Assignment
4.12.1. Data I/O Editor
- Elements such as
User TasksandCall Activities, which have both DataInputs and DataOutputs, use a property calledAssignments. - Elements such as
Start EventsandIntermediate Catch Events, which have DataOutputs but do not have DataInputs, use a property calledDataOutputAssociations. - Elements such as
End EventsandIntermediate Throw Events, which have DataInputs but do not have DataOutputs, use a property calledDataInputAssociations.
Assignments, DataOutputAssociations, and DataInputAssociations properties are all edited in the Data I/O Editor. DataInputs can have values assigned to them either by mapping from process variables or by assigning constant values to them. DataOutputs are mapped to Process Variables.
button to open the Data I/O Editor. Data Input Assignments and Data Output Assignments can be added by clicking the button.

Assignments, DataOutputAssociations, or DataInputAssociations.
Note
4.12.2. Data I/O Editor Example
invoicewith typeorg.kie.test.Invoice.reasonwith typeString.

- invoice
- reason
- maxamount
- myvar
1000.00, which will be assigned to it at runtime.
4.13. Constraints
true or false).
- Code constraints are defined either in Java or MVEL. They have access to data in the working memory, including the Globals and Process variables.
Example 4.4. Code constraint defined in Java
return person.getAge() > 20;
Example 4.5. Code constraint defined in MVEL
return person.age > 20;
- Rule constraints are defined in the form of BRMS rule conditions. They have access to data in the Working Memory, including the Globals. However, they cannot access the variables in its Process directly, but through the Process instance: to acquire the reference of the parent Process instance, use the
processInstancevariable of the typeWorkflowProcessInstance. Note that you need to insert the Process instance into the Session and update it if necessary, for example, using Java code or an on-entry or on-exit or explicit action in your Process.Example 4.6. Rule constraint with process variable assignment
import org.kie.api.runtime.process.ProcessInstance; import org.kie.api.runtime.process.WorkflowProcessInstance; ... processInstance : WorkflowProcessInstance() Person( name == ( processInstance.getVariable("name") ) )The rule constraint acquires the Process variablename.

Figure 4.24. Script Editor
return true;
4.14. Data models
4.14.1. Data Modeler
Editor and Source tabs, along with source code preservation. This allows you to make changes to your model in external tools, like JBDS, and the Data Modeler updates the necessary code blocks automatically.
- Add/delete fields
- Select a given field. When a field is selected then the field information will be loaded in all the domain editors.

- Select the data object class. For example, by clicking on the data object name (on the main window) instead of loading the field properties, the domain editors will load the class properties.

4.14.2. Annotations in Data Modeler
Note
.jar file that has the annotation. The Data Modeler will run a validation check to confirm that the annotation is on the classpath, and the project will not build if the annotation is not present.
4.14.3. Creating a Data Object (Not Persistable)
- In the Project Authoring perspective, click → on the perspective menu. Enter the name and the location (the name has to be unique across the package, but it is possible to have two data object with the same name in two different packages). Uncheck the box to prevent the Data Object from being made persistable. Press the button.
- Create fields of the data object:
- By clicking button in the main editor window, you can add a field to the object with the attributes Id, Label and Type. Required attributes are marked with *.
- Id: field ID unique within the data object
- Label: label to be used in the Fields panel (optional)
- Type: data type of the field

- Click the button (the new field is created and the New field window closes) or the button (the new field is created and the New field window remains open, so it is possible to continue adding more fields).
Attributes can be edited selecting the attribute and editing the fields using the general properties screen to the right.
Important
4.14.4. Persistable Data Objects
Procedure 4.7. Creating a Persistable Data Object
- When creating a persistable Data Object, the Identifier field
idwill be generated automatically, along with the@Entityannotation.
Selecting the option changes a property to have multiple values. For example, it can enable an attributeName, to have a list of strings with multiple names. - Create fields of the data object:
- By clicking button in the main editor window, you can add a field to the object with the attributes Id, Label and Type. Required attributes are marked with *.
- Id: field ID unique within the data object
- Label: label to be used in the Fields panel (optional)
- Type: data type of the field

- Click the button (the new field is created and the New field window closes) or the button (the new field is created and the New field window remains open, so it is possible to continue adding more fields).
Attributes can be edited selecting the attribute and editing the fields using the general properties screen to the right.
4.14.5. Data Object Domain Screens
Drools & jBPM
- TypeSafe
- Role
- Timestamp
- Duration
- Expires


Persistence


Table 4.4. Type Annotations
| Annotation | Automatically Generated when Data Object is Persistable |
|---|---|
| javax.persistence.Entity | Yes |
| javax.persistence.Table | No |
Table 4.5. Field Annotations
| Annotation | Automatically Generated when Data Object is Persistable |
|---|---|
| javax.persistence.Id | Yes |
| javax.persistence.GeneratedValue | Yes |
| javax.persistence.SequenceGenerator | Yes |
| javax.persistence.Column | No |
| javax.persistence.OneToOne | No |
| javax.persistence.OneToMany | Yes - when a field has one or multiple values |
| javax.persistence.ManyToOne | Yes - when a field has multiple values |
| javax.persistence.ManyToMany | No |
| javax.persistence.ElementCollection | Yes - generated by the UI when a new field has one or multiple of a base java type, such as Integer, Boolean, String. This annotation cannot be edited with the Persistence screen tool (use the Advanced screen tool instead). |
Advanced




4.14.6. Configuring Relationships Between Data Objects

Usage Detected screen. It is still possible to delete the object from here, however this will stop your project from building successfully until the resulting errors are resolved.
4.14.7. Persistence Descriptor
persistence.xml file is created by default when the user opens the project editor and selects . It can then be configured via the Persistence Descriptor. The Persistence Descriptor is accessible by opening the Project Editor, and clicking → .


- enables the user to add arbitrary classes to the
persistence.xmlfile to be declared as entities. - will automatically load all the persisteable data objects in the current project.

4.14.8. Deployment Descriptor
kie-deployment-descriptor.xml file for deployment in the jBPM runtime. Automatic configuration of the JPA Marshalling Strategies is only available in JBoss BPM Suite.

4.15. Domain-specific Tasks
custom work items or custom service nodes.
- work item handler
- The work item handler is a Java class that defines how to execute the custom task type. (Just like all Process elements, Tasks are executed in the Execution Engine (more precisely in the Task Engine), which contains a work item handler class, that defines how to handle the particular work item. Therefore, to allow the Execution Engine to execute your custom work item, you need to create a work item handler class for the custom work item and register it with the Execution Engine.)
- work item definition
- The work item definition defines how the custom task is presented (its name, icon, parameters).
Note
4.15.1. Work item definition
what part (the how part is implemented as a class that implements WorkItemHandler).
- Web Process Designer
- A work item definition is defined as an MVEL construct in a project resource (the custom work item node will appear on the palette; refer to Section 4.15.1.2, “Creating a work item definition”).
- JBoss Developer Studio Process Designer
- The BPMN2 <task> or <task>-type elements can be modified to work with
WorkItemHandlerimplementations.To do so, create aWID_NAME.widfile under theMETA-INFdirectory. (Example:$PROJECT_HOME/src/main/resources/META-INF/WID_NAME.wid). The contents of this file will be the same as the ones that you will create as if under Business Central (Web Process Designer). If there are any icons, create these icons under a folder$PROJECT_HOME/src/main/resources/, and store the icon images files iniconsfolder.Once you save this file, you can use your custom service task with the JBDS Process Designer. You can find your task in the category which is defined inWID_NAME.widfile.
- name unique in the given work item set
- description with arbitrary text
- version number
- parameters with a set of work item parameters used as properties
- displayName used in the palette
- icon with the path to the icon file for the Task element
- category the node is added to in the palette (if the defined category does not exit, a new category is created)
- defaultHandler with the class that implements the WorkItemHandler class and is used to execute the work item
- dependencies the defaultHandler requires for its execution
Important
Example 4.7. Calendar work item definition
import org.drools.core.process.core.datatype.impl.type.StringDataType;
[
[
"name" : "Google Calendar",
"description" : "Create a meeting in Google Calendar",
"version" : "1.0",
"parameters" : [
"FilePath" : new StringDataType(),
"User" : new StringDataType(),
"Password" : new StringDataType(),
"Body" : new StringDataType()
],
"displayName" : "Google Calendar",
"icon" : "calendar.gif",
"eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor",
"category" : "Google",
"defaultHandler" : "org.jbpm.process.workitem.google.calendar.GoogleCalendarWorkItemHandler",
"dependencies" : [
]
]
]4.15.1.1. Work item handler
org.kie.api.runtime.process.WorkItemHandler interface.
Note
- The jbpm-bpm2 module in the org.jbpm.bpmn2.handler package contains the following work item handlers:
- ReceiveTaskHandler (for the BPMN <receiveTask> element)
- SendTaskHandler (for the BPMN <sendTask> element)
- ServiceTaskHandler (for the BPMN <serviceTask> element)
- The jbpm-workitems module in packages within org.jbpm.process.workitem contains work item handlers, some of which are listed below:
- ArchiveWorkItemHandler creates a ZIP archive (it takes a list of files as its parameter, which are included in the archive)
- WebServiceWorkItemHandler
- TransformWorkItemHandler
- RSSWorkItemHandler
- RESTWorkItemHandler
- JavaInvocationWorkItemHandler
- JabberWorkItemHandler
- JavaHandlerWorkItemHandler
- FTPUploadWorkItemHandler
- ExecWorkItemHandler
- EmailWorkItemHandler
executeWorkItem() and abortWorkItem() methods as defined by the WorkItemHandler interface. These are called during runtime on work item execution.
- Information about the Task are extracted from the WorkItem instance.
- The work item business logic is performed.
- The Process instance is informed that the work item execution finished (completed or aborted) using the respective method of the WorkItemManager:
- for completing execution:
import org.kie.api.runtime.process.WorkItemManager; ... WorkItemManager.completeWorkItem(long workItemId, Map<String, Object> results)
- for aborting execution:
import org.kie.api.runtime.process.WorkItemManager; ... WorkItemManager.abortWorkItem(long workItemId, Map<String, Object> results)
WorkItemHandler.abortWorkItem() before it is completed Section 5.1.4.1, “Asynchronous execution”.
4.15.1.2. Creating a work item definition
- In the Project Explorer panel (the
Project Authoringperspective), select your project. - In the perspective menu, click → .
- In the Create new dialogue box, define the definition details:
- In the Name field provide the definition name.
- Click the button.
- A new tab with the work item definition template opens up in the Work Item editor.
Note
Whenever a user creates a new business process in some project, the default WID will be created. Users will be able to reuse or directly alter the WID file whenever necessary. In addition, there will always be a default WID once the BPMN process is created. - In the editor, edit the source of the MVEL work item definition. The definition is stored in the current package.If you are planning to add the work item using the service repository as opposed to adding the work item handler to the classpath, make sure to define its dependencies, category, etc.If you are creating the definition out of Business Central, your project directory structure should be similar to
PROJECT_NAME/src/main/resources/PACKAGE_NAME/WID_NAME.wid(visible in the Repository view).Example 4.8. Example wid file
import org.drools.core.process.core.datatype.impl.type.StringDataType; import org.drools.core.process.core.datatype.impl.type.ObjectDataType; [ [ "name" : "MyTask", "parameters" : [ "MyFirstParam" : new StringDataType(), "MySecondParam" : new StringDataType(), "MyThirdParam" : new ObjectDataType() ], "results" : [ "Result" : new ObjectDataType("java.util.Map") ], "displayName" : "My Task", "icon" : "" ] ] - Upload and assign an icon to the Work Item:
- Click → .
- In the Create new Uploaded file dialogue box, define the resource name and make sure to include the file's extension in the name. Click the option to locate and upload the file (
pngorgif, 16x16 pixels). Click . - Make sure your mouse is positioned within the blank " " of the icon parameter:
"icon" : " "
Click the Select icon to add drop-down and click the icon file. The icon path will appear within the parameter:"icon" : "ExampleIcon.png"
Note
The path to describe the location of an icon can be relative or absolute, as long as the icon can be found using one of these methods. For example, the following paths are supported:"icon" : "ExampleIcon.png" (icon in the same folder as the .wid file) "icon" : "com/test/ExampleIcon.png" (icon relative to .wid file location) "icon" : "../test/ExampleIcon.png" (icon relative to .wid file location) "icon" : "/HR/src/main/resources/ExampleIcon.png" (absolute path to icon)
- In the Process Designer, check if your work item is available in the palette.
4.15.1.3. Creating a work item handler
- Create a maven project with your implementation of a work item handler with the required business logic. Make sure to call the
completeWorkItem()function to finish the business logic execution and add thekie-apiartifact with the6.x.x.redhat-xversion value as the project dependency.Example 4.9. Notification work item handler
package com.sample; import org.kie.api.runtime.process.WorkItem; import org.kie.api.runtime.process.WorkItemHandler; import org.kie.api.runtime.process.WorkItemManager; public class NotificationWorkItemHandler implements WorkItemHandler { public void executeWorkItem(WorkItem workItem, WorkItemManager manager) { String from = (String) workItem.getParameter("From"); String to = (String) workItem.getParameter("To"); String message = (String) workItem.getParameter("Message"); String priority = (String) workItem.getParameter("Priority"); /* Send email. The ServiceRegistry class is an example class implementing the task business logic. */ EmailService service = ServiceRegistry.getInstance().getEmailService(); service.sendEmail(from, to, "Notification", message); /* Notify manager that work item has been completed. The completeWorkItem() call completes the work item execution. */ manager.completeWorkItem(workItem.getId(), null); } public void abortWorkItem(WorkItem workItem, WorkItemManager manager) { // Do nothing, notifications cannot be aborted } }Important
If theWorkItemManageris not notified about the work item completion, the process engine is never notified that your work item node has completed. - Register the work item handler in the
DEPLOY_DIR/business-central.war/WEB-INF/classes/META-INF/CustomWorkItemHandlers.conffile.TheCustomWorkItemHandlers.conffile contains information like the following:[ "Log": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(), "WebService": new org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler(ksession), "Rest": new org.jbpm.process.workitem.rest.RESTWorkItemHandler() ]
Notice the "Rest" value in the previous file. This indicates theWorkItemHandleris capable of interacting with REST services. It supports both secured/authenticated and open/not authenticated services.This REST value is defined in the project's WID file in the following manner:[ "name" : "Rest", "parameters" : [ //Url - Mandatory resource location to be invoked. "Url" : new StringDataType(), //Method - Defaults to GET and is the HTTP method that will be executed. "Method" : new StringDataType(), //ConnectionTimeout - Defaults to 60 seconds for the connection timeout. "ConnectTimeout" : new StringDataType(), //ReadTimeout - Defaults to 60 seconds for the read timeout. "ReadTimeout" : new StringDataType(), //Username - The username for authentication that overrides the one given on handler initialization. "Username" : new StringDataType(), //Password - The password for authentication that overrides the one given on handler initialization. "Password" : new StringDataType() ], "results" : [ "Result" : new ObjectDataType(), ], "displayName" : "REST", "icon" : "defaultservicenodeicon.png" ]The configuration options displayed about must be given via the work item parameter. The authentication information can be given on handler initialization, but it can be overridden via the work item parameter. - Compile the project. The resulting JAR file should be placed in (
DEPLOY_DIR/business-central.war/WEB-INF/lib/). - Restart the server.
Registering via kmodule.xml
CustomWorkItemHandlers.conf is to configure them with kmodule.xml. This is beneficial in that it avoids a complete server restart.
- Register the work item handler in the menu path
PROJECT_NAME/src/main/resources/META-INF/kmodule.xml - Make sure the work item handler is given as a MVEL expression; for example,
new org.jbpm.wih.CustomHandler()or FQCN expression:org.jbpm.wih.CustomHandler. - Compile the project. Upload the work item handler JAR into Business Central via the Artifact Repository. Then add it as a dependency for the project where the user wants to use this handler.
4.15.1.4. Registering a Work Item handler
WorkItemHandlers are registered in the ksession automatically. However, in order for them to be used in embedded mode, the WorkItemManager registers WorkItemHandler instances. Likewise, in the example below, the NotificationWorkItemHandler needs to be registered in order for it to be used with a process containing a Notification work item:
- Register the work item handler like the following:
/* Create the drools name of the <task> and the custom work item handler instance */ KieSession kieSession = kieBase.newKieSession(); ksession.getWorkItemManager().registerWorkItemHandler( "Notification", new NotificationWorkItemHandler() );
- Look at the BPMN2 syntax for the process. The previous registration example would appear as follows:
<?xml version="1.0" encoding="UTF-8"?> <definitions id="Definition" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xs:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" ... xmlns:tns="http://www.jboss.org/drools"> ... <process isExecutable="true" id="myCustomProcess" name="Domain-Specific Process" > ... <!-- The tns:taskName attribute in the <task> node is necessary for the WorkItemManager to be able to see which WorkItemHandler instance should be used with which task or work item. --> <task id="_5" name="Notification Task" tns:taskName="Notification" > ...
Note
4.15.2. Service repository
Important
Note
4.15.2.1. Importing from a service repository
- Open your Process in the Web Process Designer.
- In the editor menu, click the
button.
- In the Service Repository Connection window, define the location of the repository on the location input line and click .

Figure 4.25. Establishing connection to a service repository
- Double-click the asset to import it.
Important
DEPLOY_DIRECTORY/business-central.war/WEB-INF/classes/META-INF/CustomWorkItemHandler.conf file. If a work item is not registered in the file, it will not be available for use.
4.15.2.2. Setting up a service repository
index.conf file in its root directory.
Repository configuration file
index.conf file must be located in the root directory of the service repository. It contains a list of any directory within the repository that are to be considered directories of the service repository.
Example 4.10. index.conf
Email FileSystem ESB FTP Google Java Jabber Rest RSS Transform Twitter
index.conf file so as to serve as a directory or work item resources. Note that the hierarchical structure of the repository is not shown when browsing the repository using the import wizard, as the category property in the configuration file is used for that.
Work items and their resources
- A work item configuration file is a file with the same name as the parent directory (for example,
Twitter.conf) that contains details about the work item resources in the service repository. The file is an extension of the work item definition file (refer to Section 4.15.1, “Work item definition”). Note, that the configuration file must contain references to any dependencies the work item handler requires. Optionally, it can define the documentation property with a path to documentation and category which defines the category the custom work item is placed under in the repository.Example 4.11. Work item configuration file
import org.drools.core.process.core.datatype.impl.type.StringDataType; [ [ "name" : "Twitter", "description" : "Send a twitter message", "parameters" : [ "Message" : new StringDataType() ], "displayName" : "Twitter", "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.SampleCustomEditor", "icon" : "twitter.gif", "category" : "Communication", "defaultHandler" : "org.jbpm.process.workitem.twitter.TwitterHandler", "documentation" : "index.html", //Every work item definition should specify dependencies even if it doesn't have one. "dependencies" : [] [ "file:./lib/jbpm-twitter.jar", "file:./lib/twitter4j-core-2.2.2.jar" ] ] ] - All resources referenced in the work item configuration file: icon, documentation, and dependencies.
4.15.3. User Task calls
TaskClient class. The API is intended for developers to allow direct managing of the lifecycle of User Tasks. End users are advised to use the Business Central web application for User Task management.
taskId: ID of the target Task instance usually extracted from the currently selected User Task in the user task list in the user interfaceuserId: ID of the user that is executing the action called by the method; usually the ID of the user that is logged in
org.kie.api.task.TaskService class:
void start(long taskId, String userId); void stop(long taskId, String userId); void release(long taskId, String userId); void suspend(long taskId, String userId); void resume(long taskId, String userId); void skip(long taskId, String userId); void delegate(long taskId, String userId, String targetUserId); void complete(long taskId, String userId, Map<String, Object> results);
Example 4.12. Starting and completing a simple user task
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.api.task.TaskService;
import org.kie.api.task.model.TaskSummary;
....
KieSession ksession = runtimeEngine.getKieSession();
TaskService taskService = runtimeEngine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");
// John is assigned a task and he completes it
List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
TaskSummary task = list.get(0);
logger.info("John is executing task {}", task.getName());
taskService.start(task.getId(), "john");
taskService.complete(task.getId(), "john", null);
...
4.15.4. Actor assignment calls
ActorID or the GroupID parameter, which define the users who can or should execute the User Tasks. It is in the Task List of these users the Task appears.
Important
Administrator is the administrator of each Task. It is therefore recommended to always define at least user Administrator when registering the list of valid users with the User Task service.
4.15.4.1. Connecting to custom directory information services
- Create an implementation of the UserGroupInfoProducer interface and provide your own custom callback (see Section 4.15.5.1, “Connecting to LDAP”) and user info implementations according to the needs from the producer.This implementation must be annotated with the @Selectable qualifier for it to be found by Business Central. The listing below shows an example LDAP implementation:
import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Alternative; import javax.enterprise.inject.Produces; import org.jbpm.services.task.identity.LDAPUserGroupCallbackImpl; import org.jbpm.services.task.identity.LDAPUserInfoImpl; import org.jbpm.shared.services.cdi.Selectable; import org.kie.api.task.UserGroupCallback; import org.kie.internal.task.api.UserInfo; @ApplicationScoped @Alternative @Selectable public class LDAPUserGroupInfoProducer implements UserGroupInfoProducer { private UserGroupCallback callback = new LDAPUserGroupCallbackImpl(true); private UserInfo userInfo = new LDAPUserInfoImpl(true); @Override @Produces public UserGroupCallback produceCallback() { return callback; } @Override @Produces public UserInfo produceUserInfo() { return userInfo; } } - Package your custom implementations (the
LDAPUserGroupInfoProducer, theLDAPUserGroupCallbackImpland theLDAPUserInfoImplclasses from the example above) into a bean archive (jar with META-INF/beans.xml so it can be found by CDI container). Add this jar file tobusiness-central.war/WEB-INF/lib. - Modify
business-central.war/WEB-INF/beans.xmland add the implementation (LDAPUserGroupInfoProducerfrom the example above) as an alternative to be used by Business Central.<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>com.test.services.producer.LDAPUserGroupInfoProducer</class> </alternatives> </beans>Warning
The use of a customUserGroupInfoProducerrequires internal APIs, which may be broken in future releases. Using a customUserGroupInfoProduceris not recommended or supported by Red Hat. - Restart your server and your custom callback implementation should now be used by Business Central.
4.15.5. LDAP connection
- ldap.bind.user: username used to connect to the LDAP server (optional if LDAP server accepts anonymous access)
- ldap.bind.pwd: password used to connect to the LDAP server (optional if LDAP server accepts anonymous access)
- ldap.user.ctx: context in LDAP with user information (mandatory)
- ldap.role.ctx: context in LDAP with group and role information (mandatory)
- ldap.user.roles.ctx: context in LDAP with user group and role membership information (optional; if not specified, ldap.role.ctx is used)
- ldap.user.filter: filter used to search for user information; usually contains substitution keys {0}, which are replaced with parameters (mandatory)
- ldap.role.filter: filter used to search for group and role information, usually contains substitution keys {0}, which are replaced with parameters (mandatory)
- ldap.user.roles.filter: filter used to search for user group and role membership information, usually contains substitution keys {0}, which are replaced with parameters (mandatory)
- ldap.user.attr.id: attribute name of the user ID in LDAP (optional; if not specified,
uidis used) - ldap.roles.attr.id: attribute name of the group and role ID in LDAP (optional; if not specified
cnis used) - ldap.user.id.dn: user ID in a DN, instructs the callback to query for user DN before searching for roles (optional, by default
false) - java.naming.factory.initial: initial conntext factory class name (by default
com.sun.jndi.ldap.LdapCtxFactory) - java.naming.security.authentication: authentication type (possible values are
none,simple,strong; by defaultsimple) - java.naming.security.protocol: security protocol to be used; for instance
ssl - java.naming.provider.url: LDAP url (by default
ldap://localhost:389; if the protocol is set tosslthenldap://localhost:636)
4.15.5.1. Connecting to LDAP
- programatically: build a
Propertiesobject with the respective LDAPUserGroupCallbackImpl properties and createLDAPUserGroupCallbackImplwith thePropertiesobject as its parameter.Example 4.13.
import org.kie.api.PropertiesConfiguration; import org.kie.api.task.UserGroupCallback; ... Properties properties = new Properties(); properties.setProperty(LDAPUserGroupCallbackImpl.USER_CTX, "ou=People,dc=my-domain,dc=com"); properties.setProperty(LDAPUserGroupCallbackImpl.ROLE_CTX, "ou=Roles,dc=my-domain,dc=com"); properties.setProperty(LDAPUserGroupCallbackImpl.USER_ROLES_CTX, "ou=Roles,dc=my-domain,dc=com"); properties.setProperty(LDAPUserGroupCallbackImpl.USER_FILTER, "(uid={0})"); properties.setProperty(LDAPUserGroupCallbackImpl.ROLE_FILTER, "(cn={0})"); properties.setProperty(LDAPUserGroupCallbackImpl.USER_ROLES_FILTER, "(member={0})"); UserGroupCallback ldapUserGroupCallback = new LDAPUserGroupCallbackImpl(properties); UserGroupCallbackManager.getInstance().setCallback(ldapUserGroupCallback); - declaratively: create the
jbpm.usergroup.callback.propertiesfile in the root of your application or specify the file location as a system property:-Djbpm.usergroup.callback.properties=FILE_LOCATION_ON_CLASSPATHMake sure to register the LDAP callback when starting the User Task server.#ldap.bind.user= #ldap.bind.pwd= ldap.user.ctx=ou\=People,dc\=my-domain,dc\=com ldap.role.ctx=ou\=Roles,dc\=my-domain,dc\=com ldap.user.roles.ctx=ou\=Roles,dc\=my-domain,dc\=com ldap.user.filter=(uid\={0}) ldap.role.filter=(cn\={0}) ldap.user.roles.filter=(member\={0}) #ldap.user.attr.id= #ldap.roles.attr.id=
4.16. Exception Management
Business exceptions
- Errors
- An Error is a signal that an unexpected situation occurred (refer to Section A.4.1, “Errors”). The mechanism can be used immediately when the problem arises and does not allow for any compensation.
- Compensation
- Compensation is equivalent to the Error mechanism; however, it can be used only on Sub-Processes when it is required that the execution flow continues after the compensation using the "regular" outgoing Flow (execution continues after the compensation as if no compensation occurred).
- Canceling
- Canceling is equivalent to the Error mechanism; however, it can be used only on Sub-Processes and it is required that the Sub-Process takes the flow leaving the respective Cancel Intermediate Event so that the "normal" execution flow is never taken as opposed to compensation.
Technical exceptions
Chapter 5. Advanced Process modeling
5.1. Process modeling options
- Using one of the graphical editors
- You can use two delivered graphical editors. Process Designer is available through Business Central and Eclipse Process Designer. See Red Hat JBoss BPM Suite User Guide for more information on how to use the editors.
- Using an XML editor
- You can use any XML or text editor to create a process specification using the BPMN2 XML schema.
- Using the Process API
- You can use the JBoss BPM Suite
coreAPI directly. The most important process model elements are defined in the packages org.jbpm.workflow.core and org.jbpm.workflow.core.node.
5.1.1. Process modeling using XML
- XML prolog
- The XML prolog consists of the XML declaration and DTD declaration.
- The
processelement - The
processelement defines process attributes and contains definitions of the process elements (nodes and connections). - BPMN diagram definition
- The
BPMNDiagramelement contains definitions for visualization of the Process elements in the Process Diagram.
Example 5.1. BPMN2 example file
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"Rule Task
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools">
<process processType="Private" isExecutable="true" id="com.sample.hello" name="Hello Process" >
<!-- nodes -->
<startEvent id="_1" name="Start" />
<scriptTask id="_2" name="Hello" >
<script>System.out.println("Hello World");</script>
</scriptTask>
<endEvent id="_3" name="End" >
<terminateEventDefinition/>
</endEvent>
<!-- connections -->
<sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
</process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="com.sample.hello" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="16" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="96" y="16" width="80" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="208" y="16" width="48" height="48" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_1-_2" >
<di:waypoint x="40" y="40" />
<di:waypoint x="136" y="40" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
<di:waypoint x="136" y="40" />
<di:waypoint x="232" y="40" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>5.1.2. Process modeling using API
- Create a Runtime Manager in your Execution Server.
- Singleton: allows sequential execution of multiple instances in the one session
- PerProcessInstance: allows you to create multiple process instances; every instance is created within its own session.
- PerRequestSession: every external interaction with a process instances causes that the process session finishes and the process instance is re-created in a new session.
- Get a runtime context and create a session in it.
- Start a Process from the underlying Knowledge Base.
- Close the Runtime Manager.
Example 5.2. Process instantiation in a session of Per Process Instance Runtime Manager
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.runtime.manager.RuntimeManagerFactory.Factory;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.KieSession;
...
RuntimeManager manager =
RuntimeManagerFactory.Factory.get()
.newPerProcessInstanceRuntimeManager(environment);
RuntimeEngine runtime =
manager.getRuntimeEngine(
ProcessInstanceIdContext.get());
KieSession ksession = runtime.getKieSession();
// do something here, e.g.
ksession.startProcess(“org.jbpm.hello”);
manager.disposeRuntimeEngine(engine);
manager.close();5.1.3. Process update
5.1.3.1. Process update
Abort: any running Process instances are aborted. If necessary, you can have the Process instance restarted using the new Process definition.Transfer: any running Process instances are migrated to the new process definition: once the instance has been migrated successfully, it will continue its execution based on the updated process logic. For further information refer to Section 5.1.3.3, “Migrating a Process instance”.
Example 5.3. Process abort update
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieSessionConfiguration;
// build kbase with the replace-version-1.bpmn process
KieBase kbase = KieServices.Factory.get().newKieSessionConfiguration();
kbase.addKnowledgePackages(getProcessPackages("replace-version-1.bpmn"));
KieSession ksession = kbase.newStatefulKnowledgeSession();
try {
// start a replace-version-1.bpmn process instance
ksession.startProcess("com.sample.process", Collections.<String, Object>singletonMap("name", "process1"));
// add the replace-version-2.bpmn process and start its instance
kbase.addKnowledgePackages(getProcessPackages("replace-version-2.bpmn"));
ksession.startProcess("com.sample.process", Collections.<String, Object>singletonMap("name", "process2"));
// signal all processes in the session to continue (both instances finish)
ksession.signalEvent("continue", null);
} finally {
ksession.dispose();
}5.1.3.2. Process instance migration
5.1.3.3. Migrating a Process instance
Example 5.4. Process transfer with custom active Element mapping
import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.api.runtime.process.WorkflowProcessInstance;
// build kbase with the replace-version-1.bpmn process
KieBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(getProcessPackages("replace-version-1.bpmn"));
KieSession ksession = kbase.newStatefulKnowledgeSession();
try {
// start two instances of the replace-version-1.bpmn process
ProcessInstance pi = ksession.startProcess("com.sample.process", Collections.<String, Object>singletonMap("name", "process1"));
ProcessInstance pi2 = ksession.startProcess("com.sample.process", Collections.<String, Object>singletonMap("name", "process2"));
// add the replace-version-3.bpmn process to the kbase and start its instance
kbase.addKnowledgePackages(getProcessPackages("replace-version-3.bpmn"));
ksession.startProcess("com.sample.process2", Collections.<String, Object>singletonMap("name", "process3"));
// upgrade: active nodes from the replace-version-1.bpmn process are mapped to the same nodes in the process
WorkflowProcessInstanceUpgrader.upgradeProcessInstance(ksession, pi.getId(), "com.sample.process2", null);
// upgrade the process using custom mapping
Map<String, Long> mapping = new HashMap<String, Long>();
mapping.put("3", 8L);
mapping.put("2", 7L);
WorkflowProcessInstanceUpgrader.upgradeProcessInstance(ksession, pi2.getId(), "com.sample.process2", mapping);
ksession.fireAllRules();
// signal all processes they may continue (all of them finish)
ksession.signalEvent("continue", null);
} finally {
ksession.dispose();
}
5.1.4. Multi-threading
5.1.4.1. Asynchronous execution
executeWorkItem() method in the work item handler that allows the Process instance to continue its execution.
Example 5.5. Example of asynchronous service handling in Java
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.WorkItemManager;
public class MyServiceTaskHandler implements WorkItemHandler {
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
new Thread(new Runnable() {
public void run() {
// The main thread with the parent element execution
}
}).start();
}
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
}
}
The Red Hat JBoss BPM Suite Job Executor
Command object.
WorkItemHandler and use the JBoss BPM Suite Job Executor to handle these operations for you.
execute() that accepts the CommandContext data transfer object with serializable data. The Command instance should only contain the business logic to be executed and have no reference to the underlying process engine or runtime related data. At the minimum, the CommandContext should provide the businessKey - the unique identifier of the caller and callback - the fully qualified classname (FQCN) of the CommandCallback instance to be called on command completion. Of course, when executed as part of a process (WorkItemHandler), you will need to provide additional data like the workItem, processInstanceId and deploymentId.
ExecutionResults class. As with the input data, the data provided by this class must also be serializable.
The Asynchronous WorkItemHandler
WorkItemHandler that is backed by the JBoss BPM Suite Job Executor. All the features that the JBoss BPM Suite Executor delivers are available for background execution within a process instance. There are two ways to configure this AsyncWorkItemHandler class:
- As a generic handler where you provide the command name as part of the work item parameters. In Business Central while modeling a process, if you need to execute some work item asynchronously: specify
asyncas the value for the TaskName property, create a data input calledCommandClassand assign the FQCN of thisCommandClassas the data input. - As a specific handler which is created to handle a given type of work item, thus allowing you to register different instances of
AsyncWorkItemHandlerfor different work items. Commands are most likely to be dedicated to a particular work item, which allows you to specify theCommandClassat registration time instead of requiring it at design time, as with the first approach. But this means that an additional CDI bean that implements WorkItemHandlerProducer interface needs to be provided and placed on the application classpath so that the CDI container can find it. When you are ready to model your process, set the value of the TaskName property to the one provided at registration time.
Configuring the JBoss BPM Suite Executor
- org.kie.executor.disabled: true OR false - enable/disable the executor.
- org.kie.executor.pool.size: Integer. Specify the thread pool size for the executor, which by default is 1.
- org.kie.executor.retry.count: Integer. Specifies the default number of retries in case of an error executing a job. The default value is 3.
- org.kie.executor.interval: Integer. Specifies the time to wait between checking for waiting jobs. The default value is 3 seconds.
- org.kie.executor.timeunit: NANOSECONDS OR MICROSECONDS OR MILLISECONDS OR SECONDS OR MINUTES OR HOURS OR DAYS. Specifies the unit for the interval property. The default is SECONDS.
5.1.4.2. Multiple Sessions and persistence
- Thread A has a lock on the ProcessInstanceInfo table, having just committed a change to that table.
- Thread A wants a lock on the SessionInfo table in order to commit a change.
- Thread B has the opposite situation: It has a lock on the SessionInfo table, having just committed a change.
- Thread B wants a lock on the ProcessInstanceInfo table, even though Thread A already has a lock on it.
5.1.4.3. Asynchronous Events
- Throwing Intermediate Signal Events
- End Events
5.1.5. Technical exceptions
- Code present directly in the process definition
- Code that is not part of the product executed during a Process
- Code that interacts with a technical component outside of the Process Engine
- Code in Element properties, such as the Script property of a
Script Taskelement or in the definitions of the interception actions, that is, theonEntryandonExitproperties - Code in
WorkItemHandlersassociated withtaskand task-type nodes
Code in Element properties
onEntry and onExit properties, Script defined for the Script Task, etc.
scriptTask to interact with a different technical component, such as a database or web service has significant risks because any exceptions thrown will corrupt or abort the Process instance.
task Elements, serviceTask Elements and other task-type Elements. Do not use the scriptTask nodes for these purposes.
Note
scriptTask causes the problem, the Process Engine usually throws the WorkflowRuntimeException with information on the Process (refer to Section 5.1.5.1.5, “Extracting information from WorkflowRuntimeException”).
Code in WorkItemHandlers
handler decorator classes (for examples and detailed information refer to Section 5.1.5.1.2, “Exception handling classes”). These classes include the logic that is executed when an exception is thrown during the execution or abortion of a work item:
- SignallingTaskHandlerDecorator
- catches the exception and signals it to the Process instance using a configurable event type when the
executeWorkItem()orabortWorkItemmethods of the originalWorkItemHandlerinstance throw an exception. The exception thrown is passed as part of the event. This functionality can be also used to signal to an Event SubProcess defined in the Process definition. - LoggingTaskHandlerDecorator
- logs error about any exceptions thrown by the
executeWorkItem()andabortWorkItem()methods. It also saves any exceptions thrown to an internal list so that they can be retrieved later for inspection or further logging. The content and format of the message logged are configurable.
- Does the implementation catch all exceptions the code could return?
- Does the implementation complete or abort the work item after an exception has been caught or uses a mechanisms to retry the process later (in some cases, incomplete process instances might be acceptable)?
- Does the implementation define any other actions that need to be taken when an exception is caught? Would it be beneficial to interact with other technical systems? Should a Sub-Process be triggered to handle the exception?
Important
5.1.5.1. Technical exception examples
5.1.5.1.1. Service Task handlers
- Execution of the Process instance stops: no other parts of the Process are executed.
- The Process instance finishes as ABORTED.

Figure 5.1. Process with an exception handling Event Sub-Process
Parts of the BPMN2 definition of the example Process relevant for exception handling
<itemDefinition id="_stringItem" structureRef="java.lang.String"/><message id="_message" itemRef="_stringItem"/>
<interface id="_serviceInterface" name="org.jbpm.examples.exceptions.service.ExceptionService"> <operation id="_serviceOperation" name="throwException"> <inMessageRef>_message</inMessageRef>
</operation> </interface> <error id="_exception" errorCode="code" structureRef="_exceptionItem"/>
<itemDefinition id="_exceptionItem" structureRef="org.kie.api.runtime.process.WorkItem"/>
<message id="_exceptionMessage" itemRef="_exceptionItem"/>
<interface id="_handlingServiceInterface" name="org.jbpm.examples.exceptions.service.ExceptionService"> <operation id="_handlingServiceOperation" name="handleException"> <inMessageRef>_exceptionMessage</inMessageRef>
</operation> </interface> <process id="ProcessWithExceptionHandlingError" name="Service Process" isExecutable="true" processType="Private"> <!-- properties --> <property id="serviceInputItem" itemSubjectRef="_stringItem"/>
<property id="exceptionInputItem" itemSubjectRef="_exceptionItem"/>
<!-- main process --> <startEvent id="_1" name="Start" /> <serviceTask id="_2" name="Throw Exception" implementation="Other" operationRef="_serviceOperation"> <!-- rest of the serviceTask element and process definition... --> <subProcess id="_X" name="Exception Handler" triggeredByEvent="true" > <startEvent id="_X-1" name="subStart"> <dataOutput id="_X-1_Output" name="event"/> <dataOutputAssociation> <sourceRef>_X-1_Output</sourceRef> <targetRef>exceptionInputItem</targetRef>
</dataOutputAssociation> <errorEventDefinition id="_X-1_ED_1" errorRef="_exception" />
</startEvent> <!-- rest of the subprocess definition... --> </subProcess> </process>
|
The itemDefinition element defines a data structure used in the serviceInputItem property of the Process.
|
|
The message element (1st reference) defines a message that contains the String defined by the itemDefinition element on the line above. The interface element below then refers to the itemDefinition element (2nd reference) in order to define what type of content the service (defined by the interface) expects.
|
|
The error element (1st reference) defines an error that is used to trigger the Event SubProcess of the Process. The content of the error is defined by the itemDefintion element defined below the error element.
|
|
This itemDefinition element (1st reference) defines an item that contains a WorkItem instance. The message element (2nd reference) then defines a message that uses this item definition to define its content. The interface element below that refers to the message definition (3rd reference) in order to define the type of content that the service expects.
In the Process element itself, a property element (4th reference) that contains the initial itemDefinition. This allows the Event SubProcess to store the error it receives in that property (5th reference).
|
5.1.5.1.2. Exception handling classes
serviceTask tasks use the org.jbpm.bpmn2.handler.ServiceTaskHandler class as its task handler class unless the serviceTask defines a custom WorkItemHandler implementation.
SignallingTaskHandlerDecorator instance.
Important
- Error events are signaled by sending an
Error-errorCode attribute valuevalue to the session. - Signal events are signaled by sending the name of the signal to the session.
- If you wanted to send an error event to a Boundary Catch Error Event, the error type should be of the format:
"Error-" + $AttachedNodeID + "-" + $ERROR_CODE. For example,Error-SubProcess_1-888would be a valid error type.However, this is NOT a recommended practice because sending the signal this way bypasses parts of the boundary error event functionality and it relies on internal implementation details that might be changed in the future. For a way to programmatically trigger a boundary error event when an Exception is thrown inWorkItemHandlersee this KnowledgeBase article.
Example 5.6. Using SignallingTaskHandlerDecorator
ServiceTaskHandler calls the ExceptionService.throwException() method to throw an exception (refer to the _handlingServiceInterface interface element in the BPMN2).
SignallingTaskHandlerDecorator that wraps the ServiceTaskHandler sends to the Process instance the error with the set error code.
import java.util.HashMap;
import java.util.Map;
import org.jbpm.bpmn2.handler.ServiceTaskHandler;
import org.jbpm.bpmn2.handler.SignallingTaskHandlerDecorator;
import org.jbpm.examples.exceptions.service.ExceptionService;
import org.kie.api.KieBase;
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.builder.KnowledgeBuilderFactory;
import org.kie.internal.io.ResourceFactory;
public class ExceptionHandlingErrorExample {
public static final void main(String[] args) {
runExample();
}
public static ProcessInstance runExample() {
KieSession ksession = createKieSession();
String eventType = "Error-code";
SignallingTaskHandlerDecorator signallingTaskWrapper
= new SignallingTaskHandlerDecorator(ServiceTaskHandler.class, eventType);
signallingTaskWrapper.setWorkItemExceptionParameterName(ExceptionService.exceptionParameterName);
ksession.getWorkItemManager().registerWorkItemHandler("Service Task", signallingTaskWrapper);
Map<String, Object> params = new HashMap<String, Object>();
params.put("serviceInputItem", "Input to Original Service");
ProcessInstance processInstance = ksession.startProcess("ProcessWithExceptionHandlingError", params);
return processInstance;
}
private static KieSession createKieSession() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("exceptions/ExceptionHandlingWithError.bpmn2"), ResourceType.BPMN2);
KieBase kbase = kbuilder.newKnowledgeBase();
return kbase.newKieSession();
}
|
Definition of the Error-code event to be sent to the process instance when the wrapped WorkItemHandler implementation throws an exception
|
|
Construction of the SignallingTaskHandlerDecorator class instance with the WorkItemHandler implementation and eventType as parameters
Note that a SignallingTaskHandlerDecorator class constructor that takes an instance of a WorkItemHandler implementation as its parameter is also available. This constructor is useful if the WorkItemHandler implementation does not allow a no-argument constructor.
|
|
Registering the WorItemHandler with the session
When an exception is thrown by the wrapped WorkItemHandler, the SignallingTaskHandlerDecorator saves it as a parameter in the WorkItem instance with a parameter name configured in the SignallingTaskHandlerDecorator (see the code below for the ExceptionService).
|
5.1.5.1.3. Exception service
ExceptionService class as follows:
<interface id="_handlingServiceInterface" name="org.jbpm.examples.exceptions.service.ExceptionService"> <operation id="_handlingServiceOperation" name="handleException">
ExceptionService class to provide the exception handling abilities. The class is implemented as follows:
import org.kie.api.runtime.process.WorkItem;
...
public class ExceptionService {
public static String exceptionParameterName = "my.exception.parameter.name";
public void handleException(WorkItem workItem) {
System.out.println( "Handling exception caused by work item '" + workItem.getName() + "' (id: " + workItem.getId() + ")");
Map<String, Object> params = workItem.getParameters();
Throwable throwable = (Throwable) params.get(exceptionParameterName);
throwable.printStackTrace();
}
public String throwException(String message) {
throw new RuntimeException("Service failed with input: " + message );
}
public static void setExceptionParameterName(String exceptionParam) {
exceptionParameterName = exceptionParam;
}
}serviceTask.
5.1.5.1.4. Handling errors with Signals
Error event occurs during Process execution and the execution is interrupted immediately: no other Flows or Activities are executed.
Signal event as the Process execution continues after the Signal is processed (that is, after the Signal Event SubProcess or another Activities that the Signal triggered, finish their execution). Also, the Process execution finished successfully, not in an aborted state, which is the case if an Error is used.
error element which is then used to throw the Error:
<error id="_exception" errorCode="code" structureRef="_exceptionItem"/>
- Remove the line defining the
errorelement and define a<signal>element:<signal id="exception-signal" structureRef="_exceptionItem"/>
- Make sure to change all references from the "
_exception"<error>to the "exception-signal"<signal>.Change the<errorEventDefinition>element in the<startEvent>,<errorEventDefinition id="_X-1_ED_1" errorRef="_exception" />
to a<signalEventDefinition>:<signalEventDefinition id="_X-1_ED_1" signalRef="exception-signal"/>
5.1.5.1.5. Extracting information from WorkflowRuntimeException
scriptTask element that causes an exception, you can extract the information from the WorkflowRuntimeException as it is the wrapper of the scriptTask.
WorkflowRuntimeException instance stores the information outlined in Table 5.1, “Information in WorkflowRuntimeException instances”. Values of all fields listed can be obtained using the standard get* methods.
Table 5.1. Information in WorkflowRuntimeException instances
| Field name | Type | Description |
|---|---|---|
processInstanceId | long |
The id of the
ProcessInstance instance in which the exception occurred
Note that the
ProcessInstance may not exist anymore or be available in the database if using persistence.
|
processId | String | The id of the process definition that was used to start the process (that is, "ExceptionScriptTask" in
ksession.startProcess("ExceptionScriptTask");
) |
nodeId | long | The value of the (BPMN2) id attribute of the node that threw the exception |
nodeName | String | The value of the (BPMN2) name attribute of the node that threw the exception |
variables | Map<String, Object> | The map containing the variables in the process instance (experimental) |
message | String | The short message with information on the exception |
cause | Throwable | The original exception that was thrown |
WorkflowRuntimeException exception instance.
import org.jbpm.workflow.instance.WorkflowRuntimeException;
import org.kie.api.KieBase;
import org.kie.api.io.ResourceType;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie.internal.builder.KnowledgeBuilder;
import org.kie.internal.builder.KnowledgeBuilderFactory;
import org.kie.internal.io.ResourceFactory;
public class ScriptTaskExceptionExample {
public static final void main(String[] args) {
runExample();
}
public static void runExample() {
KieSession ksession = createKieSession();
Map<String, Object> params = new HashMap<String, Object>();
String varName = "var1";
params.put( varName , "valueOne" );
try {
ProcessInstance processInstance = ksession.startProcess("ExceptionScriptTask", params);
} catch( WorkflowRuntimeException wfre ) {
String msg = "An exception happened in "
+ "process instance [" + wfre.getProcessInstanceId()
+ "] of process [" + wfre.getProcessId()
+ "] in node [id: " + wfre.getNodeId()
+ ", name: " + wfre.getNodeName()
+ "] and variable " + varName + " had the value [" + wfre.getVariables().get(varName)
+ "]";
System.out.println(msg);
}
}
private static KieSession createKieSession() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("exceptions/ScriptTaskException.bpmn2"), ResourceType.BPMN2);
KieBase kbase = kbuilder.newKnowledgeBase();
return kbase.newKieSession();
}
}5.2. Workflow patterns
$JBOSS_HOME/standalone/deployments/business-central.war/org.kie.workbench.KIEWebapp/defaults/patterns.json file.
5.2.1. Defining workflow patterns
- In the stencil set of the Process Designer, locate the workflow pattern that resembles most to and that will use as base for your workflow pattern.
- Open the
$JBOSS_HOME/standalone/deployments/business-central.war/org.kie.workbench.KIEWebapp/defaults /patterns.jsonfile in a text editor. - Locate the JSON object with the description property set to the base workflow pattern name (for example,
"description" : "Sequence Pattern"). - Copy the JSON object and modify its elements as needed. Note that all the JSON objects are nested in a pair of square brackets and are comma separated.
Chapter 6. Social Events
Follow User
Activity Timeline
Part II. Simulation and testing
Chapter 7. Process simulation
7.1. Path Finder
) button and click Process Paths.
Note

Figure 7.1. Process Paths
7.2. Simulating a Process
7.2.1. Defining Simulation details on Elements
7.2.2. Running a Simulation
- Open the Process in the Process Designer and make sure you have defined the simulation parameters for individual Elements.

Figure 7.2. Simulation Properties
- Click the (
) icon in the toolbar and then click the Run Simulation entry.
- In the Run Process Simulation dialog window, define the simulation session details:

Figure 7.3. Run Process Simulation properties dialog window
- Number of instance: number of Process instances to be created and triggered
- Interval: interval between individual Process instantiations
- Interval units: time of unit the Interval is defined in
- Click .
7.2.3. Examining Simulation results
- The Process section with general Process simulation graphs
- The Activities section with individual Activities' simulation graphsActivities graphs for Human Tasks include Execution Time with the Max, Min, and Average execution time for the given Activity, Resource Utilization for the hours a resource has been used, and the Cost Parameters graph if applicable (if you defined the Cost parameter for the Activity). For Script Tasks only the Execution Time with the Max, Min, and Avarage execution time, is available.
- The Paths section with simulation graph of the Paths taken during the simulation.The graphs contain the Process model with the respective Path highlighted and execution statistics on the Path.
Graph types

Figure 7.4. Simulation Graph types
Filters

Figure 7.5. Graph item radiobutton
Timeline
in the upper right corner of the respective graph: The timeline depicting individual events is displayed in the lower part of the canvas. Click the arrows on the right and left from the chart to move through the timeline. The data current for the particular moment are applied to the chart depicted above instantly.

Figure 7.6. Process Simulation Timeline

Figure 7.7. Line Chart
Chapter 8. Testing
8.1. Unit testing
- helper methods to create a new kie base and session for given processes (Also, you can select if persistence is to be used.)
- assert statements to check among other also the following:
- the state of a process instance (active, completed, aborted)
- which node instances are currently active
- which nodes have been triggered to check the path that has been followed
- the value of variables
Example 8.1. JUnit test of the com.sample.bpmn.hello Process
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.process.ProcessInstance;
public class MyProcessTest extends org.jbpm.test.JbpmJUnitBaseTestCase {
public void testProcess() {
// create singleton runtime manager and load the given process(es)
createRuntimeManager("sample.bpmn");
// get the single kie session
RuntimeEngine engine = getRuntimeEngine();
KieSession ksession = engine.getKieSession();
// start the process
ProcessInstance processInstance =
ksession.startProcess("com.sample.bpmn.hello");
// check whether the process instance has completed successfully
assertProcessInstanceCompleted(processInstance.getId(), ksession);
// check whether the given nodes were executed during the process execution
assertNodeTriggered(processInstance.getId(), "StartProcess", "Hello", "EndProcess");
}
}8.2. Session creation
createRuntimeManager(String... process)creates default configuration of the RuntimeManager with singleton strategy and all processes added to the kie base. There will only be one RuntimeManager created during single test and the processes shall be added to the kie base.createRuntimeManager(Strategy strategy, String identifier, String... process)creates default configuration of RuntimeManager with given strategy and all processes being added to the kie base.Strategyselects the strategies that are supported, andidentifieridentifies the RuntimeManager.createRuntimeManager(Map<String, ResourceType> resources)creates default configuration of RuntimeManager with singleton strategy and all resources being added to kie base. Theresourcescode identifies the processes, rules, etc that shall be added to the kie base.createRuntimeManager(Map<String, ResourceType> resources, String identifier)creates default configuration of RuntimeManager with singleton strategy and all resources added to kie base. Like the method above but with anidentifierthat identifies the RuntimeManager.createRuntimeManager(Strategy strategy, Map<String, ResourceType> resources)creates default configuration of RuntimeManager with given strategy and all resources being added to the kie base. There will be only one RuntimeManager created during single test. Thestrategycode is the selected strategy of those that are supported. Theresourcescode are all the resources that shall be added to the kie base.createRuntimeManager(Strategy strategy, Map<String, ResourceType> resources, String identifier)creates default configuration of RuntimeManager with given strategy and all resources being added to kie base. There will be only one RuntimeManager created during single test. Thestrategycode selects the supported strategies. Theresourcescode identifies the resources that shall be added to the kie base. Theidentifiercode identifies the RuntimeManger.createRuntimeManager(Strategy strategy, Map<String, ResourceType< resources, RuntimeEnvironment environment, String identifier)is the lowest level of creation of RuntimeManager that expects to get RuntimeEnvironment to be given as an argument. It does not assume any particular configuration; that is, it allows you to configure every single piece of RuntimeManager manually. Thestrategycode selects the strategies of those that are supported. Theresourcescode identifies the resources added to the kie base. Theenvironmentcode is the runtime environment used for RuntimeManager creation. Theidentifiercode identifies the RuntimeManager.
getRuntimeEngine()returns a new RuntimeEngline built from the manager of the test case. It uses EmptyContext that is suitable for the following strategies: singleton and request.getRuntimeEngine(Context<?> context)returns a new RuntimeEngine built from the manager of the test case. Common use case would be to maintain the same session for the process instance and thus a ProcessInstanceIdContext shall be used. Thecontextcode is the instance of the context that shall be used to create RuntimeManager.
8.2.1. Assertions
- assertProcessInstanceActive(long processInstanceId, KieSession ksession): checks whether the Process instance with the given id is active.
- assertProcessInstanceCompleted(long processInstanceId, KieSession ksession): checks whether the Process instance with the given id has completed. successfully
- assertProcessInstanceAborted(long processInstanceId, KieSession ksession): checks whether the Process instance with the given id was aborted.
- assertNodeActive(long processInstanceId, KieSession ksession, String... name): checks whether the process instance with the given id contains at least one active node with the given node names.
- assertNodeTriggered(long processInstanceId, String... nodeNames): checks for each given node name whether a node instance was triggered during the execution of the Process instance.
- getVariableValue(String name, long processInstanceId, KieSession ksession): retrieves the value of the variable with the given name from the given Process instance.
8.2.2. Integration with external services
Example 8.2. Testing an Email Task
import org.kie.api.runtime.manager.RuntimeManager;
import org.kie.api.runtime.manager.RuntimeEngine;
import org.kie.api.runtime.KieSesssion;
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemHandler;
import org.kie.api.runtime.process.ProcessInstance;
import org.kie,api.runtime.process.WorkItemManger;
public void testProcess2() {
// create runtime manager with single process - hello.bpmn
createRuntimeManager("sample-process.bpmn");
// take RuntimeManager to work with process engine
RuntimeEngine runtimeEngine = getRuntimeEngine();
// get access to KieSession instance
KieSession ksession = runtimeEngine.getKieSession();
// register a test handler for "Email"
TestWorkItemHandler testHandler = getTestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Email", testHandler);
// start the process
ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello2");
assertProcessInstanceActive(processInstance.getId(), ksession);
assertNodeTriggered(processInstance.getId(), "StartProcess", "Email");
// check whether the email has been requested
WorkItem workItem = testHandler.getWorkItem();
assertNotNull(workItem);
assertEquals("Email", workItem.getName());
assertEquals("me@mail.com", workItem.getParameter("From"));
assertEquals("you@mail.com", workItem.getParameter("To"));
// notify the engine the email has been sent
ksession.getWorkItemManager().abortWorkItem(workItem.getId());
assertProcessInstanceAborted(processInstance.getId(), ksession);
assertNodeTriggered(processInstance.getId(), "Gateway", "Failed", "Error");
}
The test case uses a test handler that registers when an email is requested and allows you to test the data related to the email. Once the engine has been notified the email could not be sent by the abortWorkItem(..) method call, the unit test verifies that the Process handles this case by logging the fact and terminating with an error.

Figure 8.1. Process with a custom Email Service Task
8.2.3. Persistence
JbpmJUnitBaseTestCase in the jbpm-test module that greatly simplifies your junit testing. This helper class provides methods to create a new RuntimeManager and RuntimeEngine for a given process or set of processes. By default, persistence is not used, and it is controlled by the super constructor. The helper method allows you to select whether or not you wish to use persistence. The example below shows a helper class to allow persistence:
Example 8.3.
public class ProcessHumanTaskTest extends JbpmJUnitBaseTestCase {
public ProcessPersistenceTest() {
// setup data source, enable persistence
super(true, true);
}
....Chapter 9. The Intelligent Process Server
9.1. Deploying the Intelligent Process Server
kie-server.war. When you install JBoss BPM Suite, this WAR file is installed and deployed in your web container by default. Consequently, this gives you automatic access to this web application with the URL of http://SERVER:PORT/kie-server/.
- Once you have deployed the WAR file (or if you have it deployed on the same web container where JBoss BRMS is deployed), create a user with the role of kie-server in this web container.
- Test that you can access the decision engine by navigating to the endpoint in a browser window:
http://SERVER:PORT/kie-server/services/rest/server/with the web container running. You will be prompted for your username/password that you created in the previous step. - Once authenticated, you will see an XML response in the form of engine status, similar to this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response type="SUCCESS" msg="Kie Server info"> <kie-server-info> <capabilities>BPM</capabilities> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <location>http://localhost:8230/kie-server/services/rest/server</location> <name>KieServer@/kie-server</name> <id>15ad5bfa-7532-3eea-940a-abbbbc89f1e8</id> <version>6.3.0.Final-redhat-5</version> </kie-server-info> </response>
9.2. Installing the Intelligent Process Server in Other Containers
9.2.1. JBoss Web Server 2.x/3.x, Tomcat 7.x/8.x
Procedure 9.1.
- Download and unzip the Tomcat distribution.
- Download
kie-server-6.3.0.Final-webc.warand place it intoTOMCAT_HOME/webapps. - Configure user(s) and role(s). Make sure that
TOMCAT_HOME/conf/tomcat-users.xmlcontains the following username and role definition. The username and password should be unique, however ensure that the user has the rolekie-server:<role rolename="kie-server"/> <user username="serveruser" password="my.s3cr3t.pass" roles="kie-server"/>
- Start the server by running
TOMCAT_HOME/bin/startup.[sh|bat]. You can check out the Tomcat logs inTOMCAT_HOME/logsto see if the application deployed successfully. See Section 9.3.1, “Bootstrap Switches” for the bootstrap switches that can be used to properly configure the instance. For instance:$ ./startup.sh -Dorg.kie.server.id=first-kie-server -Dorg.kie.server.location=http://localhost:8080/kie-server/services/rest/server - Verify the server is running. Access
http://SERVER:PORT/kie-server/services/rest/server/and type the specified username and password. You should see simple XML message with basic information about the server.
Important
9.3. Intelligent Process Server Setup
9.3.1. Bootstrap Switches
Table 9.1. Intelligent Process Server Bootstrap Switches
| Property | Value | Description | Required |
|---|---|---|---|
| org.drools.server.ext.disabled | boolean (default is "false") | If true, disables the BRM support (i.e. rules support). | No |
| org.jbpm.server.ext.disabled | boolean (default is "false") | If true, disables the BPM support (i.e. processes support) | No |
| org.kie.server.id | string | An arbitrary ID to be assigned to this server. If a remote controller is configured, this is the ID under which the server will connect to the controller to fetch the kie container configurations. | No. If not provided, an ID is automatically generated. |
| org.kie.server.user | string (default is "kieserver") | User name used to connect with the kieserver from the controller, required when running in managed mode | Yes when using a controller. This property needs to be set in Business Central system properties. |
| org.kie.server.pwd | string (default is "kieserver1!") | Password used to connect with the kieserver from the controller, required when running in managed mode | Yes when using a controller. This property needs to be set in Business Central system properties. |
| org.kie.server.controller | comma separated list of urls | List of urls to controller REST endpoint. E.g.: http://localhost:8080/kie-wb/rest/controller | Yes when using a controller |
| org.kie.server.controller.user | string (default is "kieserver") | Username used to connect to the controller REST api | Yes when using a controller |
| org.kie.server.controller.pwd | string (default is "kieserver1!") | Password used to connect to the controller REST api | Yes when using a controller |
| org.kie.server.location | URL location of Intelligent Process Server instance | The URL used by the controller to call back on this server. E.g.: http://localhost:8230/kie-server/services/rest/server | Yes when using a controller |
| org.kie.server.domain | string | JAAS LoginContext domain that shall be used to authenticate users when using JMS | No |
| org.kie.server.bypass.auth.user | boolean (default is "false") | Allows to bypass the authenticated user for task related operations e.g. queries | No |
| org.kie.server.repo | valid file system path (default is ".") | Location on local file system where Intelligent Process Server state files will be stored | No |
| org.kie.server.persistence.ds | string | DataSource JNDI name | Yes when BPM support enabled |
| org.kie.server.persistence.tm | string | Transaction manager platform for Hibernate properties set | Yes when BPM support enabled |
| org.kie.server.persistence.dialect | string | Hibernate dialect to be used | Yes when BPM support enabled |
| org.jbpm.ht.callback | string | One of supported callbacks for Task Service (default jaas) | No |
| org.jbpm.ht.custom.callback | string | Custom implementation of UserGroupCallback in case org.jbpm.ht.callback was set to ‘custom’ | No |
| kie.maven.settings.custom | valid file system path | Location of custom settings.xml for maven configuration | No |
| org.kie.executor.interval | integer (default is 3) | Number of time units between polls by executor | No |
| org.kie.executor.pool.size | integer (default is 1) | Number of threads in the pool for async work | No |
| org.kie.executor.retry.count | integer (default is 3) | Number of retries to handle errors | No |
| org.kie.executor.timeunit | TimeUnit (default is "SECONDS") | TimeUnit representing interval | No |
| org.kie.executor.disabled | boolean (default is "false") | Disables executor completely | No |
| kie.server.jms.queues.response | string (default is "queue/KIE.SERVER.RESPONSE") | JNDI name of response queue for JMS | No |
| org.kie.server.controller.connect | long (default is 10000) | Waiting time in milliseconds between repeated attempts to connect Intelligent Process Server to controller when Intelligent Process Server starts up | No |
| org.drools.server.filter.classes | boolean (default is "false") | If set to true then Drools Intelligent Process Server extension accepts custom classes being annotated by XmlRootElement or Remotable annotations only. | No |
Important
org.kie.server.persistence.ds property), in order to avoid conflicts.
9.3.2. Managed Intelligent Process Server
Important
Note
9.3.3. Registering a Intelligent Process Server
standalone.xml:
<property name="org.kie.server.user" value="anton"></property> <property name="org.kie.server.pwd" value="password1!"></property> <property name="org.kie.server.location" value="http://localhost:8080/kie-server/services/rest/server"></property> <property name="org.kie.server.controller" value="http://localhost:8080/business-central/rest/controller"></property> <property name="org.kie.server.controller.user" value="kieserver"></property> <property name="org.kie.server.controller.pwd" value="kieserver1!"></property> <property name="org.kie.server.id" value="local-server-123"></property>
standalone.xml file is located in the $SERVER_HOME/standalone/configuration/ directory.
org.kie.server.user must have the kie-server role assigned.
Note
org.kie.server.controller.user and org.kie.server.controller.pwd must be set to kieserver and kieserver1! respectively due to a known issue in the 6.2.0 release.
Warning
org.kie.server.location points to the same host as org.kie.server.controller. This is not suitable for production.
kieserver user:
- Change into
$SERVER_HOME/bin/. - Execute the following command:
$ ./add-user.sh -a --user kieserver --password kieserver1! --role kie-server
http://SERVER:PORT/kie-server/services/rest/server/. Once authenticated, you will see the following XML response:
<response type="SUCCESS" msg="Kie Server info"> <kie-server-info> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <capabilities>BPM</capabilities> <location> http://localhost:8080/kie-server/services/rest/server </location> <name>local-server-123</name> <id>local-server-123</id> <version>6.3.0.Final-redhat-5</version> </kie-server-info> </response>
9.3.4. Unmanaged Intelligent Process Server
- Deploy KIE Container
- Undeploy KIE Container
- Start KIE Container
- Stop KIE Container
Note
9.4. Creating a Container
icon next to the Intelligent Process Server. This will bring up the Create Container... dialogue.

9.5. Managing Containers
Starting a Container
to select the Container, then click . You can select multiple Containers and start them all at the same time.
appears next to it.
appears next to Container(s) and the Intelligent Process Server that they are deployed on. For troubleshooting, check the logs of both the Intelligent Process Server and the Business Central before redeploying the Containers.
Stopping and Deleting a Container
to select the running Container(s) and or .
Updating Container Deployments
next to the Container. This opens up the Container Info screen:

- Manual Update: To manually update a provision, enter the new Version number in the Version box and click . You can update the Group Id or the Artifact Id, if these have changed as well.
- Automatic Update: If you want a deployed Container to always have the latest version of your deployment without manually editing it, you need to set the Version property to the value of
LATESTand start a Scanner. This will ensure that the deployed provision always contains the latest version. The Scanner can be started on demand by clicking or you can start it in the background with scans happening at a specified interval (in seconds).You can also set this value toLATESTwhen you are first creating this deployment.The Resolved Release Id will show you the actual, latest version number. Note that if the Resolved Release Id is empty, this is an issue not influencing the functionality of the upgrade feature.
9.6. The REST API for Intelligent Process Server Execution
- The base URL for sending requests is the endpoint defined earlier (http://SERVER:PORT/kie-server/services/rest/server/).
- All requests require basic HTTP Authentication for the role kie-server.
- Accept: application/json or application/xml
- Content-Type: application/json or application/xml
X-KIE-ContentType: has three possible values - JSON, JAXB, or XSTREAM. Set it according to the format of your request to the server.
-u: specifies username:password for the Intelligent Process Server authentication.-H: specifies HTTP headers.-X: specifies the HTTP method of the request, that is [GET], [POST], [PUT], or [DELETE].
Note
9.6.1. BRMS Commands
Table 9.2. BRMS Commands Endpoints
| URI | Method | Request Type | Response Type | Description |
|---|---|---|---|---|
| /containers/instances/{containerID} | POST | A single org.drools.core.command.impl.GenericCommand command or multiples commands in BatchExecutionCommand wrapper. | org.kie.server.api.model.ServiceResponse<String> | Executes the commands sent to the specified containerId and returns the commands execution results. For more information, See supported commands below. |
AgendaGroupSetFocusCommandClearActivationGroupCommandClearAgendaCommandClearAgendaGroupCommandClearRuleFlowGroupCommandDeleteCommandInsertObjectCommandModifyCommandGetObjectCommandInsertElementsCommandFireAllRulesCommandQueryCommandSetGlobalCommandGetGlobalCommandGetObjectsCommandBatchExecutionCommand
org.drools.core.command.runtime package. Alternatively, see Supported JBoss BRMS Commands from the Red Hat JBoss Develompent Guide.
Example 9.1. [POST] Drools Commands Execution
- Change into a directory of your choice and create
commandsRequest.json:{ "lookup" : null, "commands" : [ { "insert" : { "object" : "testing", "disconnected" : false, "out-identifier" : null, "return-object" : true, "entry-point" : "DEFAULT" } }, { "fire-all-rules" : { } } ] } - Execute the following command:
$ curl -X POST -H 'X-KIE-ContentType: JSON' -H 'Content-type: application/json' -u 'kieserver:kieserver1!' --data @commandsRequest.json http://localhost:8080/kie-server/services/rest/server/containers/instances/myContainer
The command generates a request that sends the Insert Object and Fire All Rules commands to the server.Lookupspecifies a ksession configured in your kjar. If you use a null lookup value, the default KIE session will be used.
{
"type" : "SUCCESS",
"msg" : "Container hello successfully called.",
"result" : "{\n \"results\" : [ ],\n \"facts\" : [ ]\n}"
}
9.6.2. Managing Processes
Table 9.3. Process Management Endpoints
| URI | Method | Request Type | Response Type | Description |
|---|---|---|---|---|
| /instances | DELETE | N/A | N/A | Aborts multiple process instances specified by the query parameter instanceId. |
| /instances/{processInstanceId}/signals | GET | N/A | A list of Strings | Returns all the available signal names for processInstanceId as a list of Strings |
| /instances/{processInstanceId}/variable/{varName} | PUT | The variable marshalled value | N/A | Sets the value of variable varName for process instance processInstanceId. If successful, the return value is HTTP code 201. |
| /instances/{processInstanceId}/variable/{varName} | GET | N/A | The variable value | Returns the marshalled value of varName for processInstanceId. |
| /instances/{processInstanceId}/variables | POST | A map with variable names and values | N/A | Sets multiple processInstanceId variables. The request is a map, in which the key is the name of the variable and the value is the new value of the variable. |
| /instances/{processInstanceId}/variables | GET | N/A | A map with the variable names and values | Gets all variables for processInstanceId as a map, in which the key is the name of the variable and the value is the value of the variable |
| /instances/{processInstanceId}/workitems/ | GET | N/A | A list of WorkItemInstance objects | Gets all the work items of the given processInstanceId. |
| /instances/{processInstanceId}/workitems/{workItemId} | GET | N/A | A WorkItemInstance object | Gets the workItemId work item of the given processInstanceId. |
| /instances/{processInstanceId}/workitems/{workItemId}/aborted | PUT | N/A | N/A | Aborts the workItemId work item of the given processInstanceId. If successful, the return value is HTTP code 201. |
| /instances/{processInstanceId}/workitems/{workItemId}/completed | PUT | N/A | N/A | Completes the workItemId work item of the given processInstanceId. If successful, the return value is HTTP code 201. |
| /{processId}/instances | POST | A map with variables used to start the process. | Plain text with the process instance id. | Creates a business process instance specified by processId. Accepted input is a map with the process variables and its values. |
| instances/signal/{signalName} | POST | A marshalled object | N/A | Signals multiple process instances of a query parameter instanceId with signal signalName. You can provide the signal payload marshalled in the request body. |
| instances/{processInstanceId} | DELETE | N/A | N/A | Aborts a process specified by processInstanceId. If successful, the return value is HTTP code 204. |
| instances/{processInstanceId} | GET | N/A | A ProcessInstance object | Returns the details of processInstanceId. You can request variable information by setting the withVars parameter as true. |
| instances/{processInstanceId}/signal/{signalName} | POST | A marshalled object | N/A | Signals the process instance processInstanceId with signal signalName. You can provide the signal payload marshalled in the request body. |
| {processId}/instances/correlation/{correlationKey} | POST | A map with variables used to start the process. | Plain text with the process instance id. | Creates a business process instance specified by the processId with the correlation key correlationKey. Accepted input is a map with the process variables and its values. |
Example 9.2. Managing Processes
- Create
person.js:{ "p" : { "org.kieserver.test.Person": { "id" : 13, "name": "William" } }Start a process using a custom object (Person) as a parameter:$ curl -X POST -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data @person.js 'http://localhost:8080/kie-server/services/rest/server/containers/person/processes/proc-with-pojo.p-proc/instances'
- Create a new process instance of process definition
com.sample.rewards-basicwith parameters:$ curl -X POST -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data '{"employeeName": "William"}' 'http://localhost:8080/kie-server/services/rest/server/containers/rewards/processes/com.sample.rewards-basic/instances'Returns process instance ID. - Get the variables of process instance
3$ curl -u 'kieserver:kieserver1!' -H 'Accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/containers/rewards/processes/instances/3/variables'
Example response:{ "employeeName" : "William" } - Send a TEST signal to the process instance with ID
5$ curl -X POST -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data '"SIGNAL DATA"' 'http://localhost:8080/kie-server/services/rest/server/containers/test/processes/instances/signal/TEST?instanceId=5'
9.6.3. Managing Process Definitions
page and pageSize parameters.
Table 9.4. Process Queries Endpoints
| URI | Method | Request Type | Response Type | Description |
|---|---|---|---|---|
| / | GET | N/A | A list of ProcessDefinition objects | Returns a list of process definitions available for the container containerId |
| /{processId}/variables | GET | N/A | A VariablesDefinition object | Returns a map of the variable definitions for processId. The map contains the name of the variable and its type. |
| /{processId}/tasks/service | GET | N/A | A ServiceTaskDefinition object | Returns all service tasks for processId. The return value is a map with the names and types of the service tasks. If no tasks are found, the return value is an empty list. |
| /{processId}/tasks/users | GET | N/A | A list of UserTaskDefinition objects | Returns all the user tasks for processId. The response also contains maps of the input and output parameters. The key is the name and the value is the type of a parameter. |
| /{processId}/subprocesses | GET | N/A | A SubProcessDefinition object | Returns a list of reusable sub-process IDs for processId. |
| /{processId}/entities | GET | N/A | An AssociatedEntitiesDefinition object | Returns a map with the entities associated with processId. |
| /{processId}/tasks/users/{taskName}/inputs | GET | N/A | A TaskInputsDefinition object | Returns a map with all the task input parameter definitions for taskName of processId. The key is the name of the input and the value is its type. |
| /{processId}/tasks/users/{taskName}/outputs | GET | N/A | A TaskOutputsDefinition object | Returns a map with all the task output parameter definitions for taskName of processId. The key is the name of the input and the value is its type. |
Example 9.3. [GET] Process Definitions for a Specified Container
rewards container and uses pagination:
$ curl -u 'kieserver:kieserver1!' -H 'accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/queries/containers/instances/rewards/processes/definitions?page=0&pageSize=1000'
{
"processes" : [ {
"process-id" : "com.sample.rewards-basic",
"process-name" : "Rewards Basic",
"process-version" : "1",
"package" : "com.sample",
"container-id" : "rewards"
} ]
}
Example 9.4. [GET] User Tasks for a Specified Process
com.sample.rewards-basic process in the rewards container:
$ curl -u 'kieserver:kieserver1!' -H 'accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/containers/instances/rewards/processes/definitions/com.sample.rewards-basic/tasks/users'
{
"task" : [ {
"task-name" : "Approval by PM",
"task-priority" : 0,
"task-skippable" : false,
"associated-entities" : [ "PM" ],
"task-inputs" : {
"Skippable" : "Object",
"TaskName" : "java.lang.String",
"GroupId" : "Object"
},
"task-outputs" : {
"_approval" : "Boolean"
}
}, {
"task-name" : "Approval by HR",
"task-priority" : 0,
"task-skippable" : false,
"associated-entities" : [ "HR" ],
"task-inputs" : {
"Skippable" : "Object",
"TaskName" : "java.lang.String",
"GroupId" : "Object"
},
"task-outputs" : {
"_approval" : "Boolean"
}
} ]
}
Example 9.5. [GET] Variable Definitions for Specified Process
com.sample.rewards-basic process in the rewards container:
$ curl -u 'kieserver:kieserver1!' -H 'accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/containers/instances/rewards/processes/definitions/com.sample.rewards-basic/variables'
{
"variables" : {
"result" : "String",
"hrApproval" : "Boolean",
"pmApproval" : "Boolean",
"employeeName" : "String"
}
}
9.6.4. Managing User Tasks
9.6.4.1. Managing Task Instances
Table 9.5. Task Instance Endpoints
| URI | Method | Request Type | Response Type | Description |
|---|---|---|---|---|
| activated | PUT | N/A | N/A | Activates the taskId task. |
| claimed | PUT | N/A | N/A | Claims the taskId task. |
| started | PUT | N/A | N/A | Starts the taskId task. |
| stopped | PUT | N/A | N/A | Stops the taskId task. |
| completed | PUT | A map with the output parameters name/value | N/A | Completes the taskId task. You can provide the output parameters in form of a map, where the key is the parameter name and the value is the value of the output parameter. |
| delegated | PUT | N/A | N/A | Delegates the taskId task to a user provided by the targetUser query parameter. |
| exited | PUT | N/A | N/A | Exits the taskId task. |
| failed | PUT | N/A | N/A | Fails the taskId task. |
| forwarded | PUT | N/A | N/A | Forwards the taskId task to the user provided by the targetUser query parameter. |
| released | PUT | N/A | N/A | Releases the taskId task. |
| resumed | PUT | N/A | N/A | Resumes the taskId task. |
| skipped | PUT | N/A | N/A | Skips the taskId task. |
| suspended | PUT | N/A | N/A | Suspends the taskId task. |
| nominated | PUT | N/A | N/A | Nominates the taskId task to the potential owners by the potOwner query parameter. You can use the parameter multiple times (for example: potOwner=usr1&potOwner=usr2). |
Example 9.6. Task Instances
- Start task with
taskId4 in the containertest$ curl -X PUT -u 'kieserver:kieserver1!' http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/4/states/started
- Complete the task 1 by passing an output parameter
$ curl -X PUT -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data '{ "_approval" : true }' 'http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/1/states/completed'
Note
Unexpected error during processing User '[UserImpl:'{USER ID}']' does not have permissions to execute operation OPERATION on task id {TASK ID}
Unexpected error during processing: User '[UserImpl:'{USER ID}']' was unable to execute operation OPERATION on task id {TASK ID} due to a no 'current status' match
-Dorg.kie.server.bypass.auth.user=true, you also must provide a user using the query parameter user, who has the permission to execute the operation. If you do not use the parameter, the logged user will be used to perform the action.
9.6.4.2. Managing Task Instance Data
Table 9.6. Task Instance Data Management Endpoints
| URI | Method | Request Type | Response Type | Description |
|---|---|---|---|---|
| / | GET | N/A | A TaskInstance object | Gets task instance details of a taskId task. |
| attachments | POST | The content of the attachment | N/A | Adds a new attachment for the task. The ID of the created content is returned in the response, which is HTTP code 201. The name of the attachment is set using the query parameter name. It is not an idempotent method, thus if you make multiples request, it will create multiple attachements. |
| attachments | GET | N/A | A list of TaskAttachment objects | Gets all task attachments for the task. |
| attachments/{attachmentId} | GET | N/A | A TaskAttachment object | Gets the attachmentId task attachment. |
| attachments/{attachmentId} | DELETE | N/A | N/A | Removes the attachmentId attachment. |
| attachments/{attachmentId}/content | GET | N/A | An attachment type object | Gets the attachmentId task attachment content. |
| comments | POST | A TaskComment object | Long | Adds a new comment for the task. The ID of the created content is returned in the response, which HTTP code is 201. It is not an idempotent method, thus if you make multiples request, it will create multiple comments. |
| comments | GET | N/A | A list of TaskComment objects | Gets all task comments for the task. |
| comments/{commentId} | GET | N/A | A TaskComment object | Gets a task comment identified by commentId. |
| comments/{commentId} | DELETE | N/A | N/A | Removes the commentId comment for the task. |
| contents/input | GET | N/A | A map with the input parameters name/value | Gets the task input content in form of a map, where the key is the parameter name and the value is the value of the output parameter. |
| contents/output | PUT | A map with the output parameters name/value | N/A | Updates the task output parameters and returns HTTP 201 if successful. You must provide the output parameters in form of a map, where the key is the parameter name and the value is the value of the output parameter. |
| contents/output | GET | N/A | A map with the output parameters name/value | Gets the task output content in form of a map, where the key is the parameter name and the value is the value of the output parameter. |
| contents/{contentId} | DELETE | N/A | N/A | Deletes the task contentId content and returns HTTP code 204. |
| description | PUT | Marshalled String value | N/A | Updates the task description and returns HTTP code 201 if successful. You must provide the new value for description in the request body. |
| expiration | PUT | Marshalled Date value | N/A | Updates the task expiration date and returns HTTP 201 if successful. You must provide the new value for the expiration date in the request body. |
| name | PUT | Marshalled String value | N/A | Updates the task name and returns HTTP code 201 if successful. You must provide the new value for name in the request body. |
| priority | PUT | Marshalled int value | N/A | Updates the task priority and returns HTTP code 201 if successful. You must provide the new value for priority in the request body. |
| skipable | PUT | Marshalled boolean value | N/A | Updates the task property skipable and returns HTTP 201 if successful. You must provide the new value for the skipable property in the request body. |
Example 9.7. User Task Instance Data
- Get a user task instance for container
test:$ curl -X GET -u 'kieserver:kieserver1!' 'http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/1'
Example response:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <task-instance> <task-id>1</task-id> <task-priority>0</task-priority> <task-name>Approval by PM</task-name> <task-subject></task-subject> <task-description></task-description> <task-form>ApprovalbyPM</task-form> <task-status>Ready</task-status> <task-actual-owner></task-actual-owner> <task-created-by></task-created-by> <task-created-on>2016-02-15T13:31:10.624-02:00</task-created-on> <task-activation-time>2016-02-15T13:31:10.624-02:00</task-activation-time> <task-skippable>false</task-skippable> <task-workitem-id>1</task-workitem-id> <task-process-instance-id>1</task-process-instance-id> <task-parent-id>-1</task-parent-id> <task-process-id>com.sample.rewards-basic</task-process-id> <task-container-id>rewards</task-container-id> </task-instance> - Set priority to 3 for task 1:
$ curl -X PUT -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data '3' 'http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/1/priority'
- Add a comment to a task 2:
$ curl -X POST -u 'kieserver:kieserver1!' -H 'Content-type: application/json' -H 'X-KIE-ContentType: JSON' --data '{ "comment" : "One last comment", "comment-added-by": "kieserver"}' 'http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/2/comments' - Get all task comments:
$ curl -u 'kieserver:kieserver1!' -H 'Accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/containers/test/tasks/2/comments'
Example response:{ "task-comment" : [ { "comment-id" : 1, "comment" : "Some task comment", "comment-added-by" : "kieserver" }, { "comment-id" : 3, "comment" : "One last comment", "comment-added-by" : "kieserver" } ] }
9.6.5. Managing Job Execution
- schedule a new job,
- cancel an already scheduled job,
- add a failed job to the queue again (giving the relevant
jobId), - get a particular job (by its
jobId), - query jobs scheduled to execute the same command (given as a parameter),
- query jobs scheduled with the same given
businessKey, - query jobs with the given status as a parameter.
http://SERVER_ADDRESS:PORT/kie-server/services/rest/server/jobs.
http://localhost:8080/kie-server/services/rest/server/jobs.
Job Execution Endpoints
- /
- Method: GETResponse type: list of
RequestInfoInstanceobjectsDescription: Use this endpoint to query jobs in the server. Moreover, you can specify the parameterspage,pageSize, andstatus; possible values for status are QUEUED, DONE, CANCELLED, ERROR, RETRYING, and RUNNING. Note that these values must be capitalized. - /
- Method: POSTRequest type:
RequestInfoInstanceobjectResponse type: createdjobIdDescription: Creates a new job request and returns its ID. It is possible to assign the job to a container by settingcontainerId. - /commands/{jobCommandName}
- Method: GETResponse type: list of
RequestInfoInstanceobjectsDescription: Returns a list of jobs configured to run with thejobCommandNamecommand class. - /{jobId}
- Method: GETResponse type:
RequestInfoInstanceobjectDescription: Returns details of a job request with the providedjobId. You can specify the parameterswithErrors(boolean) to include errors of an execution andwithDatato include the data associated with the job. - /{jobId}
- Method: DELETEDescription: Cancels a job with the given
jobId. If successful, returns HTTP code 204, otherwise HTTP code 500. - /{jobId}
- Method: PUTRequest type:
RequestInfoInstanceobjectDescription: Requests unfinished or failed job request with the givenjobIdand reassigns it into the job queue. - /keys/{businessKey}
- Method: GETResponse type: list of
RequestInfoInstanceobjectsDescription: Returns a list of jobs that match the givenbusinessKey.
Example 9.8. [POST] New Job
- Change into a directory of your choice and create a
jobRequest.xmlfile with the following content:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <job-request-instance> <job-command>org.jbpm.executor.commands.PrintOutCommand</job-command> <scheduled-date>2016-02-11T00:00:00-02:00</scheduled-date> <data /> </job-request-instance>
- Execute the following command:
$ curl -X POST --data @jobRequest.xml -u 'kieserver:kieserver1!' -H 'content-type: application/xml' 'http://localhost:8080/kie-server/services/rest/server/jobs/'
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <long-type> <value>4</value> </long-type>
Example 9.9. [GET] List All Jobs
$ curl -u 'kieserver:kieserver1!' -H 'Accept: application/json' 'http://localhost:8080/kie-server/services/rest/server/jobs?status=QUEUED&status=DONE&status=CANCELLED&status=ERROR&status=RETRYING&status=RUNNING'
{
"request-info-instance" : [ {
"request-instance-id" : 3,
"request-status" : "CANCELLED",
"request-message" : "Ready to execute",
"request-retries" : 3,
"request-executions" : 0,
"request-command" : "org.jbpm.executor.commands.PrintOutCommand",
"request-scheduled-date" : 1455156000000
}, {
"request-instance-id" : 2,
"request-status" : "QUEUED",
"request-message" : "Ready to execute",
"request-retries" : 3,
"request-executions" : 0,
"request-command" : "org.jbpm.executor.commands.PrintOutCommand",
"request-scheduled-date" : 1454983200000
}, {
"request-instance-id" : 1,
"request-status" : "DONE",
"request-message" : "Ready to execute",
"request-retries" : 3,
"request-executions" : 0,
"request-command" : "org.jbpm.executor.commands.PrintOutCommand",
"request-scheduled-date" : 1454918401190
} ]
}9.7. The REST API for Intelligent Process Server Administration
9.7.1. Managed Intelligent Process Server Environment
- The controller base URL is provided by kie-wb war deployment, which is the same as
org.kie.server.controllerproperty (for example http://localhost:8080/kie-wb/rest/controller). - All requests require basic HTTP Authentication for the role kie-server.
- [GET] /admin/servers
- Returns a list of Intelligent Process Server instances.
Example 9.10. Example Server Response
<kie-server-instance-list> <kie-server-instance> <server-id>local-server-123</server-id> <server-setup> <server-containers> <containers container-id="MyContainer" status="STARTED"> <release-id> <artifact-id>project1</artifact-id> <group-id>com.sample</group-id> <version>1.0.0</version> </release-id> </containers> </server-containers> </server-setup> <server-managed-instances> <managedInstances> <location>http://localhost:8080/kie-server/services/rest/server</location> <status>UP</status> <capabilities> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <capabilities>BPM</capabilities> </capabilities> </managedInstances> </server-managed-instances> <server-name>local-server-123</server-name> <server-status>UP</server-status> <server-version>6.3.0.Final</server-version> </kie-server-instance> </kie-server-instance-list> - [GET] /admin/server/{id}
- Returns a Intelligent Process Server instance.
Example 9.11. Server Response
<kie-server-instance> <server-id>local-server-123</server-id> <server-setup> <server-containers> <containers container-id="MyContainer" status="STARTED"> <release-id> <artifact-id>project1</artifact-id> <group-id>com.sample</group-id> <version>1.0.0</version> </release-id> </containers> </server-containers> </server-setup> <server-managed-instances> <managedInstances> <location>http://localhost:8080/kie-server/services/rest/server</location> <status>UP</status> <capabilities> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <capabilities>BPM</capabilities> </capabilities> </managedInstances> </server-managed-instances> <server-name>local-server-123</server-name> <server-status>UP</server-status> <server-version>6.3.0.Final</server-version> </kie-server-instance> - [PUT] /admin/server/{id}
- Creates a new Intelligent Process Server instance with the specified id.
Example 9.12. Example Request to Create a New Intelligent Process Server Instance
<kie-server-info> <capabilities>KieServer</capabilities> <capabilities>BRM</capabilities> <location>http://localhost:8080/kie-server/services/rest/server</location> <name>local-server-456</name> <id>local-server-456</id> <version>6.3.0.Final</version> </kie-server-info>
- [DELETE] /admin/server/{id}
- Deletes a Intelligent Process Server instance with the specified id.
- [GET] /admin/server/{id}/containers/{containerId}
- Returns the container information including its release id.
Example 9.13. Server Response
<kie-container container-id="MyContainer" status="STARTED"> <release-id> <artifact-id>project1</artifact-id> <group-id>com.sample</group-id> <version>1.0.0</version> </release-id> </kie-container> - [PUT] /admin/server/{id}/containers/{containerId}
- Creates a new container with the specified containerId and the given release id.
Example 9.14. Server Request
<kie-container container-id="MyContainer"> <release-id> <artifact-id>project1</artifact-id> <group-id>com.sample</group-id> <version>1.0.0</version> </release-id> </kie-container> - [DELETE] /admin/server/{id}/containers/{containerId}
- Disposes a container with the specified containerId.
- [POST] /admin/server/{id}/containers/{containerId}/status/started
- Starts the container. No request body required.
- [POST] /admin/server/{id}/containers/{containerId}/status/stopped
- Stops the Container. No request body required.
9.7.2. Unmanaged Intelligent Process Server Environment
- The base URL for these will remain as the endpoint defined earlier (http://SERVER:PORT/kie-server/services/rest/server/).
- All requests require basic HTTP Authentication for the role kie-server.
- [GET] /
- Returns the execution server information.
Example 9.15. Server Response
<response type="SUCCESS" msg="KIE Server info"> <kie-server-info> <version>6.2.0.redhat-1</version> </kie-server-info> </response> - [POST] /config
- Using POST HTTP method, you can execute various commands on the execution server, for example: create-container, list-containers, dispose-container and call-container. Following is the list of supported commands:
CreateContainerCommandGetServerInfoCommandListContainersCommandCallContainerCommandDisposeContainerCommandGetContainerInfoCommandGetScannerInfoCommandUpdateScannerCommandUpdateReleaseIdCommand
For more information about the commands, see theorg.kie.server.api.commandspackage.Example 9.16. Request to Create a Container
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <script> <create-container> <container container-id="command-script-container"> <release-id> <artifact-id>baz</artifact-id> <group-id>foo.bar</group-id> <version>2.1.0.GA</version> </release-id> </container> </create-container> <call-container container-id="command-script-container"> <payload><?xml version="1.0" encoding="UTF-8" standalone="yes"?> <batch-execution lookup="defaultKieSession"> <insert out-identifier="message" return-object="true" entry-point="DEFAULT" disconnected="false"> <object xsi:type="message" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <text>HelloWorld</text> </object> </insert> <fire-all-rules max="-1"/> </batch-execution> </payload> </call-container> <dispose-container container-id="command-script-container"/> </script>
- [GET] /containers
- Returns a list of containers on the server.
Example 9.17. Server Response
<response type="SUCCESS" msg="List of created containers"> <kie-containers> <kie-container container-id="MyProjectContainer" status="STARTED"> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> <resolved-release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </resolved-release-id> </kie-container> </kie-containers> </response> - [GET] /containers/{id}
- Returns the status and information about the specified container.
Example 9.18. Server Response
<response type="SUCCESS" msg="Info for container MyProjectContainer"> <kie-container container-id="MyProjectContainer" status="STARTED"> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> <resolved-release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </resolved-release-id> </kie-container> </response> - [PUT] /containers/{id}
- Allows you to create a new container in the execution server.
Example 9.19. Request to create a container
<kie-container container-id="MyRESTContainer"> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> </kie-container>Example 9.20. Example Server Response When Creating a Container
<response type="SUCCESS" msg="Container MyRESTContainer successfully deployed with module com.redhat:Project1:1.0"> <kie-container container-id="MyProjectContainer" status="STARTED"> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> <resolved-release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </resolved-release-id> </kie-container> </response> - [DELETE] /containers/{id}
- Disposes a container specified by the id.
Example 9.21. Server Response disposing a container
<response type="SUCCESS" msg="Container MyProjectContainer successfully disposed."/>
- [GET] /containers/{id}/release-id
- Returns the full release id for the specified container.
Example 9.22. Server Response
<response type="SUCCESS" msg="ReleaseId for container MyProjectContainer"> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> </response>The server will respond with a success or error message, such as:Example 9.23. Server Response
<response type="SUCCESS" msg="Release id successfully updated."> <release-id> <artifact-id>Project1</artifact-id> <group-id>com.redhat</group-id> <version>1.0</version> </release-id> </response> - [GET] /containers/{id}/scanner
- Returns information about the scanner for container's automatic updates.
Example 9.24. Server Response
<response type="SUCCESS" msg="Scanner info successfully retrieved"> <kie-scanner status="DISPOSED"/> </response>
- [POST] /containers/{id}/scanner
- Allows you to start or stop a scanner that controls polling for updated container deployments.
Example 9.25. Example Server Request to Start the Scanner
<kie-scanner status="STARTED" poll-interval="20"/>
Example 9.26. Server Response
<response type="SUCCESS" msg="Kie scanner successfully created."> <kie-scanner status="STARTED"/> </response>
To stop the Scanner, replace the status withDISPOSEDand remove the poll-interval attribute.
9.8. Intelligent Process Server Java Client API Overview
9.8.1. Maven Dependencies
Example 9.27. Maven Dependency using BOM
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.bom.brms</groupId>
<artifactId>jboss-brms-bpmsuite-bom</artifactId>
<version>${version.org.jboss.bom.brms}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server-client</artifactId>
</dependency>
</dependencies>6.2.1.GA-redhat-2 in version.org.jboss.bom.brms for Red Hat JBoss BPM Suite 6.2.0. Follow Maven BOM page to see all the available versions.
Example 9.28. Hello World Maven Dependency
<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server-client</artifactId>
<version>6.3.0.Final-redhat-7</version>
</dependency>9.8.2. Client Configuration
Example 9.29. Client Configuration
import org.kie.server.api.marshalling.MarshallingFormat;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
public class DecisionServerTest {
private static final String URL = "http://localhost:8080/kie-server/services/rest/server";
private static final String USER = "kieserver";
private static final String PASSWORD = "kieserver1!";
private static final MarshallingFormat FORMAT = MarshallingFormat.JSON;
private KieServicesConfiguration conf;
private KieServicesClient kieServicesClient;
@Before
public void initialize() {
conf = KieServicesFactory.newRestConfiguration(URL, USER, PASSWORD);
conf.setMarshallingFormat(FORMAT);
kieServicesClient = KieServicesFactory.newKieServicesClient(conf);
}
}Example 9.30. JMS Client Configuration
import java.util.Properties;
import javax.jms.ConnectionFactory;
import javax.jms.Queue;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.junit.Test;
import org.kie.server.client.KieServicesClient;
import org.kie.server.client.KieServicesConfiguration;
import org.kie.server.client.KieServicesFactory;
public class DecisionServerTest {
private static final String REMOTING_URL = new String("remote://localhost:4447");
private static final String USER = "kieserver";
private static final String PASSWORD = "kieserver1!";
private static final String INITIAL_CONTEXT_FACTORY = new String("org.jboss.naming.remote.client.InitialContextFactory");
private static final String CONNECTION_FACTORY = new String("jms/RemoteConnectionFactory");
private static final String REQUEST_QUEUE_JNDI = new String("jms/queue/KIE.SERVER.REQUEST");
private static final String RESPONSE_QUEUE_JNDI = new String("jms/queue/KIE.SERVER.RESPONSE");
private KieServicesConfiguration conf;
private KieServicesClient kieServicesClient;
@Test
public void testJms() throws Exception {
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
env.put(Context.PROVIDER_URL, REMOTING_URL);
env.put(Context.SECURITY_PRINCIPAL, USER);
env.put(Context.SECURITY_CREDENTIALS, PASSWORD);
InitialContext context = new InitialContext(env);
Queue requestQueue = (Queue) context.lookup(REQUEST_QUEUE_JNDI);
Queue responseQueue = (Queue) context.lookup(RESPONSE_QUEUE_JNDI);
ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY);
conf = KieServicesFactory.newJMSConfiguration(connectionFactory, requestQueue, responseQueue, USER, PASSWORD);
kieServicesClient = KieServicesFactory.newKieServicesClient(conf);
}
}
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-jms-client-bom</artifactId>
<version>7.5.6.Final-redhat-2</version>
<type>pom</type>
</dependency>
9.8.3. Server Response
org.kie.server.api.model.ServiceResponse<T> object, where T represents the payload type. It has following attributes:
String msg: returns the response message.ResponseType type: returns SUCCESS or FAILURE.T result: returns the requested object.
Example 9.31. Hello World Server Response
import org.kie.server.api.model.ServiceResponse; import org.kie.server.client.RuleServicesClient; RuleServicesClient ruleClient = client.getServicesClient(RuleServicesClient.class); ServiceResponse<String> response = ruleClient.executeCommands(container, batchCommand); System.out.println(response.getResult());
9.8.4. Inserting and Executing Commands
org.kie.api.command.KieCommands class to insert commands. Use org.kie.api.KieServices.get().getCommands() to instantiate the KieCommands class. If you want to add multiple commands, you must use the BatchExecutionCommand wrapper. For additional example, follow the Hello World project.
Example 9.32. Inserting and Executing Commands
public void executeCommands() {
String containerId = "hello";
System.out.println("== Sending commands to the server ==");
RuleServicesClient rulesClient = kieServicesClient.getServicesClient(RuleServicesClient.class);
KieCommands commandsFactory = KieServices.Factory.get().getCommands();
Command<?> insert = commandsFactory.newInsert("Some String OBJ");
Command<?> fireAllRules = commandsFactory.newFireAllRules();
Command<?> batchCommand = commandsFactory.newBatchExecution(Arrays.asList(insert, fireAllRules));
ServiceResponse<String> executeResponse = rulesClient.executeCommands(containerId, batchCommand);
if(executeResponse.getType() == ResponseType.SUCCESS) {
System.out.println("Commands executed with success! Response: ");
System.out.println(executeResponse.getResult());
}
else {
System.out.println("Error executing rules. Message: ");
System.out.println(executeResponse.getMsg());
}
}
org.drools:drools-compiler Maven dependency:
<!-- Valid for version 6.2.0 --> <dependency> <groupId>org.drools</groupId> <artifactId>drools-compiler</artifactId> <version>6.3.0.Final</version> </dependency>
9.8.5. Server Capabilities
Note
org.kie.server.api.model.KieServerInfo object.
Example 9.33. Server Capabilities
public void listCapabilities() {
KieServerInfo serverInfo = kieServicesClient.getServerInfo().getResult();
System.out.print("Server capabilities:");
for(String capability: serverInfo.getCapabilities()) {
System.out.print(" " + capability);
}
System.out.println();
}9.8.6. Containers
org.kie.server.api.model.KieContainerResource object. List of resources is represented by the org.kie.server.api.model.KieContainerResourceList object.
Example 9.34. Print a List of Containers
public void listContainers() {
KieContainerResourceList containersList = kieServicesClient.listContainers().getResult();
List<KieContainerResource> kieContainers = containersList.getContainers();
System.out.println("Available containers: ");
for (KieContainerResource container : kieContainers) {
System.out.println("\t" + container.getContainerId() + " (" + container.getReleaseId() + ")");
}
}9.8.7. Handling Containers
ServiceResponse will be returned with void payload. If you create a container, KieContainerResource object will be returned.
Example 9.35. Dispose and Create a Container
public void disposeAndCreateContainer() {
System.out.println("== Disposing and creating containers ==");
List<KieContainerResource> kieContainers = kieServicesClient.listContainers().getResult().getContainers();
if (kieContainers.size() == 0) {
System.out.println("No containers available...");
return;
}
KieContainerResource container = kieContainers.get(0);
String containerId = container.getContainerId();
ServiceResponse<Void> responseDispose = kieServicesClient.disposeContainer(containerId);
if (responseDispose.getType() == ResponseType.FAILURE) {
System.out.println("Error disposing " + containerId + ". Message: ");
System.out.println(responseDispose.getMsg());
return;
}
System.out.println("Success Disposing container " + containerId);
System.out.println("Trying to recreate the container...");
ServiceResponse<KieContainerResource> createResponse = kieServicesClient.createContainer(containerId, container);
if(createResponse.getType() == ResponseType.FAILURE) {
System.out.println("Error creating " + containerId + ". Message: ");
System.out.println(responseDispose.getMsg());
return;
}
System.out.println("Container recreated with success!");
}9.8.8. Available Intelligent Process Server Clients
KieServicesClient serves also as an entry point for other clients with the ability to perform various operations, such as JBoss BRMS commands and manage processes. Following services are available in the org.kie.server.client package:
- JobServicesClient is used to schedule, cancel, requeue, and get job requests.
- ProcessServicesClient is used to start, signal, and abort processes or work items.
- QueryServicesClient is used to query processes, process nodes, and process variables.
- RuleServicesClient is used to send commands to the server to perform rule-related operations (for example insert objects into the working memory, fire rules, ...).
- UserTaskServicesClient is used to perform all user-task operations (start, claim, cancel a task) and query tasks by specified field (process instances id, user, ...)
getServicesClient method provides access to any of these clients:
RuleServicesClient rulesClient = kieServicesClient.getServicesClient(RuleServicesClient.class);
9.8.9. List of Available Business Processes
QueryClient to list available process definitions. QueryClient methods use pagination, therefore in addition to the query you make, you must provide the current page and the number of results per page. In the provided example, the query starts on page 0 and lists the first 1000 results.
Example 9.36. List Processes
public void listProcesses() {
System.out.println("== Listing Business Processes ==");
QueryServicesClient queryClient = kieServicesClient.getServicesClient(QueryServicesClient.class);
List<ProcessDefinition> findProcessesByContainerId = queryClient.findProcessesByContainerId("rewards", 0, 1000);
for (ProcessDefinition def : findProcessesByContainerId) {
System.out.println(def.getName() + " - " + def.getId() + " v" + def.getVersion());
}
}Part III. Plug-in
Chapter 10. Plug-in
10.1. Creating BPM project
- On the main menu of JBoss Developer Studio, click → → and then → → .
- Then choose → .
- In the New jBPM Project dialog, define the project name and location and click .
- Select the required content of the project and click .
- Select the runtime to be used by the project or click and define a new runtime (for details on runtime resources, refer to the Red Hat JBoss BPM Suite Installation Guide).
- Select the required compatibility mode and click .
Note
- Click → (Maven)
10.2. Creating Process
- Choose → →
- Select → .
- In the displayed dialog box, define the location and the filename of the Process. Make sure you follow maven structure requirements.
Note
- Select → .
10.3. Using the Debug Perspective
Procedure 10.1. The Debug Perspective
- Open the Process Instance view
- Select under the category
- Use a Java breakpoint to stop your application at a specific point (for example, after starting a new process instance).
- In the Debug perspective, select the ksession you would like to inspect.
- The Process Instances view will show the process instances that are currently active inside that ksession.
- When double-clicking a process instance, the process instance viewer will graphically show the progress of that process instance.
- Sometimes, when double-clicking a process instance, the process instance viewer complains that is cannot find the process. This means that the plug-in was not able to find the process definition of the selected process instance in the cache of parsed process definitions. To solve this, simply change the process definition in question and save again.

Figure 10.1. Process Instance in the Debugger
Note
10.4. Checking session logs
Procedure 10.2. Creating a logger
- To create a logger, use KieServices as depicted below:
KieRuntimeLogger logger = KieServices.Factory.get().getLoggers() .newThreadedFileLogger(ksession, "mylogfile", 1000); // do something with the ksession here logger.close();
- Attach the new logger to a ksession.
- Be sure to close the logger after usage.
Procedure 10.3. Using Audit View
- To use Audit View, open
- Under the category, select .
- To open a log file in Audit View, select the log file using the action in the top right corner, or simply drag and drop the log file from the Package Explorer or Navigator into the Audit View.
- A tree-based view is generated based on the data inside the audit log. Depicted below is an example tree-based view:

Figure 10.2. Tree-Based View
- An event is shown as a subnode of another event if the child event is caused by a direct consequence of the parent event.
Note
Part IV. Deployment and runtime management
Chapter 11. Deploying and Managing Projects
11.1. Deploying a Project
- Open the
Project Editorin your project (navigate to your project using Project Explorer and clickOpen Project Editor
button).
- You can define the Kie Base and Kie Session properties. If not, the default kbase and ksession will be used.
- On the title bar, open menu
and click the button.
Note
11.2. Process Management

Figure 11.1. Process Management
11.2.1. Process Definitions
- Process Definition Lists
- Process Definition Details
11.2.2. Process Instances
- Process Instance Lists
- Process Instance Details

Figure 11.2. Features in the Process Instances List View
- The Instance Detail tab: This gives you a quick overview about what is going on inside the process. It displays the current state of the instance and the current activity that is being executed.
- The Process Variables tab: This displays all the process variables that are being manipulated by the instance with the exception of the variables that contains documents.
- The Documents tab: This displays process documents if the process contains a variable of the type: org.jbpm.Document. This enables easy access, download and manipulation of the attached documents. Note that you can not attach a new document to currently running instances.
- The Logs tab: This displays business and technical logs for the respective end users. In order to track a process through the logs, you can also open the Process Model that shows the completed activies in grey and the current activities highlighted in red.
11.2.2.1. Searching Process Instances by Partial Correlation Key
- On the top menu of the Business Central, go to → .
- In the list on the Process Instances tab, click the
button.
The New Process Instance List dialog box opens. - In the New Process Instance List dialog box:
- Provide the name and description for your search process instance list in the Labels tab.
- Click the Filter tab to create new query filter.
- Click Add New.
- From the list of filter values, select . If you want to create a search filter using partial correlationKey, select the query operator and provide the value as
partial-correlation-key%wherepartial-correlation-keyis the value you are searching for. - Click .
A new tab is created that displays your custom process instance list.
11.2.2.2. Searching Process Instances Based on Business Data
- On the top menu of the Business Central, go to → .
- In the list on the Process Instances tab, click the
button. The New Process Instance List dialog box opens.
- In the New Process Instance List dialog box, perform the following:
- Provide the name and description for your search process instance list in the Labels tab.
- Add a new query filter in the Filter tab:
- Click Add New.
- From the list of filter values, select and .
- Provide a valid
processIdvalue and click .
A new tab is created that displays your custom process instance list in a tabular form. This new tab provides process instance variables (business data) as selectable columns. You can view the variables corresponding to each process instance in the table by enabling these columns, which are disabled by default.
11.2.3. Creating a New Process Instance List
- On the top menu of the Business Central, go to → .
- In the list on the Process Instances tab, click the
button.
The following New Process Instance List dialog box opens:
Figure 11.3. New Process Instance List
- In the New Process Instance List dialog box:
- Provide the name and description for your process instance list in the Labels tab.
- Click the Filter tab to create new query filter.
- Click Add New.
- From the list of filter values, select the appropriate filter condition and its value. You can add more filters by clicking Add New.
- Once you have specified all your filter conditions, click .
A new tab is created that displays your custom process instance list.
11.2.4. Aborting a Process instance
Aborting a Process instance using API
void abortProcessInstance(long processInstanceId) call on the parent Kie Session.
Aborting a Process instance from the Business Central
- On the top menu of the Business Central, go to → .
- In the list on the Process Instances tab, locate the required Process instance and click the button in the instance row.
11.3. Task Management

Figure 11.4. Task Management
11.3.1. Tasks List
Task client

Figure 11.5. Task Lists Tabs
- Active tab: Displays all the active tasks that you can work on. This includes personal and group tasks.
- Personal tab: Displays all your personal tasks.
- Group tab: Displays all the group tasks that need to be claimed by you in order to start working on them.
- All: Displays all the tasks. This also includes completed tasks but not the ones that belongs to a process that is already finished.
- Work: Displays basic details about the task and the task owner. You can click the button to claim the task. To undo the claim process, click the button again.
- Details: Displays information such as task description, status, and due date.
- Process Context: Displays related process instance and process definition.
- Assigments: Displays the current owner of the task and allows you to delegate the task to another person or group.
- Comments: Displays comments added by task user(s). It allows you to delete an existing comment and add a new comment.
- Admin: Displays all the tasks for which you are the business administrator.
11.3.2. Creating a User Task
- On the top menu of the Business Central, go to → .
- On the Tasks List tab, click the button and define the task parameters.This opens a New Task window with the following tabs:

Figure 11.6. New Task Window
- tab
- : The task display name.
- tab
- : Add due date of the task.
- : Select task priority.
- button: Click to add more users. Note that a task cannot be created without a user or a group.
- button: Click to add more groups.
- : Add the name of the person who executes the task.
- button: Click to remove the existing user.
- tab
- : Select the deployment Id of the form from the list of available deployment Ids.
- : Select the name of the associated task form from the list of available forms.
If tasks are part of a Business Process, they have an associated form that collects data from you and propagates that to the business process for further usage. You can create forms for specific tasks using the Form Modeler. If there is no form provided for a task, a dynamic form is created based on the information that the task needs to handle. If you create a task as an ad-hoc task, which is not related with any process, there will be no such information to generate a form and only basic actions will be provided.
- Click the Create button.
11.3.3. Task Variables as Expressions
taskId. Task variables are resolved at both task creation time and notification time, unlike process variables, which are resolved only at task creation time. The ability of using task variables while creating tasks minimizes your Java code, such as calling JBoss BPM Suite APIs.
${task.id}processInstanceId variable:
${task.taskData.processInstanceId}Chapter 12. Logging
Chapter 13. Examples
Part V. BAM
Chapter 14. Red Hat JBoss Dashboard Builder
What is Business Activity Monitoring?
14.1. Accessing Dashboard Builder
- displays a pre-defined dashboard based on runtime data from the Execution Server. In the menu on the left, select the entity you are interested. The widgets on the right will display the data for the entity.
- Using the URL https://HOSTNAME/dashbuilder (with the appropriate Hostname).
- Using business-central with > menus.
- displays the environment in which you can create your own dashboards. Procedures on how to create a custom dashboard are provided below.
14.2. Basic concepts
14.3. Environment
Procedure 14.1. To access Dashbuilder through business-central
- Log into business-central with your user account.
- Select > .
- Dashbuilder will open in a new browser / window tab.
Procedure 14.2. To access Dashbuilder through web browser.
- Go to Dashbuilder directly through https://HOSTNAME/dashbuilder
- An example instance running the local host would be https://localhost:8080/dashbuilder
14.4. Data sources
14.4.1. Connecting to data sources
- Make sure the data source is up and running and that the application server has access to the data source. (Check the driver, the login credentials, etc. In Red Hat JBoss EAP 6, you can do so in the Management Console under → → )
- In Dashboard Builder, on the Tree Menu (by default located on the of the Showcase perspective), go to → .
- On the displayed External Connection panel, click the
button.
- Select the data source type (JNDI or Custom DataSource) and provide the respective data source parameters below.
14.4.2. Security considerations
Important
14.4.3. Building a Dashboard for Large Volumes of Data
- The in-memory strategyThe in-memory strategy is to create a data provider that loads all the required data from the database by executing a single SQL query on the relevant tables, into the Dashboard Builder's memory. In this case, every indicator on the Dashboard Builder shares the same data set. When you use filters from the Dashboard Builder user interface to access specific data from this data set, the Dashboard Builder fetches the data from the internal memory and does not execute another SQL query again on the database. This strategy has a simple data retrieval logic as it deals with creating a single data provider. As all the data set properties are available to you at once, it allows you to configure KPIs faster. However, this approach is not suitable for large data sets as it would lead to poor performance.
- The native strategyThe native approach is to create a data provider for every indicator in the Dashboard Builder and does not require loading all the data into the internal memory at once. So each time you use a filter from the Dashboard Builder user interface, the corresponding SQL queries get executed and fetches the required data from the database. So there is no data in the Dashboard Builder's internal memory. This strategy works best in case of large volumes of data, however it needs proper indexing on the database tables. Also, setting up data providers for multiple KPIs is complicated as compared to creating a single data provider in case of in-memory strategy.
Let us consider a case when you want to create a stock exchange dashboard comprising the following charts and reports:
- Bar chart for Average price per company
- Area chart for Sales price evolution
- Pie chart for Companies per country
- Table report for Stock prices at closing date
- Company: Comprising columns ID, NAME, and COUNTRY.
- Stock: Comprising columns ID, ID_COMPANY, PRICE_PER_SHARE, and CLOSING_DATE.
SELECT C.NAME, C.COUNTRY, S.PRICE_PER_SHARE, S.CLOSING_DATE FROM COMPANY C JOIN STOCK S ON (C.ID=S.ID_COMPANY)The output of this query is saved in the Dashboard Builder's local memory. The Dashboard accesses this data every time a filter is run.
- For the bar chart on Average price per company, the following SQL query is executed:
SELECT C.NAME, AVG(S.PRICE_PER_SHARE) FROM COMPANY C JOIN STOCK S ON (C.ID=S.ID_COMPANY) WHERE {sql_condition, optional, c.country, country} AND {sql_condition, optional, c.name, name} GROUP BY C.NAME - For the area chart on Sales price evolution, the following SQL query is executed:
SELECT S.CLOSING_DATE, AVG(S.PRICE_PER_SHARE) FROM COMPANY C JOIN STOCK S ON (C.ID=S.ID_COMPANY) WHERE {sql_condition, optional, c.country, country} AND {sql_condition, optional, c.name, name} GROUP BY CLOSING_DATE - For the pie chart on Companies per country, the following SQL query is executed:
SELECT COUNTRY, COUNT(ID) FROM COMPANY WHERE {sql_condition, optional, country, country} AND {sql_condition, optional, name, name} GROUP BY COUNTRY - For the table report on Stock prices at closing date, the following SQL query is executed:
SELECT C.NAME, C.COUNTRY, S.PRICE_PER_SHARE, S.CLOSING_DATE FROM COMPANY C JOIN STOCK S ON (C.ID=S.ID_COMPANY) WHERE {sql_condition, optional, c.country, country} AND {sql_condition, optional, c.name, name}
{sql_condition} clauses. The signature of the {sql_condition} clause is the following:
{sql_condition, [optional | required], [db column], [filter property]}
Here,
- optional: This indicates that if there is no filter for the given property, then the condition is ignored.
- required: This indicates that if there is no filter for the given property, then the SQL returns no data.
- db column: This indicates the database column where the current filter is applied.
- filter property: This indicates the selected UI filter property.
14.4.4. Data providers
14.4.4.1. Creating data providers
- In the Tree Menu (the panel in the lateral menu of the Showcase workspace), click → .
- In the Data Providers panel, click the
button.
- In the updated Data Providers panel, select in the Type dropdown menu the type of the data provider depending on the source you want the data provider to operate on.
- Define the data provider parameters:
- Data provider over a CSV file
- Name: user-friendly name and its locale
- CSV file URL: the url of the file (for example,
file:///home/me/example.csv) - Data separator: the symbol used as separator in the CSV file (the default value is semicolon; if using comma as the separator sign, make sure to adapt the number format if applicable)
- Quoting symbol: the symbol used for quotes (the default value is the double-quotes symbol; note that the symbol may vary depending on the locale)
- Escaping symbol: the symbol used for escaping the following symbol in order to keep its literal value
- Date format: date and time format
- Number format: the format of numbers as resolved to thousands and decimals
- Data provider over a database (SQL query)
- Name: user-friendly name and its locale
- Data source: the data source to query (the default value is
local, which allows you to query the Dashboard Builder database) - Query: query that returns the required data
- Click
to verify the parameters are correct.
- Click .
- In the table with the detected data, define the data type and if necessary provide a user-friendly name for the data. Click .
14.4.5. Workspace
) in the top menu on the left. You can also edit the current workspace properties, delete the current workspace, and duplicate the current workspace using icons in the top panel.
14.4.5.1. Creating a workspace
- Click the button on the top menu.The management console with the Workspace node expanded and workspace management area with workspace details on the right is displayed.
- In the Create workspace table on the right, set the workspace parameters:
- Name: workspace name and its locale
- Title: workspace title and its locale
- Skin: skin to be applied on the workspace resources
- Envelope: envelope to be applied on the workspace resources
- Click .
- Optionally, click the workspace name in the tree menu on the left and in the area with workspace properties on the right define additional workspace parameters:
- URL: the workspace URL
- User home search: the home page settingIf set to
Role assigned page, the home page as as in the page permissions is applied; that is, every role can have a different page displayed as its home page. If set toCurrent page, all users will use the current home page as their home page.
14.4.5.2. Pages
14.4.5.2.1. Creating Pages
- Make sure you are in the correct workspace.
- Next to the Page dropdown box
in the top menu, click the
button
.
- The management console with the Pages node expanded and page management area with page details on the right is displayed.
- In the Create new page table on the right, set the page parameters:
- Name: page name and its locale
- Parent page: parent page of the new page
- Skin: skin to be applied on the page
- Envelope: envelope to be applied on the page
- Page layout: layout of the page
- Click .
- Optionally, click the page name in the tree menu on the left and in the area with workspace properties on the right define additional page parameters:
- URL: the page URL
- Visible page: visibility of the page
- Spacing between regions and panels
14.4.5.2.2. Defining Page permissions
other security domain by default), the Red Hat JBoss Dashboard Builder has its own role-based access control (RBAC) management tool to facilitate permission management on an individual page or multiple pages.
- On the top menu, click the
button
: the management console is displayed.
- Under the Workspace node on the left, locate the page or the Pages node.
- Under the page/pages node, click the Page permissions node.
- In the Page permissions area on the right, delete previously defined permission definition if applicable and define the rights for the required role:
- In the Permission assignation table, locate the Select role dropdown menu and pick the respective role.
- In the Actions column of the table, enable or disable individual permissions.
- Click .
14.4.5.3. Panels
- Dashboard panels
- are the primary BAM panels and include the following:
- Data provider manager: a panel with a list of available data providers and data provider management options
- Filter and Drill-down: a panel that displays all KPIs and their values to facilitate filtering in indicators on the given page defined over a data provider
- HTML Editor panel: a panel with static content
- Key Performance Indicator (indicator): a panel that visualizes the data of a data provider
- Navigation panels
- are panels that provide navigation functions and include the following:
- Breadcrumb: a panel with the full page hierarchy pointing to the current page
- Language menu: a panel with available locales (by default in the top center)
- Logout panel: a panel with the name of the currently logged-in user and the logout button
- Page menu custom: a panel with vertically arranged links to all pages in the workspace (the list of pages can be adjusted) and general controls for the HTML source of the page
- Page menu vertical: a panel with vertically arranged links to all pages in the workspace (the list of pages can be adjusted)
- Page menu horizontal: a panel with horizontally arranged links to all pages in the workspace (the list of pages can be adjusted)
- Tree menu: a panel with the links to essential features such as Administration, Home (on the Home page of the Showcase workspace displayed on the left, in the lateral menu)
- Workspace menu custom: a panel with links to available workspaces (the list of workspaces can be adjusted) and general controls for the HTML source of the workspace
- Workspace menu horizontal: a horizontal panel with links to available workspaces (the list of workspaces can be adjusted)
- Workspace menu vertical: a vertical panel with links to available workspaces (the list of workspaces can be adjusted)
- System panels
- are panels that provide access to system setting and administration facilities and include the following:
- Data source manager: a panel for management of external data sources
- Export dashboards: a panel export of dashboards
- Export/Import workspaces: a panel for exporting and importing of workspaces
14.4.5.3.1. Adding panels
- Make sure the respective page is open (in the Page dropdown menu of the top menu select the page).
- In the top menu, click the
button.
- In the displayed dialog box, expand the panel type you want to add (Dashboard, Navigation, or System) and click the panel you wish to add.
- From the Components menu on the left, drag and drop the name of an existing panel instance or the Create panel item into the required location on the page.If inserting a new indicator, the Panel view with the graph settings will appear. Define the graph details and close the dialog.If adding an instance of an already existing indicator, you might not be able to use it, if it is linked to the KPIs on the particular original page. In such a case, create a new panel.
- If applicable, edit the content of the newly added panel.
Chapter 15. Management console
- Workspaces tree with individual workspaces and their pages (general item settings are displayed on the right)
- Graphic resources tree with options for upload of new graphic resources and management of the existing ones
- General permissions with access roles definitions and access permission management
button in the upper left corner.
Chapter 16. Graphic resources
- Skins define a set of style sheets, images, and icons
- Region layouts define layouts of regions for pages
- Envelopes define an HTML template used as page frames
Graphic resources definitions
$DEPLOYMENT_LOCATION/dashbuilder.war/WEB-INF/etc/ directory.
- properties file that defines the name of the component for individual supported locales, the name of the css file to be applied on the component, and mapping of file to individual component elements
- JSP, HTML, CSS files, and image and icon resources referenced from the properties file
16.1. Working with graphic resources
- On the top menu, click the button .
- Under the Graphic resources node on the left, click the component type you want to work with (Skins, Layouts, Envelopers). The window on the right will display the content relevant for the given component type.
- On the right, you can now do the following:
- Upload a new component: you need to provide a unique ID for the component and the resource zip file. Then click .
- Download a component definition or preview the component: in the table below the Add view, click the respective icon in the Actions column.
Appendix A. Process Elements
A.1. Process
Runtime
kcontext, holds all the Process runtime data. You can call it in your code, for example, in Action scripts, to obtain or modify the runtime data:
- Getting the currently executed Element instance so as to query further Element data, such as its name and type, or cancel the Element instance.
Example A.1. Getting the currently executed Element
NodeInstance element = kcontext.getNodeInstance(); String name = element.getNodeName();
- Getting the currently executed Process instance so as to query further Process instance data, such as, its name, ID, or abort or send an event, such as a Signal.
Example A.2. Getting the currently executed Process and sending it a Signal event
ProcessInstance proc = kcontext.getProcessInstance(); proc.signalEvent( type, eventObject );
- Getting and setting the values of variables
- Execute calls on the Knowledge runtime, for example, start Process instances, insert data, etc.
- The
createProcessInstancemethod is called on a Process: a new process instance based on a Process is created and Process variables are initialized . The process instance is in statusCREATED. - The
start()method is called on the ProcessInstance: the execution of the Process instance is triggered (the token on the Start Event is generated). If the Process was instantiated manually, the token is generated only on its None Start Event. If it is instantiated using another mechanism, such as Signal, Message, or Error, the token is generated on the Start Event of the respective type that is defined to handle the particular object. The process instance becomesACTIVE. - Once there is no token in the flow (tokens are consumed by End Events and destroyed by Terminating Events), the Process instance is finished and becomes
CANCELLED.
Properties
- ID
- Process ID defined as a String unique in the parent Knowledge BaseExample value:
org.jboss.exampleProcessIt is recommended to use the ID form<packageName>.<processName>.<version>. - Name
- Process display name
- Version
- Process version
- Package
- Parent package the Process belongs to (Process namespace)Possible values:
true,false - Target Namespace
- BPMN2 xsd location
- Executable
- type of the process as concerns its executabilityPossible values:
true,false - Imports
- Imported Process
- Documentation
- Documentation is a generic element attribute that can contain element description. It has no impact on runtime.
- AdHoc
- Boolean property defining whether a Process is an Ad-hoc Process:If set to
true, the flow of the Process execution is controlled exclusively by a human user. - Executable
- Boolean property defining whether a Process is intended for execution or not (if set to
false, the process cannot be instantiated) - Globals
- Set of global variables visible for other Processes to allow sharing of data between them
A.2. Events mechanism
- Internal event: Any action inside a process (for example, the action of an action node, or an on-entry or on-exit action of some node) can signal the occurrence of an internal event to the surrounding Process instance.
Example A.3. Schema of the call sending an event to the Process instance
kcontext.getProcessInstance().signalEvent(type, eventData);
- External event: A process instance can be notified of an event from outside
Example A.4. Schema of the call notifying a Process instance about an external event
processInstance.signalEvent(type, eventData);
- External event using event correlation: Instead of notifying a Process instance directly, you can notify the entire Session and let the engine determine which Process instances might be interested in the event using event correlation. Event correlation is determined based on the event type. A Process instance that contains an Event element listening to external events of some type is notified whenever such an event occurs. To signal such an event to the process engine, write code such as:
Example A.5. Schema of the call notifying a Session about an external event
ksession.signalEvent(type, eventData);
A.3. Collaboration mechanisms
- Messages: Messages are used to communicate within the process and between process instances. Messages are implemented as signals which makes them scoped only for a given
KSessioninstance.For external system interaction send and receive task should be used with proper handler implementation. - Escalations: mainly inter-process (between processes) signalling of escalation to trigger escalation handling
- Errors: mainly inter-process signalling of escalation to trigger escalation handling
- Signals: general, mainly inter-process instance communication
A.3.1. Messages
Attributes
Mandatory Attributes
- Message
- string with the message
A.3.2. Escalation
"An Escalation identifies a business situation that a Process might need to react to." [2]
Attributes
Mandatory Attributes
- Escalation Code
- string with the escalation code
A.3.3. Signals
Note
- To instantiate a Process instance directly with a Signal, you can use the following API function:
ksession.signalEvent(eventType, data, processInstanceId)
The eventType parameter defines the Signal's Event Type, the data parameter defines the data accompanying the Signal, and processInstanceId defines the ID of the Process to be instantiated. - To trigger a Signal from a script, that is, from a Script Task or using on-entry or on-exit actions of a node, you can use the following API function:
kcontext.getKieRuntime().signalEvent( eventType, data, kcontext.getProcessInstance().getId());
A.4. Transaction mechanisms
A.4.1. Errors
Attributes
- Error Code
- Error Code defined as a String unique within the Process.
A.4.2. Compensation
Note
- When an interaction with an external party or 3rd party system may fail or be faulty
- When you can not fully check the input data received by your Process (for example, a client's address information)
- When there are parts of your Process that are particularly dependent on one of the following:
- Company policy or policy governing certain in-house procedures
- Laws governing the business process (such as, age requirements)
A.5. Timing
Note
- Time Duration
- defines the period for which the execution of the event is put on hold. The execution continues after the defined period has elapsed. The timer is applied only once.
- Time Cycle
- This defines the time between subsequent timer activations. If the period is
0, the timer is triggered only once.
- Cron
- [#d][#h][#m][#s][#[ms]]
Example A.6. Timer period with literal values
1d 2h 3m 4s 5ms
The element will be executed after 1 day, 2 hours, 3 minutes, 4 seconds, and 5 milliseconds.Any validISO8601date format that supports both one shot timers and repeatable timers can be used. Timers can be defined as date and time representation, time duration or repeating intervals. For example:- Date
- 2013-12-24T20:00:00.000+02:00 - fires exactly at Christmas Eve at 8PM
- Duration
- PT2S - fires 1 after 2 seconds
- Repetable Intervals
- R/PT1S - fires every second, no limit, alternatively R5/PT1S will fire 5 times every second
- None
- #{expression}
Example A.7. Timer period with expression
myVariable.getValue()
The element will be executed after time period returned by the callmyVariable.getValue().
A.6. Process Elements
Important
Generic Process Element Properties
- ID
- ID defined as a String unique in the parent Knowledge Base
- Name
- Element display name
A.7. Event Types
A.7.1. Start Event
- None Start Event
- Signal Start Event
- Timer Start Event
- Conditional Start Event
- Message Start Event
- Compensation Start Event
A.7.1.1. Start Event types
A.7.1.1.1. None Start Event
A.7.1.1.2. Message Start Event
Attributes
- Message
- ID of the expected Message object
A.7.1.1.3. Timer Start Event
Attributes
- Timer
- Timing definition
A.7.1.1.4. Escalation Start Event
Attributes
- Escalation Code
- Expected Escalation Code
A.7.1.1.5. Conditional Start Event
true after the Start Event has been instantiated.
false and then to true.
Attributes
- Condition
- Boolean condition
A.7.1.1.6. Error Start Event
Attributes
- ErrorCode
- code of the expected Error object
A.7.1.1.7. Compensation Start Event
A.7.1.1.8. Signal Start Event
Attributes
- SignalCode
- Expected Signal Code
A.7.2. Intermediate Events
A.7.2.1. Intermediate Events
- in a Process workflow with one optional incoming and one outgoing Flow:
- The event is executed as part of the workflow. If the Event has no incoming Flow, its execution is triggered always when the respective trigger occurs during the entire Process instance execution. If the Event has an incoming Flow it is executed as part of the Process workflow. Once triggered, the Event's outgoing Flow is taken only after the respective Event has occurred.
- on an Activity boundary with one outgoing Flow:
- If the Event occurs while the Activity is being executed, the Event triggers its execution to the outgoing Flow. One Activity may have multiple boundary Intermediate Events. Note that depending on the behavior you require from the Activity with the boundary Intermediate Event, you can use either of the following Intermediate Event type:
- interrupting: the Activity execution is interrupted and the execution of the Intermediate Event is triggered.
- non-interrupting: the Intermediate Event is triggered and the Activity execution continues.
- Timer Intermediate Event
- delays the execution of the outgoing Flow.
- Conditional Intermediate Event
- is triggered when its condition evaluates to
true. - Error Intermediate Event
- is triggered by an Error object with the given Error Code.
- Escalation Intermediate Event
- has two subtypes: Catching Escalation Intermediate Event that is triggered by a Escalation and Throwing Escalation Intermediate Event that produces an Escalation when executed.
- Signal Intermediate Event
- has two subtypes: Catching Signal Intermediate Event that is triggered by a Signal and Throwing Signal Intermediate Event that produces a Signal when executed.
- Message Intermediate Event
- has two subtypes: Catching Message Intermediate Event that is triggered by a Message and Throwing Message Intermediate Event that produces a Message when executed.
A.7.2.2. Intermediate Event types
A.7.2.2.1. None Intermediate Event
A.7.2.2.2. Timer Intermediate Event
Attributes
- Message
- ID of the expected Message object
- Timer delay
- Time delay before the Event triggers its outgoing Flow for the first time
- Timer period
- Period between two subsequent triggersIf set to
0, the Event execution is not repeated.
A.7.2.2.3. Conditional Intermediate Event
true and its outgoing Flow is taken.
true.
Attributes
- Condition
- Boolean condition that must be evaluated to true for the execution to continue
A.7.2.2.4. Message Intermediate Event
- Throwing Message Intermediate Event produces a Message object based on the defined properties
- Catching Message Intermediate Event listens for a Message object with the defined properties
A.7.2.2.5. Compensation Intermediate Event
A.7.2.2.6. Message Intermediate Event types
A.7.2.2.6.1. Throwing Message Intermediate Event
- CancelActivity
- if the Event is place on the boundary of an Activity and the Cancel Activity property is set to
true, the Activity execution is cancelled immediately when the Event receives its Escalation object. - MessageRef
- ID of the produced Message object
A.7.2.2.6.2. Catching Message Intermediate Event
- MessageRef
- ID of the expected Message object
A.7.2.2.7. Escalation Intermediate Event
- Throwing Escalation Intermediate Event produces an Escalation object based on the defined properties
- Catching Escalation Intermediate Event listens for an Escalation object with the defined properties
A.7.2.2.8. Escalation Intermediate Event types
A.7.2.2.8.1. Throwing Escalation Intermediate Event
- EscalationCode
- ID of the produced Escalation object
A.7.2.2.8.2. Catching Escalation Intermediate Event
- EscalationCode
- code of the expected Escalation object
- CancelActivity
- if the Event is place on the boundary of an Activity and the Cancel Activity property is set to
true, the Activity execution is cancelled immediately when the Event receives its Escalation object.
A.7.2.2.9. Error Intermediate Event
Attributes
- ErrorRef
- reference number of the Error object the Event is listening for
A.7.2.2.10. Error Intermediate Event types
A.7.2.2.10.1. Throwing Error Intermediate Event
- ErrorRef
- reference number of the produced Error object
A.7.2.2.10.2. Catching Error Intermediate Event
- ErrorRef
- reference number of the expected Error object
- CancelActivity
- if the Event is place on the boundary of an Activity and the Cancel Activity property is set to
true, the Activity execution is cancelled immediately when the Event receives its Escalation object.
A.7.2.2.11. Signal Intermediate Event
- Throwing Signal Intermediate Event produces a Signal object based on the defined properties
- Catching Signal Intermediate Event listens for a Signal object with the defined properties
A.7.2.2.12. Signal Intermediate Event types
A.7.2.2.12.1. Throwing Signal Intermediate Event
- SignalRef
- The Signal code that is to be sent or consumed
- CancelActivity
- if the Event is place on the boundary of an Activity and the Cancel Activity property is set to
true, the Activity execution is cancelled immediately when the Event receives its Escalation object.
A.7.2.2.12.2. Catching Signal Intermediate Event
- SignalRef
- reference code of the expected Signal object
A.7.3. End Events
A.7.3.1. End Event types
A.7.3.1.1. Simple End Event
Important
true.
A.7.3.1.2. Message End Event
A.7.3.1.3. Escalation End Event
A.7.3.1.4. Terminate End Event
Note
Terminate property in the Property tab of the Simple End Event as true.
A.7.3.1.5. Throwing Error End Event
Attributes
- ErrorRef
- reference code of the produced Error object
A.7.3.1.6. Cancel End Event
A.7.3.1.7. Compensation End Event
A.7.3.1.8. Signal End Event
A.7.4. Scope of Events
- : The throw event is set to default scope when no scope is selected. In this case, the signal is given a ksession and it signals only the elements known to that ksession. The signal behavior depends on the strategy used:
- Singleton: In this case, the event signals all instances available for this ksession.
- Per request: In this case, the event signals only currently processed process instance and those with start signal events.
- Per process instance: In this case, similar to the per request strategy, the event signals only currently processed process instance and those with start signal events.
- : This indicates that the scope of the signal remains within the same process instance that the signal is thrown from.
- /: This indicates that either the scope of the signal is bound to runtime manager or that it signals runtime manager that the instance is bound to.
- : This indicates that the scope of the signal can be both project scope and cross deployments. For the signal to have a cross deployment scope, it requires to have a process variable called
SignalDeploymentId. TheSignalDeploymentIdprocess variable provides information about which deployment/project must be the target of the signal.
A.8. Gateways
A.8.1. Gateways
- Parallel (AND): in a converging gateway, waits for all incoming Flows. In a diverging gateway, takes all outgoing Flows simultaneously;
- Inclusive (OR): in a converging gateway, waits for all incoming Flows whose condition evaluates to true. In a diverging gateway takes all outgoing Flows whose condition evaluates to true;
- Exclusive (XOR): in a converging gateway, only the first incoming Flow whose condition evaluates to true is chosen. In a diverging gateway only one outgoing Flow is chosen.
- Event-based: used only in diverging gateways for reacting to events. See Section A.8.2.1, “Event-based Gateway”
- Data-based Exclusive: used in both diverging and converging gateways to make decisions based on available data. See Section A.8.2.4, “Data-based Exclusive Gateway”
A.8.2. Gateway types
A.8.2.1. Event-based Gateway
A.8.2.2. Parallel Gateway
- Diverging
- Once the incoming Flow is taken, all outgoing Flows are taken simultaneously.
- Converging
- The Gateway waits untill all incoming Flows have entered and only then triggers the outgoing Flow.
A.8.2.3. Inclusive Gateway
- Diverging
- Once the incoming Flow is taken, all outgoing Flows whose condition evaluates to true are taken. Connections with lower priority numbers are triggered before triggering higher priority ones; priorities are evaluated but the BPMN2 specification doesn't guarantee this. So for portability reasons it is recommended that you do not depend on this.
Important
Make sure that at least one of the outgoing Flow evaluates to true at runtime; otherwise, the process instance terminates with a runtime exception. - Converging
- The Gateway merges all incoming Flows previously created by a diverging Inclusive Gateway; that is, it serves as a synchronizing entry point for the Inclusive Gateway branches.
Attributes
- Default gate
- The outgoing Flow taken by default if no other Flow can be taken
A.8.2.4. Data-based Exclusive Gateway
- Diverging
- The Gateway triggers exactly one outgoing Flow: the Flow with the constraint evaluated to true and the lowest Priority is taken. After evaluating the constraints that are linked to the outgoing Flows: the constraint with the lowest priority number that evaluates to true is selected.
Important
Make sure that at least one of the outgoing Flows evaluates to true at runtime: if no Flow can be taken, the execution returns a runtime exception. - Converging
- The Gateway allows a workflow branch to continue to its outgoing Flow as soon as it reaches the Gateway; that is, whenever on of the incoming Flows triggers the Gateway, the workflow is sent to the outgoing Flow of the Gateway; if it is triggered from more than one incoming connection, it triggers the next node for each trigger.
Attributes
- Default gate
- The outgoing Flow taken by default if no other Flow can be taken
A.9. Activities, Tasks and Sub-Processes
A.9.1. Activity
"An Activity is work that is performed within a Business Process." [7]
A.9.2. Activity mechanisms
A.9.2.1. Multiple instances
A.9.2.2. Activity types
A.9.2.2.1. Call Activity
Attributes
- Called Element
- ID of the Process to be called and instantiated by the Activity
A.9.3. Tasks
A.9.3.1. Task types
None Task or the Abstract Task (deprecated).
User Task.
A.9.3.2. Generic Task
"Abstract Task: Upon activation, the Abstract Task completes. This is a conceptual model only; an Abstract Task is never actually executed by an IT system." [9]
A.9.3.3. Send Task
"Send Task: Upon activation, the data in the associated Message is assigned from the data in the Data Input of the Send Task. The Message is sent and the Send Task completes." [10]
Attributes
- MessageRef
- the MessageRef of the generated Message
A.9.3.4. Receive Task
"Upon activation, the Receive Task begins waiting for the associated Message. When the Message arrives, the data in the Data Output of the Receive Task is assigned from the data in the Message, and Receive Task completes." [11]
Attributes
- MessageRef
- the associated Message
A.9.3.5. Manual Task
"Upon activation, the Manual Task is distributed to the assigned person or group of people. When the work has been done, the Manual Task completes. This is a conceptual model only; a Manual Task is never actually executed by an IT system." [12]
A.9.3.6. Service Task
ServiceTaskHandler to invoke Java methods or Web Services.
Attributes
- Implementation
- The underlying technology that will be used to implement this task. You can use
unspecifiedorWebServicewhereWebServiceis the default value. - OperationRef
- This attribute specifies the operation that is invoked by the Service Task. (typically method of Java class or method of WebService).
A.9.3.7. Business Rule Task
Attributes
- RuleFlow Group
- the name of the rule flow group that includes the set of rules to be evaluated by the Task
A.9.3.8. Script Task
- Avoid low-level implementation details in the Process: A Script Task could be used to manipulate variables but other concepts like a Service Task should be your first choice when modeling more complex behavior in a higher-level manner.
- The script should be executed immediately; if there is the possibility that the execution could take some time, use an asynchronous Service Task.
- Avoid contacting external services through a Script Task: it would be interacting with external services without the knowledge of the engine, which can be problematic. Model communication with an external service using a Service Task.
- Scripts should not throw exceptions. Runtime exceptions should be caught and for example managed inside the script or transformed into signals or errors that can then be handled inside the process.
Attributes
- Script
- script to be executed
- ScriptLanguage
- language the script is defined in (currently supported languages are Java, JavaScript, and MVEL)
- Select a Script Task object from the Object Library menu on the left hand side and add it to the process design tool.
- In the Properties panel on the right hand side, open the property.
- Add the script to be executed to the Expression Editor and click .
Example A.8. Script Task in Business Central using JavaScript

A.9.4. Sub-Process
- Ad-Hoc Sub-Process: Sub-Process with no strict Element execution order
- Embedded Sub-Process: a "real" Sub-Process that is a part of the Parent Process execution and shares its data
- Reusable Sub-Process: a Sub-Process that is independent from its parent Process
- Event Sub-Process: a Sub-Process that is only triggered on a start event or a timer.
A.9.4.1. Embedded Sub-Process
A.9.4.2. AdHoc Sub-Process
Attributes
- AdHocCompletionCondition
- the condition that once met the execution is considered sucessful and finishes
- AdHocCancelRemainingInstances
- if set to
true, once the AdHocCompletionCondition is met, execution of any Elements is immediately cancelled
A.9.4.3. Multi-instance Sub-Process
Attributes
- Collection expression
- Variable that represents the collection of elements that are to be iterated over (The variable must be an array or be of the java.util.Collection type.)If the collection expression evaluates to null or an empty collection, the Multi-Instances Sub-Process is completed immediately and the outgoing flow is taken.
- Variable Name
- Variable that will store the collection element used in the currently running iteration
A.9.4.4. Event Sub-Process
A.9.5. User Task
"A User Task is a typical 'workflow' Task where a human performer performs the Task with the assistance of a software application and is scheduled through a task list manager of some sort." [17]
GroupID, it is displayed in Task lists of all users that are members of the group: any of the users can claim the Task. Once claimed, the Task disappears from the Task lists of the other users.
Attributes
- Actors
- comma-separated list of users who are entitled to perform the generated User Task
- Comment
- A comment associated with this User Task. The JBoss BPM Suite Engine does not use this field but business users can enter extra information about this task.
- Content
- The data associated with this task. This attribute does not affect TaskService's behavior.
- CreatedBy
- name of the user or ID of the Process that created the task
- GroupID
- comma-separated list of groups who are entitled to perform the generated User Task
- Locale
- locale the Element is defined for. This was intended to support internationalization (i18n), but this property is not used by the JBoss BPM Suite engine at the moment.
- Notifications
- Definition of notification applied on the Human Task (refer to Section A.9.5.3, “Notification”)
- Priority
- Integer value defining the User Task priority (the value influences the User Task ordering in the user Task list and the simulation outcome)
- Reassignment
- Definition of escalation applied on the Human Task (refer to Section A.9.5.2, “Reassignment”)
- ScriptLanguage
- One of Java or MVEL.
- Skippable
- Boolean value that defines if the User Task can be skipped (if
true, the actor of the User Task can decide not to complete it and the User Task is never executed) - Task Name
- Name of the User Task generated on runtime (displayed in the Task List of Business Central)
A.9.5.1. User Task lifecycle
Created stage. This is usually a transient state and the User Task enters the Ready state immediately: the User Task appears in the Task Lists of all actors that are allowed to execute the task. As soon as one of the actors claims the User Task to indicate they are executing it, the User Task becomes Reserved. If a User Task has only one potential actor, it is automatically assigned to that actor upon creation. When the user who has claimed the User Task starts the execution, the User Task status changes to InProgress. On completion, the status changes to Completed or Failed depending on the execution outcome.
A.9.5.2. Reassignment
- not started:
READYorRESERVED - not completed:
IN_PROGRESS
Users: comma-separated list of user IDs that are reassigned to the task on escalation (Strings or expressions #{user-id})Groups: comma separated list of group IDs that are reassigned to the task on escalation (Strings or expressions #{group-id})Expires At: time definition when escalation is triggered (String values and expressions #{expiresAt}; for information on time format, refer to Section A.5, “Timing”)Type: state the task needs to be in at the given Expires At time so that the escalation is triggered.
A.9.5.3. Notification
- not started:
READYorRESERVED - not completed:
IN_PROGRESS
Type: state the User Task needs to be in at the given Expires At time so that the notification is triggeredExpires At: time definition when notification is triggered (String values and expressions #{expiresAt}; for information on time format, refer to Section A.5, “Timing”)From: user or group ID of users used in the From field of the email notification message (Strings or expressions)To Users: comma-separated list of user IDs the notification is to be sent to (Strings or expressions #{user-id})To Groups: comma separated list of group IDs the notification is to be sent to (Strings or expressions #{group-id})Reply To: user or group ID that receives any replies to the notification (Strings or expressions #{group-id})Subject: subject of the email notification (Strings or expressions)Body: body of the email notification (Strings and expression)
Available variables
#{processVariable}) and Task variables (${taskVariable}).
taskId: internal ID of the User Task instanceprocessInstanceId: internal ID of Task's parent Process instanceworkItemId: internal ID of a work item that created the User TaskprocessSessionId: knowledge session ID of the parent Process instanceowners: list of users and groups that are potential owners of the User Taskdoc: map that contains regular task variables
Example A.9. Body of notification with variables
<html>
<body>
<b>${owners[0].id} you have been assigned to a task (task-id ${taskId})</b><br>
You can access it in your task
<a href="http://localhost:8080/jbpm-console/app.html#errai_ToolSet_Tasks;Group_Tasks.3">inbox</a><br/>
Important technical information that can be of use when working on it<br/>
- process instance id - ${processInstanceId}<br/>
- work item id - ${workItemId}<br/>
<hr/>
Here are some task variables available
<ul>
<li>ActorId = ${doc['ActorId']}</li>
<li>GroupId = ${doc['GroupId']}</li>
<li>Comment = ${doc['Comment']}</li>
</ul>
<hr/>
Here are all potential owners for this task
<ul>
$foreach{orgEntity : owners}
<li>Potential owner = ${orgEntity.id}</li>
$end{}
</ul>
<i>Regards from jBPM team</i>
</body>
</html>A.10. Connecting objects
A.10.1. Connecting Objects
- Sequence Flow, which connect Flow elements of a Process and define the flow of the execution (transport the token from one element to another)
- Association Flow, which connect any Process elements but have no execution semantics
A.10.2. Connecting Objects types
A.10.2.1. Sequence Flow
Properties
- Condition Expression
- A condition that needs to be true to allow the workflow to take the Sequence FlowIf a Sequence Flow has a Gateway element as its source, you need to define a Conditional Expression, which is evaluated before the Sequence Flow is taken. If false, the workflow attempts to switch to another Sequence Flow. If true, the Sequence Flow is taken.When defining the condition in Java, make sure to return a boolean value:
return <expression resolving to boolean>;
- Condition Expression Language
- You can use either Java or Drools to define the Condition Expression.
Note
kcontext variable, which holds the Process instance information.
A.11. Swimlanes
A.11.1. Lanes
"A Lane is a sub-partition within a Process (often within a Pool)... " [18]
analyst value. When the Process is started, and UT1 is claimed/started/completed by an analyst user, UT2 gets claimed and assigned to the user who completed UT1. On the other hand, if only UT1 had the analyst group assigned, and UT2 had no user or group assignments, the process would stop after UT1 had been completed.
A.12. Artifacts
A.12.1. Artifacts
A.12.2. Data Objects
Appendix B. Service Tasks
Note
B.1. Log Task
Input attributes
- Message
- the log message text
B.2. Email Task
Input attributes
- To
- the recipient of the email
- From
- the sender of the email
- Subject
- the subject of the email
- Body
- the body of the email
B.3. REST Task
Input attributes
- Method
- the REST method of the call (such as,
GET,POST, etc.) - ConnectTimeout
- the call timeout
- Username
- the user name to be used to perform the call
- Password
- the user password
- ReadTimeout
- timeout on response receiving
- Url
- target URL including the request body
Output attributes
- Result
- string with the result of the call
B.4. WS Task
Input attributes
- Parameter
- The object or array to be sent for the operation
- Mode
- One of SYNC, ASYNC or ONEWAY.
- Interface
- The name of a service. For example:
Weather - Namespace
- namespace of the web service, such as
http://ws.cdyne.com/WeatherWS// - URL
- the web service URL, such as
http://ws.cdyne.com/ - Operation
- the actual method name to call
Output attributes
- Result
- object with the result
Appendix C. Simulation data
C.1. Process
Simulation attributes
- Base currency
- currency to be used for simulation
- Base time unit
- time unit to apply to all time definitions in the Process
C.2. Start Event
Simulation attributes
- Wait time
- time to wait as to simulate the execution of the Start Event
- Time unit
- time unit to be used for the wait time property
C.3. Catching Intermediate Events
Simulation attributes
- Wait time
- time to wait as to simulate the execution of the Catching Intermediate Event
- Time unit
- time unit to be used for the wait time property
C.4. Sequence Flow
Simulation attributes
- Probability
- probability the Flow is taken in percentThe probability value is applied only if the Flow's source element is a Gateway and there are multiple Flow elements leaving the Gateway. When defining Flow probabilities, make sure their sum is 100.
C.5. Throwing Intermediate Events
Simulation attributes
- Distribution type
- distribution type to be applied to the processing time values
C.6. Human Tasks
Simulation attributes
- Cost per time unit
- costs for every time unit lapsed during simulation
- Currency
- currency of the cost per unit property
- Staff availability
- number of actors available to work on the given Task
Example C.1. Staff availability impact
Let's assume a simulation of 3 instances of a Process. A new instance is created every 30 minutes. The Process contains a None Start Event, a Human Task, and a Simple End Event. The Human Task takes 3 hours to complete, the Working hours is set to3. We have only one person to work on the Human Tasks, that is Staff availability is set to1. That results in the following:- The Human Task generated by the first Process instance will be executed after 3 hours;
- The Human Task generated by the second Process instance will be executed in approx. 6 hours (the second Process instance is created after 30 minutes; however, the actor is busy with the first Task; he becomes available only after another 2.5 hours, and takes 3 hours to execute the second Task).
- The Human Task generated by the third Process instance will be executed in approx. 9 hours (the second Human Task instance is finished after 3 hours; the actor needs another 3 hours to complete the third Human Task).
- Working hours
- time period for simulation of the Task execution
C.7. Service Tasks
Simulation attributes
- Cost per time unit
- costs for every time unit lapsed during simulation
- Currency
- currency of the cost per unit property
- Distribution type
- distribution type to be applied to the element execution time
C.8. End Events
Simulation attributes
- Distribution Type
- distribution type to be applied to the element execution time
C.9. Distribution types
normal: bell-shaped, symmetricaluniform: rectangular distribution; every score (time period) is applied the same number of timesPoisson: negatively skewed normal distribution
C.9.1. Normal
Normal distribution type
- Processing time (mean)
- mean processing time the element needs to be processed (in time unit defined in the time units property)
- Standard deviation
- standard deviation of the processing time (in time unit defined in the time units property)
- Time unit
- time unit to be used for the mean processing time and standard deviation values
C.9.2. Uniform
Uniform distribution type
- Processing time (max)
- maximum processing time of the element
- Processing time (min)
- minimum processing time of the element
- Time unit
- time unit to be used for the processing time values
C.9.3. Poisson
Poisson distribution type
- Processing time (mean)
- mean time for the element processing (in time unit defined in the time units property)
- Time unit
- time unit to be used for the mean processing time
Appendix D. Revision History
| Revision History | |||
|---|---|---|---|
| Revision 6.2.0-4 | Thu Apr 28 2016 | ||
| |||
| Revision 6.2.0-3 | Tue Mar 29 2016 | ||
| |||
| Revision 6.2.0-2 | Mon Nov 30 2015 | ||
| |||
| Revision 6.2.0-1 | Mon Nov 30 2015 | ||
| |||



