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
------------------------------
Original Message:
Sent: 07-11-2019 01:05 AM
From: Joel Wiesmann
Subject: How do I deactivate a task in FOREACH workflow
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
Original Message:
Sent: 07-10-2019 10:07 AM
From: Tim Osgood
Subject: How do I deactivate a task in FOREACH workflow
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
Original Message:
Sent: 07-02-2019 02:28 AM
From: Joel Wiesmann
Subject: How do I deactivate a task in FOREACH workflow
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
Original Message:
Sent: 06-28-2019 11:57 AM
From: Tim Osgood
Subject: How do I deactivate a task in FOREACH workflow
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
------------------------------