Datasheet

Containers
With the package now complete, you could make it more advanced and cleaner by wrapping certain
functionalities in containers. Containers help you group tasks logically together but also have other func-
tionalities. There are three types of containers that you’ll typically need to be concerned with:
Sequence
ForLoop
ForEach Loop
There is actually a fourth type of container called TaskHost, which wraps every task behind the scenes.
The
Sequence container group simply groups tasks visually inside a collapsible box, as shown in
Figure 1-16. In this figure, Prepare OS and Set Variables will execute sequentially before allowing the
Create Product File Task to execute.
Sequence containers help you to clean up and abstract the details
of your control flow, since you can minimize a container if you don’t care about the complexity of what’s
happening inside the container. Events bubble up to the container, so if a failure occurs in a task, it will
fail the parent container by default.
Figure 1-16:
Sequence container grouping tasks together into a box
Sequence containers aren’t just for looks though. You can also isolate transactions to a container so that
if a problem occurs in a data task, you can roll back any other data action that had occurred in the con-
tainer if it’s participating in the container transaction. You can also log or create event handlers on any-
thing in the container.
ForLoop containers enable you to do a Do...While loop inside the control flow. Any task inside the
ForLoop container will loop continuously until the while condition is no longer met. This comes in
handy if you want to continuously loop until a variable is set to
TRUE.
One of the most important types of container is the
ForEach Loop container. With this container, you
specify a collection of items to enumerate through, and then any items inside the container will loop
19
Chapter 1: Getting Started
04_134115 ch01.qxp 4/24/07 6:40 PM Page 19