Using jBPM In An Architecture Based on Spring
by, 04-27-2012 at 06:52 PM (1098 Views)
Spring itself needs only to have the Spring modules jar on the class path. See the included project's root pom.xml for the minutiae of our particular installation. I expect this project could be made to work with Spring 1.x, with some work. I'm using some of the fancy new name spaces, so it won't work directly.
The beans jbpmConfiguration and jbpmTemplate (inside of services/services-engine/src/main/resources/service-context.xml) configure the jBPM integration. jbpmTemplate – provided by the Spring Modules integration -- is what our client (the service) will use to interact with the processes at runtime.
Hibernate is an Object-Relational Mapping engine by which you persist your domain model into a database. jBPM implements the domain model of the process engine in Hibernate, so you need to configure that when using it. The main upshots to this are that the process engine itself is transactional and easily programmed. In our spring application context we have configured the Hibernate classes as you might any Spring/Hibernate integration. Refer to the spring application context XML for the data source and the mapping listing pointing to al the Hibernate HBM files for the jBPM engine. In the jBPM configuration, I've left the schemaUpdate property set to true, for development. Hibernate will try and create the tables for you inside the database you've configured. You should disable this after you've gotten your model loaded successfully. The configuration of the database engine itself is also pretty standard: specifics are stored in the properties file ( services/services-engine/src/main/resources/service-context.properties), which are macro replaced in the application context.