class Conductor::Workflow
Public Class Methods
PUT /workflow/decide/{workflowId} Starts the decision task for a workflow
# File lib/nf-conductor/http/workflow.rb, line 74 def decide_workflow(workflow_id) response = Connection.new.put("/workflow/decide/#{workflow_id}") Workflow.build(response) end
DELETE /workflow/{workflowId}/remove Removes the workflow from the system
# File lib/nf-conductor/http/workflow.rb, line 129 def delete_workflow(workflow_id) response = Connection.new.delete("/workflow/#{workflow_id}/remove") Workflow.build(response) end
GET /workflow/running/{name} Retrieve all the running workflows
# File lib/nf-conductor/http/workflow.rb, line 62 def get_running_workflow(workflow_name, version: nil, start_time: nil, end_time: nil) query_string = "/workflow/running/#{workflow_name}?" query_string += "version=#{version}" if version query_string += "&startTime=#{start_time}" if start_time query_string += "&endTime=#{end_time}" if end_time response = Connection.new.get(query_string) Workflow.build(response) end
GET /workflow/{workflowId} Gets the workflow by workflow id
# File lib/nf-conductor/http/workflow.rb, line 53 def get_workflow(workflow_id, include_tasks: true) response = Connection.new.get( "/workflow/#{workflow_id}?includeTasks=#{include_tasks}" ) Workflow.build(response) end
Conductor::Model::new
# File lib/nf-conductor/http/workflow.rb, line 3 def initialize(response) super(response) end
PUT /workflow/{workflowId}/pause Pauses the workflow
# File lib/nf-conductor/http/workflow.rb, line 81 def pause_workflow(workflow_id) response = Connection.new.put("/workflow/#{workflow_id}/pause") Workflow.build(response) end
POST /workflow/{workflowId}/rerun Reruns the workflow from a specific task
# File lib/nf-conductor/http/workflow.rb, line 105 def rerun_workflow(workflow_id, rerun_body: {}) response = Connection.new.post( "/workflow/#{workflow_id}/rerun", { body: rerun_body.to_json } ) Workflow.build(response) end
POST /workflow/{workflowId}/resetcallbacks Resets callback times of all in_progress tasks to 0
# File lib/nf-conductor/http/workflow.rb, line 136 def reset_callbacks_for_workflow(workflow_id) response = Connection.new.post("/workflow/#{workflow_id}/resetcallbacks") Workflow.build(response) end
POST /workflow/{workflowId}/restart Restarts a completed workflow
# File lib/nf-conductor/http/workflow.rb, line 115 def restart_workflow(workflow_id) response = Connection.new.post("/workflow/#{workflow_id}/restart") Workflow.build(response) end
PUT /workflow/{workflowId}/resume Resumes the workflow
# File lib/nf-conductor/http/workflow.rb, line 88 def resume_workflow(workflow_id) response = Connection.new.put("/workflow/#{workflow_id}/resume") Workflow.build(response) end
POST /workflow/{workflowId}/retry Retries the last failed task
# File lib/nf-conductor/http/workflow.rb, line 122 def retry_workflow(workflow_id) response = Connection.new.post("/workflow/#{workflow_id}/retry") Workflow.build(response) end
GET /workflow/search
# File lib/nf-conductor/http/workflow.rb, line 142 def search_workflows(start: nil, size: nil, sort: nil, free_text: nil, query: nil) query_string = "/workflow/search?" query_string += "start=#{start}" if start query_string += "&size=#{size}" if size query_string += "&sort=#{sort}" if sort query_string += "&freeText=#{free_text}" if free_text query_string += "&query=#{query}" if query response = Connection.new.get(query_string) Workflow.build(response) end
PUT /workflow/{workflowId}/skiptask/{taskReferenceName} Skips a given task from a current running workflow
# File lib/nf-conductor/http/workflow.rb, line 95 def skip_task_for_workflow(workflow_id, task_name, task_body: {}) response = Connection.new.put( "/workflow/#{workflow_id}/skiptask/#{task_name}", { body: task_body.to_json } ) Workflow.build(response) end
POST /workflow/{name} Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking
# File lib/nf-conductor/http/workflow.rb, line 10 def start_workflow(name, version: nil, correlation_id: nil, body: {}) query_string = "/workflow/#{name}?" query_string += "version=#{version}" if version query_string += "&correlationId=#{correlation_id}" if correlation_id response = Connection.new.post( query_string, { body: body.to_json } ) Workflow.build(response) end
POST /workflow Start a new workflow with StartWorkflowRequest, which allows task to be executed in a domain
# File lib/nf-conductor/http/workflow.rb, line 24 def start_workflow_with_domains(workflow) response = Connection.new.post( "/workflow", { body: workflow.to_json } ) Workflow.build(response) end
DELETE /workflow/{workflowId} Terminate workflow execution
# File lib/nf-conductor/http/workflow.rb, line 43 def terminate_workflow(workflow_id, reason: nil) query_string = "/workflow/#{workflow_id}?" query_string += "reason=#{reason}" if reason response = Connection.new.delete(query_string) Workflow.build(response) end