Behavior For Each Workflow end state

Discussion created by Alwin_Groot_Bluemink_8727 on Jan 16, 2017
Latest reply on Jan 18, 2017 by Alwin_Groot_Bluemink_8727
I can use some advice on manipulation of For Each Workflow end state.

I have attached an example output from the Activities window. The Workflow Objects have status "ENDED_OK", but the child tasks in the For Each Workflow indicate failure.

I have this scenario:
- Standard Workflow with a few steps, including a For Each Workflow;
- The For Each Workflow processes files;
- The activities in the For Each Workflow are order dependent and if an error occurs then processing of the current file should stop;
- The For Each Workflow should process all files, regardless if the previous file failed to process.

I have added in all steps in the For Each Workflow a check on the return code of the Job. If that isn't 0, then I call MODIFY_STATE and that results in that Job exiting with status "ENDED_NOT_OK". The remaining activities in the For Each Workflow are not executed. That is exactly what I want.

I cannot seem to make the For Each Workflow end with that same status (or any error), however.

I would like to prevent adding a Script Object to either the For Each Workflow or Standard Workflow with the sole purpose of manipulating the end status of the For Each Workflow or top level Standard Workflow.

Any suggestions?