Last Step in Package

  • I have a muti step package that requires a ActiveX script to run as the last step. I'd like to run this process regardless of whether any of the other steps executed successfully or failed. When using a OnSuccess workflow constraint at the very end it may not get execited.

    I'd prefer NOT to add OnCompletion constraints to all other steps. Is there some way I can dynamically add these or some when to denote this step as the absolute LAST step in the package?

    Thanks, Mark


    Best Regards,

    Mark Tierney

  • Mark,

    Look into the DTSStepExecStat_Completed or DTSStepExecStat_Waiting constants.  I believe you can set the status of any step in a package via an ActiveXScript task.

    I've done something similar but I don't remember the specifics.

    Good Luck

  • Hmmm ... could you use a workflow script in the ActiveXScript task that you want to run last. Have it loop around checking the execution status of the other steps. When all the other steps are either completed or failed jump out of the loop.

    Could be tricky coding, how are your ActiveXScript skills

     

    --------------------
    Colt 45 - the original point and click interface

  • I would put the active X script in it's own DTS package, and then run that package as the second step of a job, which runs whether the first step succeeded or failed.

  • Thanks Phill

    This seems to make the most sense to me.

    I can loop around the steps looking at ExecutionStatus and ExecutionResult fairly easily. It seems like a constant loop would be CPU intensive though. If I could make it pause between loops through the steps that seems to be a valid solution. I have found the Sleep method of WScript object but can't seem to make it work inside my package. I keep getting "Object doesn't support this property or method".

    Does anyone have any experience using WScript (and sleep) inside a DTS script?


    Best Regards,

    Mark Tierney

  • Haven't come across a need for sleep in my DTS packages, only in my day-to-day life

    How about using WScript.Shell to call NTSLEEP (resource kit) or something similar?

     

    --------------------
    Colt 45 - the original point and click interface

  • Mark - did you ever get anywhere with this? I can't get the activex task to "sleep" without it halting all of the other steps. If you have a working solution could you share it perhaps?

    Thanks

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

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