Precedence Constraint Expressions


Precedence constraints control the workflow of packages. They do this by determining if some constraint is met, and if so it "fires." In other words, it tells the runtime engine that it's OK to execute the next executable in the workflow to which that precedence constraint points. In DTS, options for constraints were limited to whether the previous task succeeded, failed, or just completed. Although useful in the general case, at times it would be helpful to include other factors into the equation. Precedence constraint expressions give package writers virtually unlimited flexibility to make the precedence constraint fire based on any condition in the package environment by allowing the precedence constraint to factor the result of an expression into the constraint.

Figure 9.6 shows the Precedence Constraint Editor in which you enter the expressions. Notice there are a few options for how expressions can be used. Four options are available in the Evaluation Operation drop down. The Constraint option ignores expressions and only fires if the Value constraint is met. The Expression option ignores the Value constraint and only fires if the expression evaluates to trUE. The Expression and Constraint option only fires if both the Value constraint is satisfied and the expression evaluates to TRUE. The Expression or Constraint option fires if either the Value or Expression constraints are met.

Figure 9.6. The Precedence Constraint Editor allows you to enter expressions


Expressions on precedence constraints are useful in those cases in which you want to control what workflow gets executed based on criteria other than the success or failure of previous workflow. The following are some examples when this might be useful:

  • You want to control which workflow executes by passing in a command-line configuration.

  • You want to configure workflow with other configurations.

  • You want to determine which workflow executes during the package's execution.

  • You want to only execute a workflow if a variable has a certain value or is not empty.

These are just a few examples of how expressions can be useful on precedence constraints.



Microsoft SQL Server 2005 Integration Services
Microsoft SQL Server 2005 Integration Services
ISBN: 0672327813
EAN: 2147483647
Year: 2006
Pages: 200
Authors: Kirk Haselden

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net