Throwing BPMN / HTTP Error using groovy

Hello,
I am trying to implement this situation:

It aims is simulate a temporary Service Unavailable from Server, BPMN should catch the HTTP Response Code (status) and retry the request after a Time Delay, until maximum 3 times.

I am trying with “Conditional BoundaryEvent”. Any suggestions?

Thanks in advance.

Hi

Have a look at this pattern its close to what you may be after.

regards

Rob

1 Like

Hi, thanks for your answer.

I need to implement this use case using service task.
Any suggestions about my approach?

Best regards.

Hi,

The pattern works for script or service task. The key takeaway is you need to turn a technical exception into an event which influences the flow…

A conditional event or an error event both meet the requirement of catching an event to steer the flow. In this case, I prefer an error event as the trigger is a technical exception. Id use a conditional event if the trigger was related to the state of a business object construct, eg Fridge Too Hot. My rationale is these kinds of design principles help maintain consistency and ease of understanding…

regards
Rob

Hi thanks for your explanation.
I still don’t understand how can i implement this pattern using the Service Task .
The Service Task have some special configuration to throw the error after retry the request 3 times unsuccessful?
How can i catch the error and Retry at least 3 times?
I am now trying to implement in this way, following your recommendation:

Best regards.

Hi,

Its a litle harder if you are using the service task connector approach as the connector code takes some control away from you. So if you can, use a java class or script so you have finer control.

One way which may work with a connector approach is to create an engine incident listener to intercept an incident created by the connector approach, but this is probably harder than just implementing the service task yourself…

regards

Rob