Selector

The Selector is a common Composite task that is similar to an “or” operation. It will return success as soon as one of its child tasks return success. If a child task returns failure then it will sequentially run the next child task. If no child task returns success then it will return failure.

In this example the first Return Status task returned failure. Because of the failure the Selector moved onto the next child, which returned success. Because a child returned success the Selector stopped traversing and returned a status of success.

In this example the first child task returned success so there was no need for the Selector to run the second of third tasks.

With this last example the Selector traversed every child task but no child returned success. Because of this the Selector returned a status of failure.