Class: Dor::Workflow::Client::VersionRoutes

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

Overview

Makes requests relating to versions

Instance Method Summary collapse

Constructor Details

#initialize(requestor:) ⇒ VersionRoutes

Returns a new instance of VersionRoutes.



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

def initialize(requestor:)
  @requestor = requestor
end

Instance Method Details

#close_version(druid:, version:, create_accession_wf: true) ⇒ Object

Calls the versionClose endpoint of the workflow service:

  • completes the versioningWF:submit-version and versioningWF:start-accession steps
  • initiates accesssionWF

Parameters:

  • repo (String)

    The repository the object resides in. This parameter is deprecated

  • druid (String)

    The id of the object to delete the workflow from

  • create_accession_wf (Boolean) (defaults to: true)

    Option to create accessionWF when closing a version. Defaults to true



20
21
22
23
# File 'lib/dor/workflow/client/version_routes.rb', line 20

def close_version(druid:, version:, create_accession_wf: true)
  requestor.request(construct_url(druid, version, create_accession_wf), 'post', '')
  true
end