Class: Dor::Services::Client::Workflow

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

Overview

API calls that are about workflow

Instance Method Summary collapse

Methods inherited from VersionedService

#initialize

Constructor Details

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

Instance Method Details

#create(object:, wf_name:) ⇒ Object

Begin a new workflow

Parameters:

  • object (String)

    the pid for the object

  • wf_name (String)

    the name of the workflow

Returns:

  • nil

Raises:



13
14
15
16
17
18
# File 'lib/dor/services/client/workflow.rb', line 13

def create(object:, wf_name:)
  resp = connection.post do |req|
    req.url "#{api_version}/objects/#{object}/apo_workflows/#{wf_name}"
  end
  raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
end