dor-workflow-service 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -182,7 +182,7 @@ module Dor
182
182
  end
183
183
 
184
184
  # Returns the Date for a requested milestone ONLY FROM THE ACTIVE workflow table
185
- # @param [String] repo epository name
185
+ # @param [String] repo repository name
186
186
  # @param [String] druid object id
187
187
  # @param [String] milestone name of the milestone being queried for
188
188
  # @return [Time] when the milestone was achieved. Returns nil if the milestone does not exist
@@ -315,6 +315,28 @@ module Dor
315
315
  result
316
316
  end
317
317
 
318
+ # Returns the number of objects that have a status of 'error' in a particular workflow and step
319
+ #
320
+ # @param [String] workflow name
321
+ # @param [String] step name
322
+ # @param [String] repository -- optional, default=dor
323
+ #
324
+ # @return [Integer] Number of objects with this repository:workflow:step that have a status of 'error'
325
+ def count_errored_for_workstep(workflow, step, repository='dor')
326
+ count_objects_in_step(workflow, step, repository, 'error')
327
+ end
328
+
329
+ # Returns the number of objects that have a status of 'queued' in a particular workflow and step
330
+ #
331
+ # @param [String] workflow name
332
+ # @param [String] step name
333
+ # @param [String] repository -- optional, default=dor
334
+ #
335
+ # @return [Integer] Number of objects with this repository:workflow:step that have a status of 'queued'
336
+ def count_queued_for_workstep(workflow, step, repository='dor')
337
+ count_objects_in_step(workflow, step, repository, 'queued')
338
+ end
339
+
318
340
  # Gets all of the workflow steps that have a status of 'queued' that have a last-updated timestamp older than the number of hours passed in
319
341
  # This will enable re-queueing of jobs that have been lost by the job manager
320
342
  # @param [String] repository name of the repository you want to query, like 'dor' or 'sdr'
@@ -465,6 +487,14 @@ module Dor
465
487
  doc.to_xml
466
488
  end
467
489
 
490
+ def count_objects_in_step(workflow, step, type, repo)
491
+ uri_string = "workflow_queue?repository=#{repo}&workflow=#{workflow}&#{type}=#{step}"
492
+ resp = @workflow_resource[uri_string].get
493
+ node = Nokogiri::XML(resp).at_xpath('/objects')
494
+ raise "Unable to determine count from response" if node.nil?
495
+ node['count'].to_i
496
+ end
497
+
468
498
  end
469
499
  end
470
500
  end
@@ -1,7 +1,7 @@
1
1
  module Dor
2
2
  module Workflow
3
3
  module Service
4
- VERSION = "1.7.1"
4
+ VERSION = "1.7.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-workflow-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Willy Mene
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-06-03 00:00:00.000000000 Z
13
+ date: 2014-08-13 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activesupport
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ~>
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
@@ -28,6 +31,7 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: nokogiri
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
36
  - - ~>
33
37
  - !ruby/object:Gem::Version
@@ -35,6 +39,7 @@ dependencies:
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
44
  - - ~>
40
45
  - !ruby/object:Gem::Version
@@ -42,6 +47,7 @@ dependencies:
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: rest-client
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ~>
47
53
  - !ruby/object:Gem::Version
@@ -49,6 +55,7 @@ dependencies:
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
60
  - - ~>
54
61
  - !ruby/object:Gem::Version
@@ -56,6 +63,7 @@ dependencies:
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: confstruct
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
68
  - - ~>
61
69
  - !ruby/object:Gem::Version
@@ -63,6 +71,7 @@ dependencies:
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
76
  - - ~>
68
77
  - !ruby/object:Gem::Version
@@ -70,6 +79,7 @@ dependencies:
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: rake
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
84
  - - ! '>='
75
85
  - !ruby/object:Gem::Version
@@ -77,6 +87,7 @@ dependencies:
77
87
  type: :development
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
92
  - - ! '>='
82
93
  - !ruby/object:Gem::Version
@@ -84,6 +95,7 @@ dependencies:
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: rspec
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
100
  - - ! '>='
89
101
  - !ruby/object:Gem::Version
