dor-services-client 15.14.0 → 15.15.1
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 +2 -2
- data/README.md +3 -1
- data/lib/dor/services/client/object_version.rb +1 -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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d9a556b75e428095790837c00911af7b048931b9bec6fe9464a76bcffdcc8e
|
4
|
+
data.tar.gz: 07e11749b4376ccefd986e71198ec7cfb3faa22cc942a633493a41a55596b097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a1d37557291d550355aebc22e3de0774d6dbf03da8bce455e0df4f6f040a171b2fb06f9f70dab5731f05015420a4651739fe0fad7c861019ac9ca6e259a66d5
|
7
|
+
data.tar.gz: e0125d4dd139be07ce31ea1f8d0edf77bb516371ae96212517b4467f9e00f318be3e7dfdda8011a0fbb697ab6beb941205dd90c6698b02a86b08329954b91dda
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dor-services-client (15.
|
4
|
+
dor-services-client (15.15.1)
|
5
5
|
activesupport (>= 7.0.0)
|
6
6
|
cocina-models (~> 0.104.1)
|
7
7
|
deprecation
|
@@ -131,7 +131,7 @@ GEM
|
|
131
131
|
rspec-core (~> 3.13.0)
|
132
132
|
rspec-expectations (~> 3.13.0)
|
133
133
|
rspec-mocks (~> 3.13.0)
|
134
|
-
rspec-core (3.13.
|
134
|
+
rspec-core (3.13.5)
|
135
135
|
rspec-support (~> 3.13.0)
|
136
136
|
rspec-expectations (3.13.5)
|
137
137
|
diff-lcs (>= 1.2.0, < 2.0)
|
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
|
@@ -107,7 +107,7 @@ module Dor
|
|
107
107
|
def close(**params)
|
108
108
|
resp = connection.post do |req|
|
109
109
|
req.url close_version_path
|
110
|
-
req.params = params
|
110
|
+
req.params = params.compact
|
111
111
|
req.headers['Content-Type'] = 'application/json'
|
112
112
|
end
|
113
113
|
return resp.body if resp.success?
|
@@ -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,7 +1,7 @@
|
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|