dor-workflow-service 1.6.2 → 1.6.3

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGJhOGExNTBmYmI1MjA1NDJjYTBmNWYwNmFiYzk4YzM5ZWIyNWNlNA==
4
+ ZDhmMTA3OThlMzU4MjkxNmJlNDlkMGRhY2Q3MGZmODc1NWEwYTMwMA==
5
5
  data.tar.gz: !binary |-
6
- ZTgyNWI3Mzk4YzQ2MmUxZTk1MzQzYzQzYzQ0OWZmY2Q5MjFjNWFlYg==
6
+ NGJmZTRmYThmNjRiM2Y5NjBhMjFhYjRiZDczZTYzZmE4NDQ0NGUwZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTRlOGE3ZmExZjQ5YmMwOTdiNzM0OTUwZjhlNzAyNWFjN2RiMTU5MTdhZWNm
10
- NGVhNDlkMzEzZWE5OWFiZGExODY0ODZjZDE5Y2IwM2FlZjZhYzFjYTA4Zjhh
11
- M2I2ZGE0YjRjM2IyYTlkYmM0NGM5OTljY2JhMzQ0NmI3ZTk0Nzk=
9
+ NTg5YWU3OWZiZTM4MjE3NjNiYmZhOGQ1NzFlMjQzYzhhMWJkMDMyMTA2MTA4
10
+ OGNmZjllM2FhNWNhNzMwZjNjY2FiOTA2ZmY2YjgwY2MyYjE0ZjYwZjAwOGQ4
11
+ NDg1N2RiNzBhMzc3ZWFiMjAxYWZmY2Y4YzZlMTZlMzFiZmQyMmY=
12
12
  data.tar.gz: !binary |-
13
- NTI5NWUyOWVmZDQxNmUzOTI5ZjFhZDU4ODVkYTMxNGE5YTEzY2ViNDA5MGQ1
14
- Njc4M2FlNGE0MDhlYjZjN2VmNDU2YzM2NDZkZDk4ZGYxMjEyOWJlY2Y1ODdi
15
- ZmJjMmRjNTc4ZGQzODVjNWY3ZDc5ODA1ZGVlNmQ2MTZiM2FlZDE=
13
+ MDQ2YjNmMWQ0MTFhZjI5YjBkMTA0ODkzYmRiYjQxY2RjYzc2ZTdiMzM0Yjg5
14
+ ZWU1YTczOWJlNWZkNjVmNDMzNjI1MzE0YWNjMTBjM2M2MWM5NTFlZTI2MDg2
15
+ ZGNmZjMwNTNiM2E5N2EwM2M2OGQxZjQyNGVjNjI1NDMzZjY5Mzc=
@@ -145,7 +145,7 @@ module Dor
145
145
  # @param [String] workflow The name of the workflow
146
146
  # @param [String] error_msg The error message. Ideally, this is a brief message describing the error
147
147
  # @param [Hash] opts optional values for the workflow step
148
- # @option opts [String] :error_txt A slot to hold more information about the error, like a full stacktrace
148
+ # @option opts [String] :error_text A slot to hold more information about the error, like a full stacktrace
149
149
  # @return [Boolean] always true
150
150
  #
151
151
  # Http Call
@@ -155,7 +155,7 @@ module Dor
155
155
  # PUT "/dor/objects/pid:123/workflows/GoogleScannedWF/convert"
156
156
  # <process name=\"convert\" status=\"error\" />"
157
157
  def update_workflow_error_status(repo, druid, workflow, process, error_msg, opts = {})
158
- opts = {:error_txt => nil}.merge!(opts)
158
+ opts = {:error_text => nil}.merge!(opts)
159
159
  xml = create_process_xml({:name => process, :status => 'error', :errorMessage => error_msg}.merge!(opts))
160
160
  workflow_resource["#{repo}/objects/#{druid}/workflows/#{workflow}/#{process}"].put(xml, :content_type => 'application/xml')
161
161
  return true
@@ -265,6 +265,12 @@ module Dor
265
265
  # "druid:ct021wp7863" => -100
266
266
  # }
267
267
  #
268
+ # @example
269
+ # get_objects_for_workstep(..., with_priority: true, limit: 1)
270
+ # => {
271
+ # "druid:py156ps0477" => 100,
272
+ # }
273
+ #
268
274
  def get_objects_for_workstep completed, waiting, repository=nil, workflow=nil, options = {}
269
275
  result = nil
270
276
  uri_string = "workflow_queue?waiting=#{qualify_step(repository,workflow,waiting)}"
@@ -352,6 +358,7 @@ module Dor
352
358
  def create_process_xml(params)
353
359
  builder = Nokogiri::XML::Builder.new do |xml|
354
360
  attrs = params.reject { |k,v| v.nil? }
361
+ attrs = Hash[ attrs.map {|k,v| [k.to_s.camelize(:lower), v]}] # camelize all the keys in the attrs hash
355
362
  xml.process(attrs)
356
363
  end
357
364
  return builder.to_xml
@@ -1,7 +1,7 @@
1
1
  module Dor
2
2
  module Workflow
3
3
  module Service
4
- VERSION = "1.6.2"
4
+ VERSION = "1.6.3"
5
5
  end
6
6
  end
7
7
  end
@@ -95,8 +95,8 @@ describe Dor::WorkflowService do
95
95
 
96
96
  describe "#update_workflow_error_status" do
97
97
  it "should update workflow status to error and return true if successful" do
98
- @mock_resource.should_receive(:put).with(/status="error"/, { :content_type => 'application/xml' }).and_return('')
99
- Dor::WorkflowService.update_workflow_error_status(@repo, @druid, "etdSubmitWF", "reader-approval", "Some exception", :error_txt =>"The optional stacktrace")
98
+ @mock_resource.should_receive(:put).with(/status="error" errorMessage="Some exception" errorText="The optional stacktrace"/, { :content_type => 'application/xml' }).and_return('')
99
+ Dor::WorkflowService.update_workflow_error_status(@repo, @druid, "etdSubmitWF", "reader-approval", "Some exception", :error_text =>"The optional stacktrace")
100
100
  end
101
101
 
102
102
  it "should return false if the PUT to the DOR workflow service throws an exception" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-workflow-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Willy Mene
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-03 00:00:00.000000000 Z
12
+ date: 2014-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport