While flowable interacting with MULTIPLE other systems?, How can we handle transaction management, and is there any rollback mechanism to be followed?
maybe this will help? http://www.flowable.org/docs/userguide/index.html#bpmnConcurrencyAndTransactions
yeah, this may help as startup, but required more info. on rollback and communication between other systems.
If the external system is transactional, you can make it participate with the transactions the Flowable engines use. One typical option would be JTA, there is a JTAProcessEngineConfiguration for this. Otherwise, when using Spring, it’s possible to use a Spring transaction manager and inject this into the process engine configuration. The engine won’t create transactions itself in both cases, but participate in those created by the external system.
See for example https://github.com/flowable/flowable-examples/blob/725a6c7d208df9094f61360a55d9140d010bffae/async-history/async-history-jms-jta-cfg/src/main/java/org/flowable/Configuration.java for a Spring configuration that uses JTA (in this example the JMS queue participates in the JTA transaction).
Thanks for Information
But here my external system interact with Flowable BPM by REST api calls, then how can we handle this or can i allow rollback flowable DB on any failure?
If you use the REST API to interact with Flowable then every REST call will run a transaction in Flowable and if something fails the whole transaction will be rolled back. But if something fails in the application calling the Flowable REST API this doesn’t happen and you would need to write specific compensate logic to solve it. The only way to integrate it with the transaction management of your application would be to use Flowable in an embedded way, then it can run as part of the transaction of your application.
what is the meaning of integrating transaction management in embedded way?,
can i have any sample code for fixing this?, and we are struck here and not able to move forward with flowable.
You are stuck for 2 months already?
What I mean is that if you run the Flowable Engine embedded in your application (by adding the flowable-engine maven dependency and starting the Flowable Engine in your application), you can reuse the transaction manager you are using for your application for the Flowable Engine. So if you have a process definition with a couple of service tasks doing database calls or putting a message on a queue, all the logic will run in the same transaction. So when a process instance fails for some reason, all the database updates etc that were done in the same transaction will be rolled back together with the Flowable Engine changes. You can have a look at the flowable-spring module for example, there are some tests that use the Spring transaction manager.
Thanks for quick reply Tija, will try as per your suggestion
my flowable application is not running in embedded way, and my flowable application deployed in a separate tomcat server and another java application interacts through REST api calls.
i need to maintain a transaction between these two applications.
if total 5 transactions are there, and first 2 are happening at java application, 3rd one is happening by calling flowable application through rest calls from java application.
and 4 and 5 transactions are happening at java application.
(Trans-1,2 at java and 3 at flowable ,4,5 at java application again)
in the above scenario, if there is a system failure happend at 5 point, How can i roll back all including flowable transaction happend at Transaction-3.
If you have found a way to deal with transactions over REST calls I’m very interested to know more about that. Otherwise, you could implement compensation logic in the process definition to rollback the necessary logic when this happens.