Class: Dor::Services::Client::Workflows

Inherits:
VersionedService show all
Defined in:
lib/dor/services/client/workflows.rb

Overview

API calls that are about workflows

Instance Method Summary collapse

Methods inherited from VersionedService

#initialize

Constructor Details

This class inherits a constructor from Dor::Services::Client::VersionedService

Instance Method Details

#initial(name:) ⇒ String

Get the initial XML for a workflow

Parameters:

  • name (String)

    the name of the xml

Returns:

  • (String)

    the response

Raises:



11
12
13
14
15
16
17
18
19
20
# File 'lib/dor/services/client/workflows.rb', line 11

def initial(name:)
  resp = connection.get do |req|
    req.url "#{api_version}/workflows/#{name}/initial"
    # asking the service to return XML
    req.headers['Accept'] = 'application/xml'
  end
  return resp.body if resp.success?

  raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})"
end