hi all is it possible to handle exceptions during a loop in a workflow.
for example I have a mass deployment workflow which is cloning servers on bulk. Can I check return codes on the clone_vm task and log all and either bail or continue based on return codes.
in some situations I would like to attempt / fail continue loop.
in others I would like to attempt fail stop loop.
Is there any samples anywhere I could look over.
You could start your clone as a parallel workflow in a parent workflow and check on the workflow token status to start a remediation workflow. Check for "Start workflows in parallel" in the library as a basis.
You could start your clone as a parallel workflow in a parent workflow and check on the workflow token status to start a remediation workflow. Check for "Start workflows in parallel" in the library as a basis.
Hi!
One possible strategy is to "log" any issues or exceptions in an external list or protocol. So you can let run the workflow completely, and in the end the user gets the protocol.
If you want to react on exceptions inside your loop you can use the exception-paths and exception-bindings in schema editor.
See attached workflows for an example... (one WF throws exception, the other one handles the exception)
Regards,
Joerg
I found one example with exception in loops. Unfortunately I cannot upload it, because it was a customer project, but the screenshot will get you an idea...:
Regards,
Joerg
You can either:
Different implementations may be more adapted depending on your use case (i.e generic error handling or very specific to the master workflow), on if you want to run the operation in serial or parallel. if the later and if possible / make sense the exception should be handled within the called workflow.
Christophe.
thanks guys this is great stuff. The workflow diagram speaks a 1000 words. It makes more sense now.