Chapter 6. Integration

Red Hat JBoss BRMS provides integration modules for integrating BRMS with other frameworks, namely Spring and Apache Camel. These modules are provided in the generic deployment package. See Installation Guide for more details.
This section provides information about these modules and how to configure them.
Refer to the Red Hat JBoss BRMS Installation Guide to download the Apache Spring module. You will need to download the generic deployable version of BRMS.
The Spring module is present in the jboss-brms-engine.zip file and is called kie-spring-VERSION-redhat-MINORVERSION.jar.
How you intend to use the Spring modules in your application affects how you configure them.

As a Self Managed Process Engine

This is the standard way to start using BRMS in your Spring application. You only configure it once and run as part of the application. Using RuntimeManager API, perfect synchronization between process engine and task service is managed internally and the end user does not have to deal with the internal code to make these two work together.

As a Shared Task Service

When you use a single instace of a TaskService, you have more flexibility in configuring the task service instance as it is independent of the RuntimeManager. Once configured it is then used by the RuntimeManager when requested.
To create a RuntimeEnvironment from your Spring application, you can use the org.ie.spring.factorybeans.RuntimeEnvironmentFactoryBean class. This factory class is responsible for producing instances of RuntimeEnvironment that are consumed by RuntimeManager upon creation.
The following RuntimeEnvironment can be created or configured:
  • DEFAULT - default (most common) configuration for RuntimeManager
  • EMPTY - completely empty environment to be manually populated
  • DEFAULT_IN_MEMORY - same as DEFAULT but without persistence of the runtime engine
  • DEFAULT_KJAR - same as DEFAULT but knowledge asset are taken from KJAR identified by releaseid or GAV
  • DEFAULT_KJAR_CL - build directly from classpath that consists kmodule.xml descriptor
Depending upon the selected type, there are different mandatory properties that are required. However, at least one of the following knowledge properties must be provided:
  • knowledgeBase
  • assets
  • releaseId
  • groupId, artifactId, version
Finally, for DEFAULT, DEFAULT_KJAR, DEFAULT_KJAR_CL types, persistence needs to be configured in the form of values for entity manager factory and transaction manager.