Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Merge d0c3120 into a64e1d9
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed May 13, 2019
2 parents a64e1d9 + d0c3120 commit 1817272
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/dor/services/create_workflow_service.rb
Expand Up @@ -2,13 +2,15 @@

module Dor
class CreateWorkflowService
# Initilizes workflow for the object in the workflow service
extend Deprecation
# Initializes workflow for the object in the workflow service
# It will set the priorty of the new workflow to the current_priority if it is > 0
# It will set lane_id from the item's APO default workflow lane
# @param [String] name of the workflow to be initialized
# @param [Boolean] create_ds create a 'workflows' datastream in Fedora for the object
# @param [Integer] priority the workflow's priority level
def self.create_workflow(item, name:, create_ds: true, priority: 0)
Deprecation.warn(self, 'CreateWorkflowService is deprecated. Use dor-workflow-service instead')
new(item).create_workflow(name: name, create_ds: create_ds, priority: priority)
end

Expand Down
1 change: 1 addition & 0 deletions spec/services/create_workflow_service_spec.rb
Expand Up @@ -7,6 +7,7 @@
subject(:create_workflow) { described_class.create_workflow(item, name: 'accessionWF') }

before do
allow(Deprecation).to receive(:warn)
allow(item).to receive(:admin_policy_object).and_return(apo)
allow(Dor::Config.workflow.client).to receive(:all_workflows_xml).with('druid:ab123cd4567').and_return('<workflows/>')
end
Expand Down

0 comments on commit 1817272

Please sign in to comment.