How to process package even one task failed but allow other tasks to process

  • but how to display in the message source which i am sending e:mail..

  • kl25 (10/25/2013)


    Shaun2012 (10/25/2013)


    i am able to do but how to set up.. which task failed , only only send out message with the failed variable only

    I use an variable expression for the outcome and then place it in the MessageSource for the email. Here's an example using results from one package. Adding tabs and new lines can be helpful in the final message if you have lots of packages to report.

    Setup:

    @IntResultPackage1 (int32), default of 47

    @StrResults (string)

    Failure SQL Task populates a value of 9 (or some other generic number) to the result variable so the end value is 9 if there's a failure and 47 (or some other generic number) if there's a success.

    Expression for @StrResults:

    "Package 1 Outcome: " + ((@[User::IntResultsPackage1]!=47)?("Failure"): ("Success"))

    Remove the space after ("Failure"): ... I couldn't figure out how to post without the sad emoticon for :left paren ... 🙁 😀

    So following on from this example, once you have your results in @Variable1, you need to have a variable to hold the message that tells you about the results you got in @Variable1. In the example above that's @StrResults. It would look something like this:

    @StrResults:

    "Package 1 Outcome: " + ((@[User::Variable1]!=47)?("Failure"): ("Success"))

    (remembering to remove the space after "Failure"): )

    Now you have an actual message in a variable, @StrResults. So at the end of all of your package runs, set up an email task. Under Expressions, set the MessageSource to the variable @StrResults.

    If you're running several packages in parallel but you only want one final email, just place all of the packages in a Sequence Container and then send the email after the container finishes (use a completion precedence constraint as an earlier poster suggested).

Viewing 2 posts - 16 through 16 (of 16 total)

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