Automic Workload Automation

 View Only
  • 1.  How do I deactivate a task in FOREACH workflow

    Posted Jun 28, 2019 11:58 AM
      |   view attached

    I have a FOREACH workflow that consists of two objects and uses a VARA table. 

    VARA.DPA.HYLAND.FILES.BIWKLY.MED  - a list of file names and path statements

    JOBS.DPA.OSC.HYLAND.FILES.MED – Sets parameters

                    Attribute Deactivate on Finish = Always

    JOBF.DPA.OSC.HYLAND.MED – Moves files based on parameters

                    Attrributes Deactivate on Finish = Always

    The workflow works as expected, the parameters are set in the first task and the files move in the second task.  However, there is not always a file to move in the second task.  This gets an Ended_Not_OK and moves on to the next value in the vara table.  The workflow ends normally.

    My operations team is complaining because the Ended_Not_OK tasks sit in the Activities window and they have to deactivate them manually.

    I tried adding a precondition to the JOBF.DPA.OSC.HYLAND.MED that checks if a file exists, if not skip the task giving a Ended_Skipped status.

    This works fine in the first loop:

    2019-06-25 12:49:18 - IF file 'D.D.RDS.DD001B.ATOM' does not exist (check via GGCCPROD2 and use login LOGIN.GGCC.PROD).

    2019-06-25 12:49:18 -    True: Found 0 file(s).

    2019-06-25 12:49:18 - FINALLY skip task with message 'FILE NOT FOUND'

    However, the second loop gets stuck and keeps re-evaluating the precondition.

    2019-06-25 12:49:19 - IF file 'D.D.RDS.DD40B.ATOM' does not exist (check via GGCCPROD2 and use login LOGIN.GGCC.PROD).

    2019-06-25 12:49:19 -    True: Found 0 file(s).

    2019-06-25 12:49:33 - IF file 'D.D.RDS.DD40B.ATOM' does not exist (check via GGCCPROD2 and use login LOGIN.GGCC.PROD).

    2019-06-25 12:49:33 -    True: Found 0 file(s).

    2019-06-25 12:49:53 - IF file 'D.D.RDS.DD40B.ATOM' does not exist (check via GGCCPROD2 and use login LOGIN.GGCC.PROD).

    2019-06-25 12:49:53 -    True: Found 0 file(s).

    Repeat, repeat, repeat, etc.

    My goal is to deactivate the task if the file is not found and move on to the next.  Is precondition the best way to act upon no file found?  How do I avoid it getting stuck on the second loop?  Should I use a postcondition instead?  Or is there another method?

    I have attached a Word doc with more detail and screenshots.


    Thanks



    ------------------------------
    Developer
    State of Colorado
    ------------------------------

    Attachment(s)

    docx
    FOREACH Error.docx   320 KB 1 version


  • 2.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 01, 2019 08:32 AM
    Edited by Frank Muffke Jul 01, 2019 09:04 AM
    hi

    does checking  "generate@runtime" in both objects help?

    cheers, Wolfgang

    ------------------------------

    ------------------------------



  • 3.  RE: How do I deactivate a task in FOREACH workflow

    This message was posted by a user wishing to remain anonymous
    Posted Jul 01, 2019 09:58 AM
    This post was removed


  • 4.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 01, 2019 11:24 AM
    Thanks Wolfgang.  Unfortunately it did not make a difference.  Works for the first pass in the loop but still hangs on waiting for preconditions on the second pass.  This process works except for the deactivation of the tasks and I have other work I need to get done.  I'll revisit this in a day or two.

    ------------------------------
    Developer
    State of Colorado
    ------------------------------



  • 5.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 01, 2019 12:49 PM
    I cant answer, why the condition doesn't repeat itself the first time but instead of checking the pre-condition in the repeat mode, do it only once.​
    The other thing you could do is to check the "Deactivate always" on the Job attributes tab.Try  these.


    ------------------------------
    Thanks Shravani
    ------------------------------



  • 6.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 01, 2019 02:54 PM
    Hi

    possibly the else-condition was set wrongly by mistake or anthing else with it?

    cheers, Wolfgang

    ------------------------------
    [removed]
    ------------------------------



  • 7.  RE: How do I deactivate a task in FOREACH workflow
    Best Answer

    Posted Jul 02, 2019 03:32 AM
    If I got your right, the logic is working properly for the first loop only.

    Can you do a screenshot of your precondition logic? There is a setting in the pre/postcondition, that a command only happens the first time it is beeing evaluated. You can recognize that by the number one (1) that is on the right to the command. Usually this should reset in a foreach loop but maybe there's a bug.

    ------------------------------
    Head of chief line manager senior hot air warmer
    Swisscom
    ------------------------------



  • 8.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 10, 2019 10:08 AM
    Thanks Joel. 

    That got me pointed in the right direction.  I built the pre-condition from scratch and it defaults to 1 (default.png).  I ran the JOBP and it hung after the first iteration.  I edited it and next to the 1, I clicked on the ellipse and got the option to "repeat processing" (repeat.png) which I selected.  It then worked on all iterations.







    ------------------------------
    Developer
    State of Colorado
    ------------------------------



  • 9.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 11, 2019 01:12 AM
    Hi Tim

    Ha, sometimes firing in the sky hits a pigeon. Then it really seems to be a bug. Are you going to open up a case for that? 

    Regards
    Joel

    ------------------------------
    Swisscom & WorkflowCommander
    ------------------------------



  • 10.  RE: How do I deactivate a task in FOREACH workflow

    Posted Jul 11, 2019 10:58 AM
    Hi Joel,

    Hindsight being 20/20, I went back and looked at the FOREACH documentation.  No call out to be aware of pre & post conditions.

    However, the Precondition, Postcondition documentation does have a call out about this, which I missed before. It reads that iteration is the default and you change to 1.  So a bug fix may be in order.

    "The  symbol indicates that the condition/action is processed recurrently. In case of Preconditions, they are repeated until a final action has been reached. For Postconditions, they are processed only once.

    If you click it, the symbol changes to  (clicking does not change it, you have to use the ellipse). This means that the condition or action is processed only once regardless of whether it is located in the Preconditions or Postconditions area. This also includes all subordinate blocks. Clicking the symbol again restores the original behavior.

    And the one line about ForEach workflows....
    ForEach workflows: Whether your Preconditions will be evaluated once or repeatedly for each iteration (loop) depends on what you define here for each task that is part of the relevant workflow."


    Thanks again for pointing me in the right direction.

    ------------------------------
    Developer
    State of Colorado
    ------------------------------