I have a basic process as follows:
Run Task A to get result
If A.result = X, then do Task B else do Task C
Do Task D (always)
If I understand flows correctly, I would first create these Tasks:
Task A - query
Task B - conditional action
Task C - conditional action
Task D - unconditional action
In Task A, I'd have Task Conditions that force control to Task B or Task C. The question is what happens after B/C end and what additional flow configuration is necessary to get to Task D (and avoid things like flowing from B into C).
If I understand flows correctly, we need:
Task A - OnSuccess - If X, go to Task B
Task A - OnSuccess - If not X, go to Task C
Task B - OnSuccess - go to Task D
There would be no need for an OnComplete within Task A since control won't come back to it once forced to Task B/C. Similarly, nothing is needed on Task C since flow will naturally head to Task D with the default OnSuccess - go to next Task.
Is this accurate or does control return to A after B/C end? Note: if this works as I believe, then I don't actually need "if X, go to Task B" since that's the next natural step for anything being directed to Task C via the Not X Condition.
And for the extra credit, how does this work within a loop?
Task A - get List of keys
Loop - for each key
Task B - perform query using key
Task C - action to be performed only if key satisfies some condition in B (eg., there are records for the key)
end Loop
Task D
How do I initiate the next iteration of the loop, avoiding Task C, when the condition is not satisfied within B?
The initial flow control in Task B seems simple (OnSuccess - rowcount > 0, go to Task C). And I don't think anything special is needed within Task C. But how do I skip Task C and initiate the next iteration when rowcount is 0 in Task B? I don't want to pass control directly to Task D since that exits the loop. And I'm afraid to explicitly pass control back to Task B since I'm guessing that won't be treated as a new loop iteration and I'll be caught in an infinite loop.