jerryfiunam (61) [Avatar] Offline
#1
Hi again,

I have implemented some prcesses in my web app using activiti. Yesterday a launched a process that has a ServiceTask that calls a Web Service, but unfortunatelly that service failed, hence, my process instance. In this case was a ServiceTask but generally speaking could be any kind of activity. I wonder if there is a way to detect process instances that have failed and if there is a way to retry the THE ACTIVITY THAT FAILED IN THE PROCESS INSTANCE in order to make the same process instance to continue. What I had to do is to cancel my process instance and lanchued it again once the problem with the web service was fixed. I have read something about INCIDENT HANDLING in CAMUNDA VERSION, I wonder if exists any mechanisim in Activiti to detect that kind of failures, and retry failed steps in the process instance. In case it does not exist yet, I would like to know some ideas about this to workaround in a solution.

Thanks for your attention.

Regards,

Jerry
tijs.rademakers (494) [Avatar] Offline
#2
Re: Handling erros in Process Instances. How to retry a failed step?
Hi Jerry,

This is exactly what the job executor can provide for you. When you make that service task async="true" then the job executor will try to execute the service task 3 times. When it still fails after the 3rd try it will not retry anymore and wait for manual intervention. You can query for failed jobs with the Job query in the ManagementService and execute the job.

Best regards,

Tijs
jerryfiunam (61) [Avatar] Offline
#3
Re: Handling erros in Process Instances. How to retry a failed step?
Hi again Tijs,

Regarding to this matter, using Job query in the ManagementService is very useful in order to know which steps have been failed and then try to execute them again, As you know, in the RuntimeService you can query for process instances that are active() or suspended(), but I wonder if it's possible to integrate one more option in that service in the ProcessInstanceQuery which query for the process instances that are failed(), something like is:

runtimeService.createProcessInstanceQuery.failed().list();

I think it could be a very good feature for the Activiti API.

What do you think?

Actually I will have to implement something similar using pure NativeQuery meanwhile in order to do that.

Regards,

Jerry
jerryfiunam (61) [Avatar] Offline
#4
Re: Handling erros in Process Instances. How to retry a failed step?
Hi again,

Additionally, I would like to know the meaning or purpose of each column of ACT_RU_JOB table, some of them are quite intuitive but others like:

LOCK_EXP_TIME_
LOCK_OWNER_
EXECUTION_ID_
EXCEPTION_STACK_ID_
HANDLER_TYPE_
HANDLER_CFG_

are not. I wonder if you can elaborate about this, just in order to understand the meaning and purpose of each field and know what kind of information I am retrieving smilie. This would be very helpful to me.

Thanks a lot in advance,

Regards,

Jerry
tijs.rademakers (494) [Avatar] Offline
#5
Re: Handling erros in Process Instances. How to retry a failed step?
Hi Jerry,

LOCK_EXP_TIME_ To support clustered job executors, when a job executor starts with a job it has a certain amount of time to complete it before the job is unlocked again, to prevent jobs from not being executed. This sets the time limit for this job to be completed by a specific job executor.
LOCK_OWNER_ To support clustered job executors, when a job executor starts with a job, it first lock it and sets itself as the lock owner
EXECUTION_ID_ The execution id of the activity where the boundary timer event is attached to for example
EXCEPTION_STACK_ID_ Reference to the byte array of the stack trace when an exception occurs while executing the job.
HANDLER_TYPE_ The job type, like timer or suspend or activate process instance
HANDLER_CFG_ Additional information that may be necessary for a specific job handler type.

Best regards,

Tijs