Skip to content

Instantly share code, notes, and snippets.

@idabmat
Last active October 2, 2018 06:59
Show Gist options
  • Save idabmat/1281bc90e61f3fb444249dce2ceadbf5 to your computer and use it in GitHub Desktop.
Save idabmat/1281bc90e61f3fb444249dce2ceadbf5 to your computer and use it in GitHub Desktop.
class SequentialWorkflow < Zenaton::Interfaces::Workflow
include Zenaton::Traits::Zenatonable
def handle
a = TaskA.new.execute # Let's store the return value from the task
if a > 0 # And use that value to determine which task to run next
TaskB.new.execute
else
TaskC.new.execute
end
TaskD.new.execute # This gets execute in either cases
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment