I’m a Beginner in Flowable engine I have question regarding i have long running sync process i need to know how Spring boot Application handle Flowlowable engine restart does the running proccess can consume after restart the Spring Boot Application
The term “process” is overloaded, are you using it to describe a business process or an execution (like a service task) that is long running? The answer to your question really depends on what you are describing, but to help you out I’ll describe how Flowable handles keeping track of a business process’s state.
In general Flowable database transactions to manage process state. These transactions span from one wait state to the next, if an error occurs the transaction is rolled back. In the case of an instance that is killed, the transaction would not be committed allowing another instance to pick up the business process at the last wait state. One way to introduce a wait state is to mark a task as asynchronous, which will cause the business process to wait and put a job in the job queue to be executed “later” (usually “later” is almost immediately). The job executer will pick up jobs in the queue and run them and retry them automatically if they error out.
Below I’ve linked an article on asynchronous tasks, it also discusses wait states in great length:
Thanks for Reply here are sample of sync process user pro-vising task how should flowable do in case of restart the spring boot Flowable engine. what i found that there are no data in history for this process it can be dropped
If every one of your service tasks are executed synchronously, then if the application exits while the process is running there will be nothing saved to the database. This is because there are no wait states to trigger a commit to the database. As a result, there will be nothing to resume.
If some or all of the service tasks get marked as asynchronous, then those tasks will cause a wait state. When the process reaches asynchronous tasks, it will commit a job to the job queue. A job executer then picks up the job and enters a lock. If the application gets killed while that job is running, another instance of the application can pick it back up once the lock expires, at which point it will continue on.
Thanks a lot for your rep;y it was helpful reply i have one other concern regarding the process when i restart the Spring Boot Application it doesn’t resume the old running process is there any way to resume the process after restarting the Flowable Engine
Let’s assume every one of your service tasks is flagged as async and there is only a single instance of the application running. In this case if the application get restarted the job that it was currently executing does not finished. There is a lock with an expire time placed on the job in table
ACT_RU_JOB. You now have two options:
- Wait a few minutes for the lock to expire
- Manually expire the lock in the database
Option one is the safest, it lets the engine recover on its own in a predictable way. It’s also the only option I would recommend if you ever scale to more than one instance.
Option two lets you continue on right away at the expense of some risk that you might corrupt the data by doing a manual update.