Determine which precedence constraint executed script task

  • Is it possible to check what type of precedence constraint actually executed the Script Task from within the script? I'd like to change a user variable based on whether the constraint was an error or a success.

    I'm accomplishing what I need too already by segregating error and success paths to their own Script task. Was hoping I could do it with one Script task instead though.

  • I don't think I have ever seen anything that allows you to determine that..

    CEWII

  • AVB (12/17/2013)


    Is it possible to check what type of precedence constraint actually executed the Script Task from within the script? I'd like to change a user variable based on whether the constraint was an error or a success.

    I'm accomplishing what I need too already by segregating error and success paths to their own Script task. Was hoping I could do it with one Script task instead though.

    Haven't seen anything like this before but I'm wondering if something like this might work. For the task prior to the script, place a value in a variable if the OnError event fires. Then use a completion constraint to go to the script task. Execute your script code based on whether the error variable contains the set value from the OnError event (Failure) or the default value you defined for the variable (Success).

    [Edit: Clarified the Failure and Success]

  • kl25,

    I kind of started to explore that option after you mentioned it. I'm not really familiar with event handling so it'd be good for me to goof around with it.

  • I've used it for other purposes to populate error related variables. Has been a helpful method to capture error information in variables.

  • Yeah that's the next step in this package. Capturing the errors. Chapter 17: Error and event handling. 😀

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply