I will try to explain the scenario using three simpe Script tasks. This is how they are connected to each other using precedence constraint.
ScriptA and ScriptB are connected to ScriptC using Precedence constraint for Value as Failure in Precedence Constraint Editor as shown here
Now open the Script editor for ScriptA and change the default code as
Dts.TaskResult = Dts.Results.Failure Now let's execute the package. We will see that ScriptA will turn RED but the ScriptC will not execute. Try to configure ScriptA for success and ScriptB for failure by changing the default code and re-execute the package. Again we will find ScriptC not getting executed. (Why??.. we configured the precedence constraint for Failure.) Okay, lets open the precedence constraint editor and select the radio button "Logical OR". The appearance of the constraint at control flow will change and looks like
Lets execute the package again. This time ScriptC will execute if any one of ScriptA and ScriptB are configured to fail. The key was to change the default selection from Logical AND to Logical OR. Logical AND means both the constraints shoud be true (means both the Taks, ScriptA and ScriptB should fail which is not possible becasue ScriptB will execute only when ScriptA completes successfully) while Logical OR means any one of the two constraint should be true.
Lets configure the constraint between ScriptA and ScriptB to "Completion" and configure both the tasks to fail and execute the package.Also, select Logical AND for the precedence constraint between ScriptA and ScriptC. This time ScriptC should be excuted. This is how the control flow looks after execting the package
Excelent, you save me.
ReplyDeleteDiseƱo de Paginas Web
www.naranjaweb.com