How to retry process step if it failed

Hi,

I have an requirement to retry the process step if it fails. I have set the retry count to 2 and left the default value for Retry interval. This step is implement as IS service and this service calling an webservice. I need this service to be retried from the process step if there are any failures. I have tried so many ways but not able do this. Can some one help me here?

Thanks,
Rajesh

Hi Rajesh,

you can try the following:

In the IS service use a REPEAT step (Repeat on: FAILURE) which then contains the Webservice call.

When the retries are exceeded, than the failure will be propagated to the process step.

I am aware of the circumstance, that the retries will not be visible in the Monitor then.

Regrads,
Holger

Hi Holger,

Thanks for your reply. I am looking a way to retry the process step itself in case of failure. How can i achieve this. Basically if we try from IS it will hold the thread until the retries get finished. I am looking to retry this in the span of 2 minutes and it’s not good to hold IS thread that much time. That’s why i am trying to achieve this through Process Model and not from IS.

Thanks,
Rajesh

Hi Rajesh,

according to the BPM Process Development Help document your IS Service needs to throw a specific exception to trigger the retry mechanism.

Please find the following snippet from the mentioned document for reference:


Retry Count

Number of times the Process Engine
retries the service in the case of an
Integration Server run-time exception.
The default value is 0, or no retries.

Note: The retry mechanism is invoked
only when a step service generates an
ISRuntimeException error. Any other
exception, such as an EXIT with a
FAILURE error, causes the step to fail.

Please check the Build-In-Service pub.flow:throwExceptionForRetry for further informations about this.

Regards,
Holger

Rajesh,
Holger pointed you the very right information.

Basically your flow service that is invoked from your process step should throw ISRuntimeException which is nothing but a transient exception in nature. If you have a try/catch block in the flow service, you still need to wrap the exception in catch block with ISRuntimeException and throw this.

As the target is a web service call, don’t add any try/catch in the flow service and just let it throw the exception. If it is a transient exception, this property should retry to execute again when retry is set.

Regards
Senthil

Hi Holger/Senthil,

Thanks for your replies. I have tried this earlier. But still not working. Below is the process i have followed.

Below one is not working.

Try/Catch Block
—Try
—Call Webservice
—If Success - Do Nothing
—If Fail
— Throw IS Runtime Exception

—Catch
—Get the error message
—Throw IS Runtime Exception

Below one is not working.

Try/Catch Block
—Try
—Call Webservice
—If Success - Do Nothing
—If Fail
— Throw IS Runtime Exception

—Catch
—Get the error message

I have set the process step for 2 retries but this process step getting executing 4 seconds. I have kept debug log in the IS Service, there also it is logging only one time.

Thanks,
Rajesh

Hi Rajesh,

are you sure that the web service failed?

If the web service succeeds, retry will not occur.

Can you add some pub.flow:debugLog steps to your service to see which way it goes?

Regards,
Holger

Hi Holger,

The webservice obviously will get failed as i have given wrong endpoint. It is giving soap fault back and from this point where i want to retry this. I have done the debug and it is giving error back. In this errror block i am throwing ISRuntimeException and it is going to catch block. In Catch block i have tried throwing with and without ISRuntimeException. Both are not working.

Thanks,
Rajesh

try catch does not work in IS exectly as it does in java. It has been a source of confusement many times in our group.

If you call throwExceptionForRetry from within a sequence with the Exit Option set to “success” or “done” it will not work as you might expected. In this case, you’ll have to set some indicator variable to whether an error occured, and then (outside the try catch block) check it and call throwExceptionForRetry if did.

1 Like

Hi fml2,

Thanks for your suggestion. This got worked perfect. I have taken a variable in error block and thrown exception based on the value of this variable. It have retried now which is showing in logs.

Thanks you very much.