dor-services-client 15.14.0 → 15.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/dor/services/client/object_workflow.rb +1 -1
- data/lib/dor/services/client/process.rb +13 -10
- data/lib/dor/services/client/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cddd625cce276c478e27e4c996690f8a8edcab5115981f84af0fb916cf5e81d
|
4
|
+
data.tar.gz: 9e81af88e194dfb37e55f75b94a24d3ecb33cccdac6571c09cc931e0ebccf171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d010eed7fdfc3cae2d84c87686a52333822ecb204d772f44c30ecff51d0522b59ec09334ab3a2aaddc434cc2fda9d61beabd8a82aa4e5fb9a20455c4854b7822
|
7
|
+
data.tar.gz: 2781234795ae013152b0cfd5c13d95757db81e4468f45fddb703fd801c17a7b765cf7348a35b34368aa8f2294c49e4b51745b144248647ff6c98fab89bc51443
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -161,11 +161,13 @@ object_client.workflow('etdSubmitWF').create(version: 2)
|
|
161
161
|
# Skip all workflow steps
|
162
162
|
object_client.workflow('accessionWF').skip_all(note: 'Cleaning up')
|
163
163
|
|
164
|
+
# Get the status of a workflow process
|
165
|
+
object_client.workflow('accessionWF').process('shelve').status
|
166
|
+
=> 'completed'
|
164
167
|
# Update workflow processes
|
165
168
|
object_client.workflow('accessionWF').process('shelve').update(status: 'completed')
|
166
169
|
object_client.workflow('accessionWF').process('shelve').update_error(error_msg: 'Something went wrong', error_text: 'Detailed error message')
|
167
170
|
|
168
|
-
|
169
171
|
# List milestones
|
170
172
|
object_client.milestones.list
|
171
173
|
# Get the date for a milestone
|
@@ -16,7 +16,7 @@ module Dor
|
|
16
16
|
# @return [Dor::Services::Client::Process]
|
17
17
|
def process(process)
|
18
18
|
@process ||= Process.new(connection: connection, version: api_version, object_identifier: object_identifier,
|
19
|
-
workflow_name: workflow_name, process: process)
|
19
|
+
workflow_name: workflow_name, process: process, object_workflow_client: self)
|
20
20
|
end
|
21
21
|
|
22
22
|
# @return [Workflow::Response::Workflow]
|
@@ -8,11 +8,22 @@ module Dor
|
|
8
8
|
# @param object_identifier [String] the druid for the object
|
9
9
|
# @param [String] workflow_name The name of the workflow
|
10
10
|
# @param [String] process The name of the workflow step
|
11
|
-
def initialize(connection:, version:, object_identifier:, workflow_name:, process:)
|
11
|
+
def initialize(connection:, version:, object_identifier:, workflow_name:, process:, object_workflow_client:) # rubocop:disable Metrics/ParameterLists
|
12
12
|
super(connection: connection, version: version)
|
13
13
|
@object_identifier = object_identifier
|
14
14
|
@workflow_name = workflow_name
|
15
15
|
@process = process
|
16
|
+
@object_workflow_client = object_workflow_client
|
17
|
+
end
|
18
|
+
|
19
|
+
# Retrieves the process status of the given workflow for the given object identifier
|
20
|
+
# @return [String,nil] status
|
21
|
+
def status
|
22
|
+
doc = object_workflow_client.find.xml
|
23
|
+
|
24
|
+
processes = doc.root.xpath("//process[@name='#{process}']")
|
25
|
+
process = processes.max { |a, b| a.attr('version').to_i <=> b.attr('version').to_i }
|
26
|
+
process&.attr('status')
|
16
27
|
end
|
17
28
|
|
18
29
|
# Updates the status of one step in a workflow.
|
@@ -24,14 +35,6 @@ module Dor
|
|
24
35
|
# @raise [Dor::Services::Client::ConflictResponse] if the current status does not match the value passed in current_status.
|
25
36
|
def update(status:, elapsed: 0, lifecycle: nil, note: nil, current_status: nil)
|
26
37
|
perform_update(status: status, elapsed: elapsed, lifecycle: lifecycle, note: note, current_status: current_status)
|
27
|
-
# resp = connection.get do |req|
|
28
|
-
# req.url "#{api_version}/objects/#{object_identifier}/workflows/#{workflow_name}"
|
29
|
-
# req.headers['Accept'] = 'application/xml'
|
30
|
-
# end
|
31
|
-
|
32
|
-
# raise_exception_based_on_response!(resp) unless resp.success?
|
33
|
-
|
34
|
-
# Dor::Services::Response::Workflow.new(xml: Nokogiri::XML(resp.body))
|
35
38
|
end
|
36
39
|
|
37
40
|
# Updates the status of one step in a workflow to error.
|
@@ -43,7 +46,7 @@ module Dor
|
|
43
46
|
|
44
47
|
private
|
45
48
|
|
46
|
-
attr_reader :object_identifier, :workflow_name, :process
|
49
|
+
attr_reader :object_identifier, :workflow_name, :process, :object_workflow_client
|
47
50
|
|
48
51
|
def perform_update(**payload)
|
49
52
|
resp = connection.put do |req|
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.
|
4
|
+
version: 15.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
- Michael Giarlo
|
9
|
-
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: activesupport
|
@@ -221,7 +220,6 @@ dependencies:
|
|
221
220
|
- - ">="
|
222
221
|
- !ruby/object:Gem::Version
|
223
222
|
version: '0'
|
224
|
-
description:
|
225
223
|
email:
|
226
224
|
- jcoyne@justincoyne.com
|
227
225
|
- leftwing@alumni.rutgers.edu
|
@@ -277,7 +275,6 @@ homepage: https://github.com/sul-dlss/dor-services-client
|
|
277
275
|
licenses: []
|
278
276
|
metadata:
|
279
277
|
rubygems_mfa_required: 'true'
|
280
|
-
post_install_message:
|
281
278
|
rdoc_options: []
|
282
279
|
require_paths:
|
283
280
|
- lib
|
@@ -295,8 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
295
292
|
- !ruby/object:Gem::Version
|
296
293
|
version: '0'
|
297
294
|
requirements: []
|
298
|
-
rubygems_version: 3.
|
299
|
-
signing_key:
|
295
|
+
rubygems_version: 3.6.2
|
300
296
|
specification_version: 4
|
301
297
|
summary: A client for dor-services-app
|
302
298
|
test_files: []
|