Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks in a fork from a cycle do not execute #169

Closed
m4dcoder opened this issue Jul 9, 2019 · 0 comments · Fixed by #170
Closed

Tasks in a fork from a cycle do not execute #169

m4dcoder opened this issue Jul 9, 2019 · 0 comments · Fixed by #170
Assignees

Comments

@m4dcoder
Copy link
Collaborator

m4dcoder commented Jul 9, 2019

Given the following workflow, the task cheer will only execute once if the task toil cycle back to the task query. The workflow engine did not recognize the fork under decide_cheer to be part of the cycle and blocked the task from updating the workflow state.

version: '1.0'

description: A sample workflow with a fork that stems from a cycle.

vars:
  - cheer: false
  - work: false

tasks:
  # This init task is required to tell the workflow engine where to start.
  # Otherwise with just a cycle, the workflow engine cannot tell where to start.
  init:
    action: core.noop
    next:
      - do: query

  # This is the start of the cycle in the workflow.
  query:
    action: core.noop
    next:
      - when: <% succeeded() %>
        publish: cheer=<% result() %> work=<% result() %>
        do: decide_cheer, decide_work


  # The branch under the decide_work task will cycle back to the query task.
  decide_work:
    next:
      - when: <% ctx().work %>
        do: notify_work, toil
  notify_work:
    action: core.noop
  toil:
    action: core.echo message="This is hard work."
    next:
      - do: query


  # The branch under the decide_cheer task is a fork from the cycle.
  decide_cheer:
    next:
      - when: <% ctx().cheer %>
        do: cheer
  cheer:
    action: core.echo message="You can do it!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant