conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Feature: Add WHILE Task

Open Young-Zen opened this issue 1 year ago • 5 comments

Pull Request type

  • [ ] Bugfix
  • [X] Feature
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes (Please run ./gradlew generateLock saveLock to refresh dependencies)
  • [ ] WHOSUSING.md
  • [ ] Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

Describe the new behavior from this PR, and why it's needed https://github.com/Netflix/conductor/discussions/3747 While

Alternatives considered

Describe alternative implementation you have considered

Young-Zen avatar Dec 19 '23 02:12 Young-Zen

Does this support to do the decision from a SIMPLE task's output ? or a subworkflow's output ?

meggarr avatar Dec 21 '23 12:12 meggarr

Does this support to do the decision from a SIMPLE task's output ? or a subworkflow's output ?

Yes, similar to the DO_WHILE task, the output of each task is stored as part of the WHILE task, indexed by the iteration value, allowing the condition to reference the output of a task for a specific iteration.

Young-Zen avatar Dec 21 '23 13:12 Young-Zen

HI @Young-Zen thanks for the PR. This is a good to have, however, if we are adding a new task I think there is an opportunity here to address some of the shortcomings of do_while including support for nested loops, and a bit of usability with terminating conditions etc.

v1r3n avatar Dec 26 '23 08:12 v1r3n

HI @Young-Zen thanks for the PR. This is a good to have, however, if we are adding a new task I think there is an opportunity here to address some of the shortcomings of do_while including support for nested loops, and a bit of usability with terminating conditions etc.

Hi, thank you for your feedback on the PR. I agree that there are opportunities to address the shortcomings of do_while, including support for nested loops and improving the usability of terminating conditions. I believe we can consider these enhancements in a subsequent PR to ensure a more comprehensive improvement. For the current PR, I will focus on adding the WHILE task as requested. If you have any further suggestions or considerations, please feel free to share them. Thank you!

Young-Zen avatar Dec 26 '23 12:12 Young-Zen

I'm curious - what are the differences between this task and the existing DO_WHILE task?

Edit: Nevermind, found it in the PR: However, unlike the `DO_WHILE` task, the `WHILE` task checks the condition before executing the task list, and if the condition is initially false, the task list will not be executed.

bjpirt avatar Feb 07 '24 11:02 bjpirt