09-21-2009 05:57 AM
Instead of immediate goto cleanup on sequence fail, any suggestions how to customise a process model to implement a goto cleanup after N failures?
I think I can check the number of fails in a ProcessModelPostStep and flag on some limit - but but not sure the best way to initiate a 'goto cleanup' in the process model?
Thanks.
Solved! Go to Solution.
09-21-2009 08:15 AM
CIM1,
Add an ActiveX/COM step to terminate in your ProcessModelPostStep that is preconditioned on your failure count.
Execution.Terminate
Terminates the execution.
Cleanup step groups execute as part of the termination process. If the execution is an interactive execution, use the Execution.TerminateInteractiveExecution method instead.
The execution may not terminate immediately. If a call to a step module is active, the execution waits for the step module to return.
-Jack
09-21-2009 08:56 AM
Thanks for suggestion but I do not want to terminate the execution.
I want to goto cleanup - in the same sense that it is possible to set goto cleanup on step fail in Station Options or Sequence Properties.
09-22-2009 08:15 AM - edited 09-22-2009 08:16 AM
Well, that's a different story then... I assumed you where talking about terminating and going to cleanup - sorry about that.
You could try adding a statement to your ProcessModelPostStep that sets the following:
ThisContext.RunState.Caller.RunState.GotoCleanup = True
And is preconditioned to your flag and to prevent it from executing in the Process Model:
ThisContext.RunState.Caller.RunState.StepIndex > 0 && ThisContext.RunState.Caller.RunState.StepGroup != "Cleanup" && ThisContext.RunState.Caller.IsProcessModel != True
I didn't test it with any use cases, but you might be able to get something like this to work with your test logic.
-Jack
09-22-2009 09:46 AM
Just tried it and it worked great - thanks Cap'n