class Conductor::Workflow

Public Class Methods

decide_workflow(workflow_id) click to toggle source

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(workflow_id) click to toggle source

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_correlated_workflows(workflow_name, correlation_id, include_closed: false, include_tasks: false) click to toggle source

GET /workflow/{name}/correlated/{correlationId} Lists workflows for the given correlation id

# File lib/nf-conductor/http/workflow.rb, line 34
def get_correlated_workflows(workflow_name, correlation_id, include_closed: false, include_tasks: false)
  response = Connection.new.get(
    "/workflow/#{workflow_name}/correlated/#{correlation_id}?includeClosed=#{include_closed}&includeTasks=#{include_tasks}"
  )
  Workflow.build(response)
end
get_running_workflow(workflow_name, version: nil, start_time: nil, end_time: nil) click to toggle source

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(workflow_id, include_tasks: true) click to toggle source

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
new(response) click to toggle source
Calls superclass method Conductor::Model::new
# File lib/nf-conductor/http/workflow.rb, line 3
def initialize(response)
  super(response)
end
pause_workflow(workflow_id) click to toggle source

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
rerun_workflow(workflow_id, rerun_body: {}) click to toggle source

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
reset_callbacks_for_workflow(workflow_id) click to toggle source

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
restart_workflow(workflow_id) click to toggle source

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
resume_workflow(workflow_id) click to toggle source

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
retry_workflow(workflow_id) click to toggle source

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
search_workflows(start: nil, size: nil, sort: nil, free_text: nil, query: nil) click to toggle source

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
skip_task_for_workflow(workflow_id, task_name, task_body: {}) click to toggle source

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
start_workflow(name, version: nil, correlation_id: nil, body: {}) click to toggle source

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
start_workflow_with_domains(workflow) click to toggle source

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
terminate_workflow(workflow_id, reason: nil) click to toggle source

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