cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Manager and Asyncrhonous Continous

alexisgc
Champ in-the-making
Champ in-the-making
I would like to know how is the exception manager in Activiti. Exist a way to restore a Process Instance after it's execution was interrupted? I've constructed some flows and I saw that the execution's variables are saved only when a "User Task" will be executed, in other cases (when don't exist any "User Task" in the flow) execution variables aren't saved, so that originate my question "How can I re-launch the Process Instance in a exception case if the execution variables weren't saved?", I suppose exist a way to re-initiate the flow since the last Task executed correctly and for that is necessary to have the execution variables.
Please, could you tell me if the last released version of Activiti could do that or if that feature will be included in future releases?.

PS: Sorry for my bad English.
4 REPLIES 4

croman
Champ in-the-making
Champ in-the-making
Exist another post with the same question but without a response. This point is very important to determine if Activiti is prepared to be used in a Production environment.

Please Tom, Joram, could you give us a response? Thank you.

trademak
Star Contributor
Star Contributor
Hi,

Good question. When an exception occurs in a flow of activities without a wait state, the process gets rolled back to its begin point and no execution variables are saved. When there is a wait state (like a user task) in the process, and the exception occurs after that wait state, the process is rolled back to the wait state so the execution variables for that wait state are still available in the database.
BPMN 2.0 has throw and catch exception event constructs and this will probably be implemented in the coming months, but that doesn't help you yet.
So for the current version, you should seek for a way to catch an exception. For example in a Java service task you can of course catch the exception.
Maybe you can elaborate a bit more about the process you want to implement so I can think together with you to get to a solution.

Best regards,

Tijs

alexisgc
Champ in-the-making
Champ in-the-making
Thanks for your answer Tijs,

I would like to create a flow composed only by "Service Tasks", I would like to have this two features:
1.- When an exception occurs, other flow is launched, this new flow will be composed by tasks like: write log, send e-mail, etc.
2.- Save information about the execution variables in the last task executed correctly.

I want to implement a Console to correct the exception's cause and then give the possibility to re-launch the process from the task where the exception occured, I don't want to execute the flow since the first task because my process is very complex and some task could take a considerable time to be completed.

This is the process that I want to implement, any ideas are much appreciated. Thank you.

Best regards,

Alexis Gamarra

trademak
Star Contributor
Star Contributor
Hi Alexis,

Okay I understand your use case.
Just an idea to solve this. Catch exceptions in your service tasks and set a specific process variable (e.g. executionOccurred is true) when an exception occurs. After each service task make an exclusiveGateway to check on the value of this process variable. If an exception has occurred start a sub process with a call activitiy. In this sub process you can then log stuff and send out an e-mail etc. It's currently not possible to pass variables to a standalone sub process, so I would recommend an embedded sub process for that. Then you can  "re-lauch" the main process flow when the sub process is finished and invoke the service task that went wrong again.
Hope this provides some help for you.

Best regards,

Tijs
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.