Reputation: 1977
I am developing a sequential workflow for SharePoint and wondering if an IfElseActivity should always have a minimum of two branches. For instance, if I have a true/false condition, do I need a branch for both or can I just have one branch for true? An if statement in C# does not need an else statement, but in a workflow I wonder what happens when the condition is false, does it proceed to the end of the workflow?
Thanks
Upvotes: 0
Views: 1212
Reputation: 646
According to this link:
You do not need an else condition, see this paragraph on the above page for info on ways to specify what you want to do if the if statement is false:
You can also create a branch that has no specific condition. This way, the workflow performs > one action if a condition is true and a different action if the condition is false. For example, the following step in a workflow sends a message to the team only if the condition is true; else, the workflow sends a message just to the document author. By adding a branch with no specific conditions, the workflow performs the action in that branch in any case where the condition in the first branch is false.
Upvotes: 1