Module: SWF::Workflows
Instance Method Summary collapse
- #effect_workflow_type(name, version, options = {}) ⇒ Object
- #start(options, execution_options) ⇒ Object
- #wait_for_workflow_execution_complete(workflow_execution) ⇒ Object
Instance Method Details
#effect_workflow_type(name, version, options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/swf/workflows.rb', line 7 def effect_workflow_type(name, version, ={}) @workflow_types ||= {} @workflow_types[[name, version]] ||= SWF.domain.workflow_types.find {|t| [t.name, t.version] == [name, version] } @workflow_types[[name, version]] ||= SWF.domain.workflow_types.create(name, version, ) end |
#start(options, execution_options) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/swf/workflows.rb', line 13 def start(, ) [:task_list] ||= SWF.task_list .merge!({ input: .to_json }) workflow_type.start_execution() end |
#wait_for_workflow_execution_complete(workflow_execution) ⇒ Object
21 22 23 24 |
# File 'lib/swf/workflows.rb', line 21 def wait_for_workflow_execution_complete(workflow_execution) sleep 1 while :open == (status = workflow_execution.status) raise "workflow_execution #{workflow_execution} did not succeed: #{workflow_execution.status}" unless status == :completed end |