Sunday, February 7, 2010

Precedence Constraints in Control Flow

To maintain a sequence of control flow tasks we specify a relationship between tasks using Precedence Constraint. Precedence constraint is the connection line and by setting the property behavior can be changed. Right click the connecting line and select Edit to open the Precedence Constraint Editor. Here we can set its Evaluation Operation property to any of following 4 values to specify its control flow behavior:
1.       Constraints: This is the execution status of source task. Its value can be set any one of following three
a.       Success: pass control if source task completes successfully
b.      Completion: pass control if source tasks completed either successfully or failed.
c.       Failure: pass control if source task failed
2.       Expression: pass control if specified expression evaluates to true.
3.       Expression and Constraints: If expression is true and Constraints values is specified value. Control will pass to next task only if both conditions are true.
4.       Expression or Constraints: If expression is true or Constraints values is specified value. Control will pass to next task only if any one condition is true.
According to the value of Evaluation Operation property the line color is as below:
image
The most interesting value is Expression. It is used to implement the IF clause to decide a flow among multiple branches at run time. The precedence constraint in below snapshot will pass control to next task if the value of @Item_Count variable is equal to 1.
image

No comments: