From dcb08a0c88f993fd622ce995802248cc8d558c48 Mon Sep 17 00:00:00 2001 From: Justin Littman Date: Tue, 21 May 2019 11:33:00 -0400 Subject: [PATCH] Provides version when initiating workflow. --- Gemfile.lock | 2 +- app/services/registration_service.rb | 2 +- spec/services/registration_service_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f043380caa..52d58864c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -143,7 +143,7 @@ GEM faraday (~> 0.15) moab-versioning (~> 4.0) nokogiri (~> 1.8) - dor-workflow-client (3.1.0) + dor-workflow-client (3.2.0) activesupport (>= 3.2.1, < 6) confstruct (>= 0.2.7, < 2) deprecation (~> 0) diff --git a/app/services/registration_service.rb b/app/services/registration_service.rb index 749bcd6d91..53247ef702 100644 --- a/app/services/registration_service.rb +++ b/app/services/registration_service.rb @@ -139,7 +139,7 @@ def initiate_workflow(workflows:, item:, priority:) Honeybadger.notify("RegistrationService received deprecated parameter `initiate_workflow' with: `#{workflows.inspect}'") if workflows.present? workflows.each do |workflow_id| - Dor::Config.workflow.client.create_workflow_by_name(item.pid, workflow_id, priority: priority) + Dor::Config.workflow.client.create_workflow_by_name(item.pid, workflow_id, priority: priority, version: item.current_version) end end diff --git a/spec/services/registration_service_spec.rb b/spec/services/registration_service_spec.rb index fb65c27760..e88a3fab6e 100644 --- a/spec/services/registration_service_spec.rb +++ b/spec/services/registration_service_spec.rb @@ -341,7 +341,7 @@ expect(obj.label).to eq('a' * 254) end - context 'when workflow priority is passed in' do + context 'when initiate workflow is passed in' do let(:workflow_client) { instance_double(Dor::Workflow::Client, create_workflow_by_name: true) } before do @@ -352,7 +352,7 @@ @params[:workflow_priority] = 50 @params[:initiate_workflow] = 'digitizationWF' register - expect(workflow_client).to have_received(:create_workflow_by_name).with(String, 'digitizationWF', priority: 50) + expect(workflow_client).to have_received(:create_workflow_by_name).with(String, 'digitizationWF', priority: 50, version: '1') end end end # context common cases