New activity - Change process status

orchestrator
activities
i_parked

#1

Hello guys!

I propose an activity to set the status of a process as failed in jobs list. This is necessary because if you do try-catch, your workflow will complete succesfully (green checkmark), and that is correct from the technical perspective, however from the business and support perspective it should appear as failed.

If the developer has this mechanism it can mark it as failed in the orchestrator web interface so support can track the problem.

Alex


#2

Why not…

  • do your try-catch (clean-up)
  • in the end re-throw the exception

?


#3

You can invoke cleanup in every catch and afterwards throw the error, agreed, but it would be much easier if you had an activity to set the status to failed.


#4

Would it be much easier?

It is

  • using an activity at the end of some catch vs.
  • using rethrow activity at the end of some catch

almost the same or i’m missing something.


#5

One difference I’ve noticed is if execution ends with an exception robot doesnt log out even if he started a new session. This can make follow up runs work incorrectly.

I’d still prefer a jobstart flag for that, but that’s a different topic.


#6

Hmm…haven’t thought about it. However you can still do the cleanup and only after re-throw the exception.

I’m thinking that using exception is better for consistency reasons. Using an activity will let you set the job status to failed by mistake. Using exception will guarantee that after throwing the exception nothing gets executed.


#7

Yes, but that will still leave the session as Disconnected, instead of logging out.
Something to think about.


#8

Yes, but some customers complained that login/logout is time consuming :slight_smile:.
If you’re not changing the win-logon should not be a problem…though, indeed, logoff is safer especially in an unhandled robot crash case…so it’s something to think about…and will avoid the trouble of doing clean-up.