I have designed a package whose first step initializes several variables. Other steps in the package have expressions based on those variables.
Example Expression for MyTask:
PropertyName = "Disable"
Expression = "@DoMyTask"
Given this example MyTask will be enabled/disabled solely based on the value of @DoMyTask at the time the package execution begins. Changing the value of @DoMyTask prior to the normal execution of MyTask has no effect.
My conclusion is that the expression is not being evaluated late enough. Any help

Task Expression Evalutation Time
Tico1177
if @DoMyTask1 then
MyTask1
if @DoMyTask2 then
MyTask2
...
If I do MyTask! or if @DoMyTask1 is false then I want to proceed to MyTask2, but if MyTask1 fails I do not want to proceed to MyTask2. As I understand Precedence Constraints your suggestion will not work.
nib
I would love to hear about anything that others have used for this situation.
BigT
Bjarne K
DonnaJ
ncorreia7
Thanks for looking at this with me. I can write the precedence constraint between Task1 and Task2 so that it reads something like "Task1.Success and @DoTask2". That works fine, but what about @DoTask1 and Task3. I have no precedence constraint to check @DoTask1. Also if @DoTask2 is false I want to consider Task2 successful and move on toward Task3. Does that make since
Sorry I missed your first post between mine.
Allen Bergst
Jamie's post does cover my scenario, and my use of the "For Loop Container" is an equally good solution. But both solutions are vastly inferior to a simple conditional execution expression. Do you not agree The "For Loop Container" provides this concept, but it is a loop. Shouldn't all "Control Flow" items have conditional execution It seems like you are so close to providing it. I don't understand the hesitation.
Francois Geldenhuys
If you want to upload a simple package that demonstrates the issue, us wiki.sqlis.com, it has an upload feature that accepts packages. We are still testing it, but mail me darren at sqldts if you have any problems.
ducks
You are aware that precedence constraints do alot more than ExecuteOnSuccess, ExecuteOnFailure, ExecuteOnCompletion (which is what DTS did) aren't you
Are you able to post a screenshot anywhere Its hard to visualise it.
-Jamie
bvsoftware
Why don't precedence constraints work
-Jamie
Paramjyot
Sorry for not being more clear. I should have really posted screen shots or something, but your link is actually describing my very situation, except on a smaller scale. The work around I mentioned and am currently using is essentially what your link describes, except I am using "For Loop Containers" instead of "Sequence Containers". Here are exemplary values for one of my for loops...
InitExpression =
"@LoopHack = 1"EvalExpression = "@LoopHack != 0 && @DoTask1"
AssignExpression = "@LoopHack = 0"
I would have preferred, if not for the errors...
InitExpression = "@LoopHack = true"
EvalExpression = "@LoopHack && @DoTask1"
AssignExpression = "@LoopHack = false"
But this to me really is a work around. What I would really like to see is the Disable Expression be evaluated each time the Disable property is read, i.e. immediately before potentially executing the step. So your example would turn into...
A --> B(disabled by expression) --> C
Mads Brink Hansen
I'm still finding it really hard to understand your situation, sorry.
I've found in the past that complicated workflow that cannot be achieved using precedence constraints betwen your tasks can someties be achieved instead by employing sequence containers to affect workflow. Like so: http://blogs.conchango.com/jamiethomson/archive/2005/07/27/1889.aspx
I have no idea whether that will help you or not!
-Jamie
BrettSchroeder
Is there a way to set up this type of flow using Precedence Constraints If not wouldn't a disable expression be a very nice solution except for the evaluation time issue
If I am still not explaining my issue clearly should I submit a small dtsx example If so how should I do that In text
j!