07-31-2018 05:19 PM
I wanted to capture the failing step for entry into a CSV report. I was having trouble doing it and wanted to share what I arrived at. This simple solution works for me.
1. Create empty string array "StationGlobals.sequence_failure_chain".
2. Add sequence file callback SequenceFilePostStepFailure.
3. Insert statement into SequenceFilePostStepFailure saving the failing step name: "StationGlobals.sequence_failure_chain += { Parameters.Step.Name }".
4. Use the array entry you want for step failure as an input to the CSV file.
08-01-2018 08:55 AM - edited 08-01-2018 08:56 AM
This is great if you are only 1 sequence file deep. If you are calling other sequence files you need to put this callback in all of them. Then you need a way to propagate it back up to all the callers. Nevermind...just saw the stationglobals statement.
One way to get around that is to put ProcessModelPostStepFailure callback in your process model and place the same code you have. However, now you have to customize the process model which means you need to maintain it.
Another thing to note is that this can capture many failure chains if you continue on fail. Which is fine if that's the behavior you want.
Thanks for sharing!
08-01-2018 11:11 AM
I typically go to cleanup on a failing step, so the multiple entries are fine. I can just take the last one.
If a subsequence fails and the array is of the form:
{ "failing step name from subsequence", "subsequence name" }
I now have the option of passing the first element to the CSV step. That just seems more descriptive to me. Our repair people need to know why something failed.