JBoss BPMSuite provides multiple components to integrate the process-engine and processes with various kinds of back-end services and systems. Out-of-the-box the platform provides a WS-* web-services component, a RESTful services component and even an Apache Camel based integration component that allows one to utilise the extensive library of Camel integration components.
If no out-of-the-box integration is available, BPMSuite provides a simple extendible WorkItemHandler API that allows one to easily add 'custom' integration logic to the platform.
Recently I got a question from a colleague how to integrate BPMSuite with JBoss DataGrid, the Red Hat Enterprise in-memory DataGrid product based on the upstream Infinispan project (an extremely scalable, high available, key-value store and datagrid platform).
JBoss DataGrid provides a lightweight, high-performant, remoting protocol called HotRod. The JBoss DataGrid distribution provided by Red Hat provides a small JDG-client modules package that can be deployed as module-layer on JBoss EAP, and thus on JBoss BPMSuite.
To integrate BPMSuite with JDG, we first wrote a new InfinispanWorkItemHandler. This WorkItemHandler uses the aforementioned HotRod protocol to communicate with a remote JBoss DataGrid Server instance (or cluster). This WorkItemHandler can then be added to the BPMSuite project as a custom node task.
The JBoss DataGrid integration makes it possible for business processes to both store (PUT) key-value pairs in, and retrieve (GET) key-value pairs from a JBoss DataGrid cluster. This allows processes to reliably store and access high-volumes of in-memory data with high-speed and low-latency.
Furthermore, the integration allows the process designer to point to a single node JDG instance endpoint, or to provide a list of endpoints in a JDG cluster for high-availability and fail-over purposes
A canned demo based on Docker is available, which demonstrates the integration of JBoss BPMSuite and JBoss DataGrid: https://github.com/DuncanDoyle/bpms-datagrid-demo To be able to run the demo, both "Docker" and "docker-compose" are required.
The demo provides a very simple, technical BPMN2 process that demonstrates storing data in, and retrieving data from a JBoss Data Grid cluster (the demo uses a single node, but this can be easily expanded to a multi-node grid). The demo is not intended to demonstrate a real-life business process, but shows the possibilities a process designer has to integrate business processes with a JDG cluster using the InfinispanWorkItemHandler.
A 'key' has to be entered when the process starts. The first node tries to retrieve the 'value' from JDG. If the 'value' is not present, the process creates a HumanTask to enter a new 'value'. If the 'value' is present in the grid, the process creates a HumanTask that allows the user to change the 'value'. Finally, the new or updated value is stored in JDG.
A 'key' has to be entered when the process starts. The first node tries to retrieve the 'value' from JDG. If the 'value' is not present, the process creates a HumanTask to enter a new 'value'. If the 'value' is present in the grid, the process creates a HumanTask that allows the user to change the 'value'. Finally, the new or updated value is stored in JDG.
To run the demo:
- Copy the required distributions (JBoss EAP, JBoss BPMSuite, etc) to the "installs" directory.
- Run the "prepare-demo.sh" script: this will download the required dependencies (PostgreSQL libraries, WorkItemHandler project, etc.), prepare the Maven repository for our WIH, etc.
- Run the "build-docker-images.sh" script: this will build the 3 Docker images.
- Start the demo using the "start-docker-containers.sh" script.
The demo consists of 3 Docker containers:
- PostgreSQL: provides the JBoss BPMSuite database
- JBoss DataGrid Server 6.6.0
- JBoss BPMSuite 6.2.0.GA
Apart from demonstrating the integration between BPMSuite and DataGrid, the demo therefore also demonstrates:
- Configuring and using an enterprise-class RDBMS (PostgreSQL) with JBoss BPMSuite.
- Making external WorkItemHandlers available to JBoss BPMSuite (without the need to manually upload the artefact to the platform).
- Adding additional JBoss EAP module-layers (PostgreSQL, DataGrid client) to JBoss BPMSuite to be used by the process-engine and processes.
Happy BPM'ing!