@@ -91,6 +103,7 @@ dependencies:
91
103
  type: :development
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
108
  - - ! '>='
96
109
  - !ruby/object:Gem::Version
@@ -98,6 +111,7 @@ dependencies:
98
111
  - !ruby/object:Gem::Dependency
99
112
  name: yard
100
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
101
115
  requirements:
102
116
  - - ! '>='
103
117
  - !ruby/object:Gem::Version
@@ -105,6 +119,7 @@ dependencies:
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
108
123
  requirements:
109
124
  - - ! '>='
110
125
  - !ruby/object:Gem::Version
@@ -112,6 +127,7 @@ dependencies:
112
127
  - !ruby/object:Gem::Dependency
113
128
  name: redcarpet
114
129
  requirement: !ruby/object:Gem::Requirement
130
+ none: false
115
131
  requirements:
116
132
  - - ! '>='
117
133
  - !ruby/object:Gem::Version
@@ -119,6 +135,7 @@ dependencies:
119
135
  type: :development
120
136
  prerelease: false
121
137
  version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
122
139
  requirements:
123
140
  - - ! '>='
124
141
  - !ruby/object:Gem::Version
@@ -126,6 +143,7 @@ dependencies:
126
143
  - !ruby/object:Gem::Dependency
127
144
  name: equivalent-xml
128
145
  requirement: !ruby/object:Gem::Requirement
146
+ none: false
129
147
  requirements:
130
148
  - - ~>
131
149
  - !ruby/object:Gem::Version
@@ -133,6 +151,7 @@ dependencies:
133
151
  type: :development
134
152
  prerelease: false
135
153
  version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
136
155
  requirements:
137
156
  - - ~>
138
157
  - !ruby/object:Gem::Version
@@ -161,26 +180,27 @@ files:
161
180
  - spec/workflow_service_spec.rb
162
181
  homepage: https://consul.stanford.edu/display/DOR/DOR+services#DORservices-initializeworkflow
163
182
  licenses: []
164
- metadata: {}
165
183
  post_install_message:
166
184
  rdoc_options: []
167
185
  require_paths:
168
186
  - lib
169
187
  required_ruby_version: !ruby/object:Gem::Requirement
188
+ none: false
170
189
  requirements:
171
190
  - - ! '>='
172
191
  - !ruby/object:Gem::Version
173
192
  version: '0'
174
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
+ none: false
175
195
  requirements:
176
196
  - - ! '>='
177
197
  - !ruby/object:Gem::Version
178
198
  version: '0'
179
199
  requirements: []
180
200
  rubyforge_project:
181
- rubygems_version: 2.2.2
201
+ rubygems_version: 1.8.25
182
202
  signing_key:
183
- specification_version: 4
203
+ specification_version: 3
184
204
  summary: Provides convenience methods to work with the DOR Workflow Service
185
205
  test_files:
186
206
  - spec/spec_helper.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWU4NWM0YzAyOThhYjA0YzM0Y2U2ZjYxMWI2OTk3MTIyMmFjNzJmYw==
5
- data.tar.gz: !binary |-
6
- NmQ2ZDIwMDFiYjI1OGZhNWUxNDU1MzgxNGEzMjZkZjM1ZWYzOTgzOA==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- MTE2ODZkMDZiNzI4NWNhNzEwNWE0NmI5NmIxZjU3M2ZmZjZmZTA2ZTY2NWVm
10
- NWM1ZTZlOWEwOGM2MTA4ZjM2ZTQ0OGUwNTg0ZjYwM2ViYTU3OTU1NDdkNzg5
11
- ODk4NmZiYjhhODhjZjliZWZjZTVjNzZiMDc1OGU1YTA4MmVhMjE=
12
- data.tar.gz: !binary |-
13
- ZDdiYjBlNWVhZWJlN2UwMjEwMWI3MTJkNjAxMzc0NTkzZDNjYzFkYWYxYTFh
14
- MmJiYmNjYzg2NWFmMmYwMGRhMDY1MDAyZWVlYzdkYzhlMjY1MzgxNWE5Yjg0
15
- MzA1MjdmNTY4ZTE2NjUwMDY5NzgyOTZiYTJlN2UzYTAxNDIzMmE=