Last active
October 2, 2018 06:59
-
-
Save idabmat/1281bc90e61f3fb444249dce2ceadbf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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