Using advanced process integration techniques becomes essential as you evolve your developer skills while integrating more and more of your business workflows. One of the more common questions is how to persist custom data and configure external persistence?

When working with processes, it is expected to work with persistent process data scenarios. Considering this situation, it is common for users to use a different database to store process data, apart from the database where the domain information is stored.

As an example, storing critical information from customers apart from the engine database is an expected data architecture. In this way, the user can maintain the data consistent and isolated. But what if these objects, stored in a different database, needs to be used in one of the business automation projects?


_Many of the concepts here applied are valid for any application which involves distributed transactions (XA Transactions), this means, any application which might possibly have a transaction which spawns through two or more different databases. An overview of how application deployed in Java EE application servers, communicates with a database can be found at this blog post: _Datasources, what, why, how?


Let’s explore configuring and accessing different databases within the same project.

Pluggable Variable Persistence (PVP)

Here are the steps required to make a process store its process variables, known as domain information, in a different database:

  1. Configure the app server datasource pointing the database where you want to store the custom data
  2. Make sure custom POJOs (the object to be persisted) are a JPA object
  3. Data Object must implement Serializable interface
  4. Must be a JPA Entity
  5. Must have a unique id, a primary key
  6. Configure business automation project
  7. Configure a JPA Marshalling Strategy
  8. Configure the persistence unit (pointing to the datasource mentioned on the first step)

Once this is done, every time this object gets created or updated during the process execution, it will be properly persisted on the database. Let’s test this out by getting hands-on with the following exercise.

#java #tutorial #integration #jboss #persistence #red hat #howto #jbpm #process automation #process integration

Advanced Process Integration Tips -Configuring External Persistence
1.45 GEEK