Service task failure

Hi,
I have a user task in which I pass 2 variables.
After completion of user task I have a service task in which I retrieve the variables set in user task and trigger a business logic.
Even if my business logic fails the service task is still completed.
I want to avoid it.
Any suggestions.?

How exactly are you doing this?

I am actually sending an email from the service task,but when my email server throws an exception still the service task is completed.

Hi @Mass_Shake,

I hope I understand your case correctly.
In the service task where you call the email server, do you get a response from that server synchronously?

You would have to somehow notice in your code that the email server has a problem and then throw an exception in your service method. Otherwise your service task will just call the email server and presume everything is fine and complete the service task.

Best,
Tobias

Hi Tobias,I am throwing the exception in my service task,but how do i retrigger the same service task again?

Hey,

this heavily depends on how you classify this technical exception.
Is this something you expect to happen regularly and want to model explicitly?
Should this stop your process instance, result in an incident and have an admin taking care of?

I would advise you to have a look at the documentation on error handling and handling exceptions in delegates.

Best,
Tobias