I have a job sequence which executes a command that fetches a lot of files to the server, and then processes them. This sequence is scheduled to run daily.
However, it's fairly common that, for a given day, those files aren't present at the source. This should not be treated as an error, but I also need to stop all the further processing after that invocation since, without the files, the next job activities will fail.
To accomplish this, I have the ExecuteCommand activity, and three outbound links. One for return code 0 (success, proceed normally), one for return code 1 (FileNotFound) and one for Otherwise (error while trying to get the files).
Link success goes to the rest of the processing activities.
Link Error goes to a routineActivity that invokes a custom routine I coded that sends a custom email depending on the return code received.
Link FileNotFound goes to a termination activity, since I found no input files at the source and want to stop processing without sending the email.
This works, but also leaves my job in "Aborted" state, which the end user doesn't want.
Is there a way to stop the job execution without leaving the job in "aborted" state? Currently I found a workaround: In the custom email routine, I don't send the email if the return code is the one for FileNotFound. I suppose I could create a custom routine that does nothing but log a message and use a call to that using a RoutineActivity instead of a terminator, but I was wondering if there was a better, non-dirty way of doing this
![Smile :)](./images/smilies/icon_smile.gif)
thanks in advance.