Automic Workload Automation

 View Only
  • 1.  Notification call in postcondition

    Posted 15 days ago

    Hello,

    I'm trying to sent a notification using a CALL object in Postconditions but it does not work.
    I've 3 jobs connected to a script object, if one of them is in failure I'll failed the script.

    Script is failed because I've have dependencies configured, so if one of the 3 jobs do not finish ENDED_OK then I abort the script.
    So the script end up with status :
    ENDED_JP_ABEND - not executed due to abnormal Workflow end.

    In the script I've have a postconditions saying :

    IF task ended with status ENDED_NOT_OK
    THEN
    execute object CALL_FAILED as alias ' '
    with <PARAMETERS> and wait for end
    ELSE

    The workflow is running , the script failed but it never sends an email.
    My assumption is,
    it does not go in the Postconditions because the script failed ? Correct ?

    Did someone tried to do something like that ? Or is the only to do it is by coding the email inside the script object and not using postconditions ?

    Thanks for your help







    ------------------------------
    [JobTitle]
    [CompanyName]
    [State]
    ------------------------------


  • 2.  RE: Notification call in postcondition

    Posted 15 days ago

    I've read in help,
    in Time&Dependecies only if you select Skip,the post conditions can be executed :

    Skip
    The task is skipped, but its Postconditions are executed. The task's final status in this case is 1930 - "ENDED_SKIPPED - Skipped because of WHEN clause."
    The Execute dialog (see below) is ignored when the task itself is inactive.


    So I did it but still not able to make it works, i've not log! If I display Reports it is empty.
    Script is finishing with status :
    Status ENDED_SKIPPED - Skipped because of WHEN clause

    I also change code to use ended_skipped instead of ended_ok :

    IF task ended with status ENDED_SKIPPED
    THEN
    execute object CALL_FAILED as alias ' '
    with <PARAMETERS> and wait for end
    ELSE








    ------------------------------
    [JobTitle]
    [CompanyName]
    [State]
    ------------------------------



  • 3.  RE: Notification call in postcondition

    Posted 14 days ago
    Try the below under postcondition of a job that fails:

    IF task ended with status ENDED_NOT_OK
    THEN
    execute object CALL_FAILED as alias ' '
    with <PARAMETERS> and do not wait for end



  • 4.  RE: Notification call in postcondition

    Posted 14 days ago
    I changed with ENDED_NOT_OK but same result.
    It did not send the email and If I right click on the task Open Report , there is nothing.
    So I guess it did not execute the postconditions which I don't understand because in the Time&Dependencies of this task, Else Skip is selected.

    ------------------------------
    [JobTitle]
    [CompanyName]
    [State]
    ------------------------------



  • 5.  RE: Notification call in postcondition

    Posted 14 days ago

    Hello,

    From what you've described i would say that your logic is incorrect.

    The dependencies between your jobs and the script with the post-condition are set to "ENDED_OK else ABORT" right?

    Hence the SCRI task does not start at all as the dependencies are not met and the whole workflows goes in abend state ENDED_JP_ABEND.
    As the task does not execute at all, the postcondition is also not triggered.

    Best method would be to trigger the email notification on the objects that actually is failing (in your case the jobs) rathar than on the next task.

    OR

    Execute the CALL object when the dependencies are not met (Abort + Execute another object)
    null



    ------------------------------
    ------------------------------
    Automic SME @ DXC.Technology
    ------------------------------
    ------------------------------



  • 6.  RE: Notification call in postcondition

    Posted 11 days ago
    Hi Krum,

    Thanks I understand now, you are right.

    In Time&Dependencies Tab of the SCRI object the Status was ENDED_OK Else Skip.
    Tt means that the SCRI was never launched so no postconditions started.

    To test, I changed the ENDED_OK by ENDED_NOT_OK and the script is running now.

    For the point below :
    "Execute the CALL object when the dependencies are not met (Abort + Execute another object)"

    I don't want to do it like because if in the dependencies I have 3 Taks for example, then I will receive 3 emails.
    As it is the same workflow I want to receive only one email even if the 3 jobs failed.
    So this is why I wanted to do it with the script, like that in postconditions It will trigger only one email.

    Based on what you said,I can do it the opposite way,
    In the script I test if at least on status matches ENDED_NOT_OK/ANY_ABEND,
    if yes I run the script and I make the script failing in UC4, then it will trigger the postconditions and send the email
    and if No, I skip the script.

    Unless there is another way to do it.

    thanks again







    ------------------------------
    [JobTitle]
    [CompanyName]
    [State]
    ------------------------------