cancel
Showing results for 
Search instead for 
Did you mean: 

System Exception Behavior/Handling on Activiti Engine

bgitaadji
Champ in-the-making
Champ in-the-making
I have questions on Activiti engine behavior when a System-Task (Java Delegate) throws a Java System Exception
1. When a system task on a main path throws a System Exception, what happened to the process instance ? did it die ? suspended ?
2. When a system task on a parallel path throws a System Exception, what happened to the process instance ? did all the process instance die or only that parallel path is stopped ? suspended ?
3. How do I find out if a process instance has an issue with System Exception being thrown ? any REST API Query to find out which processes have completed and which ones have stopped due to Exceptions ?
4. We use REST API to start a process instance, how do we find out the stack trace for a specific process-instance-id with a System Exception issue ? any enterprise level logging info can be enabled from REST API ?

Thanks
6 REPLIES 6

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi bgitaadji,

ad 1,2 : The transaction is rolled back to the latest wait state. http://activiti.org/userguide/index.html#bpmnConcurrencyAndTransactions
ad 3: The response is returned to the event initiator. (e.g I complete user task through REST API. Next service task throws an exception. The exception is propagated as a response to this REST API call.) Another type of error handling is handling of asynchronous jobs http://activiti.org/userguide/index.html#failRetry.
ad 4: logging configuration is managed by the possibilities of the underlying logging framework.

Regards
Martin

bgitaadji
Champ in-the-making
Champ in-the-making
Additional question:
1. what is the best practice for handling/cleaning-up the unfinished processes that experience System Exception ? To remove/delete, archive them, etc ?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

additional 1)  it depends on the business requirements

Regards
Martin

bgitaadji
Champ in-the-making
Champ in-the-making
so what are the available options ?

bgitaadji
Champ in-the-making
Champ in-the-making
Additional question:
- How do find out if a process instance has not finished due to System Exception or just waiting for User Task or Timer ?

jbarrez
Star Contributor
Star Contributor
For starters, your logs will show it.
If it's an async task, the exception will be stored in the job database and you can query for it.