lib/cli/workflow_task.rb in factor-0.1.09 vs lib/cli/workflow_task.rb in factor-0.1.10
- old
+ new
@@ -9,14 +9,29 @@
method_option :parameters, :type=>:hash, :default=>{}, :required=>false
def call(workflow_name)
puts "starting workflow #{workflow_name} with options #{options.parameters.to_s}"
engine = Factor::Runtime::Engine.new(get_config[:email],get_config[:token])
- id = engine.launch(workflow_name,options.parameters)
+ id = engine.send_start_workflow(workflow_name,options.parameters)
puts "workflow executed with id #{id}"
end
+ desc "listen WORKFLOW","start listener for workflow"
+ def listen(workflow_name)
+ puts "starting listener #{workflow_name}"
+
+ engine = Factor::Runtime::Engine.new(get_config[:email],get_config[:token])
+ engine.send_start_listener(workflow_name)
+ end
+
+ desc "stop WORKFLOW","stop listener for workflow"
+ def stop(workflow_name)
+ puts "starting listener #{workflow_name}"
+
+ engine = Factor::Runtime::Engine.new(get_config[:email],get_config[:token])
+ engine.send_stop_listener(workflow_name)
+ end
desc "list", "list all the workflows"
#method_option :key, :alias=>"-k", :type=>:string, :desc=>"key reference"
def list
\ No newline at end of file