Class: Dor::Workflow::Client::WorkflowTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/dor/workflow/client/workflow_template.rb

Overview

Makes requests relating to a workflow template

Instance Method Summary collapse

Constructor Details

#initialize(requestor:) ⇒ WorkflowTemplate



8
9
10
# File 'lib/dor/workflow/client/workflow_template.rb', line 8

def initialize(requestor:)
  @requestor = requestor
end

Instance Method Details

#retrieve(workflow_name) ⇒ Hash

Retrieves a representation of the workflow template

@example: retrieve('assemblyWF') => '"processes":[{"name":"start-assembly","name":"content-metadata-create",...]}'



19
20
21
22
# File 'lib/dor/workflow/client/workflow_template.rb', line 19

def retrieve(workflow_name)
  body = requestor.request "workflow_templates/#{workflow_name}"
  JSON.parse(body)
end