How do u skip a task using Workflow Properties ActiveX Script,but still execute d task after it??

  • I have a BulkInsert task, I want to check for the existance of the file its inserting from, if that file isnt there I dont want to run the task....however I still want to run the stored procedure that is the task after the bulk insert.

    I was trying to use the WorkFlow Properties ActiveX Script to do the check and then set the PrecedenceConstraint to Inactive if the file doesnt exist but this makes the task end up as 'not Run' and then this causes the Stored Procedure task after to not run also.

    any suggestions would be greatly appreciated.

    H.

  • yoc can have a activex script task which checks if file exists then it is not doing any thisng just write this

    Main = DTSTaskExecResult_Success

    else, you can skip one task by marking the bulk insert task workflow as completed.

    objPkg.Steps("DTSStep_DTSActiveScriptTask_2").ExecutionStatus = DTSStepExecStat_Completed

    DTSStep_DTSActiveScriptTask_2 is PrecedenceConstraint between bulkinsert task and execute query task with precedance completion.


    Kind Regards,

    Chintak Chhapia

  • First setup your workflow as normal. Then for the BULK INSERT  task add a workflow ActiveX Script that changes the precedence constraints appropriately.

    Here's a script I use to run a task or skip it.

    Function Main()
     Dim oPkg
     Dim oStep
     ' Get the FinalTask Step
     Set oStep = DTSGlobalVariables.Parent.Steps("DTSStep_DTSExecuteSQLTask_1")
     
     If CBool(DTSGlobalVariables("CON_ProcessUBS").Value) = True Then
      ' Update the following task's precedence constraint to Execution status of inactive
      oStep.PrecedenceConstraints(2).PrecedenceBasis = DTSStepPrecedenceBasis_ExecStatus
      oStep.PrecedenceConstraints(2).Value = DTSStepExecStat_Inactive
      
      Main = DTSStepScriptResult_DontExecuteTask
     Else
      ' Update the following task's precedence constraint to Execution result of success
      oStep.PrecedenceConstraints(2).PrecedenceBasis = DTSStepPrecedenceBasis_ExecResult
      oStep.PrecedenceConstraints(2).Value = DTSStepExecResult_Success
      Main = DTSStepScriptResult_ExecuteTask
     End If
     
     Set oStep = Nothing
    End Function
    

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

  • The following URL gives u an example on how to do this

     

    http://www.sqldts.com/default.aspx?214

     

    Thanks

    Meghana


    Regards,

    Meghana

Viewing 4 posts - 1 through 3 (of 3 total)

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