cancel
Showing results for 
Search instead for 
Did you mean: 

Error Handling in MultiInstance parallel Subprocess

riddhishah1604
Champ in-the-making
Champ in-the-making
Hi,

I need to handle technical exceptions, for ex: remote server host is down while making a webservice call, inside multi instance parallel subprocess.

For ex:
Subprocess is executed on list of 4 items. I have a webservice call inside the subprocess logic. Hence all these 4 execution paths will make a call to web service. If one of the web service call is failed due to technical error, How can i handle it?
I noticed if i keep async:true on webservice call, then i can see the failed jobs in Jobs menu of Manage on explorer. Is this correct way? Do i need to keep async:true wherever i want to handle technical exceptions?

If i execute this failed job from Manage, will that resume the particular execution path that failed or will it create 4 new execution paths?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
If you don't specify the "async=true", the calling thead (your app thread that calls the activiti API) will be used to make the process flow. if one of the 4 paths cause an error during this flow, the whole transaction is rolled back and the calling thread gets an Exception. It's up to your app to handle it than.

If you use "async=true" on the subprocesses, they will be executed asynchronously. The calling thread will return immediately, and the only way of knowing something went wrong is to check the process afterwards. Indeed, failed jobs will be available in the job-table. In case you retry the job, only the failed execution will be retried again.
On top of that, only WHEN ALL of the 4 async executions have succeeded (either instantly or after retry), the process will continue with the steps after this.