Class: Robots::SdrRepo::SdrRecovery::RecoveryStart

Inherits:
Robots::SdrRepo::SdrRobot show all
Defined in:
lib/sdr_recovery/recovery_start.rb

Overview

Robot for initializing the workflow of each migrated object

Instance Method Summary collapse

Methods inherited from Robots::SdrRepo::SdrRobot

#create_workflow_rows, #get_workflow_status, #get_workflow_xml, #process_item, #transmit, #update_workflow_error_status, #update_workflow_status

Constructor Details

#initialize(opts = {}) ⇒ RecoveryStart


16
17
18
# File 'lib/sdr_recovery/recovery_start.rb', line 16

def initialize(opts = {})
  super(self.class.workflow_name, self.class.step_name, opts)
end

Instance Method Details

#create_recovery_workflow(druid) ⇒ void


30
31
32
33
34
35
# File 'lib/sdr_recovery/recovery_start.rb', line 30

def create_recovery_workflow(druid)
  wf_xml = read_sdr_recovery_workflow_xml()
  # Now bootstrap SDR workflow queue to start SDR robots
  # Set the repo as 'sdr', and do not create a workflows datastream in sedora
  create_workflow_rows('sdr', druid, 'sdrRecoveryWF', wf_xml, opts = {:create_ds => false})
end

#perform(druid) ⇒ void


23
24
25
26
# File 'lib/sdr_recovery/recovery_start.rb', line 23

def perform(druid)
  LyberCore::Log.debug("( #{__FILE__} : #{__LINE__} ) Enter perform")
  create_recovery_workflow(druid)
end

#read_sdr_recovery_workflow_xmlString

Read in the XML file needed to initialize the SDR workflow


39
40
41
# File 'lib/sdr_recovery/recovery_start.rb', line 39

def read_sdr_recovery_workflow_xml()
  IO.read(File.join("#{ROBOT_ROOT}", "config", "workflows", "sdrRecoveryWF", "sdrRecoveryWF.xml"))
end

#verification_files(druid) ⇒ Object


52
53
54
55
# File 'lib/sdr_recovery/recovery_start.rb', line 52

def verification_files(druid)
  files = []
  files
end

#verification_queries(druid) ⇒ Object


43
44
45
46
47
48
49
50
# File 'lib/sdr_recovery/recovery_start.rb', line 43

def verification_queries(druid)
  workflow_url = Dor::Config.workflow.url
  queries = []
  queries << [
      "#{workflow_url}/sdr/objects/#{druid}/workflows/sdrRecoveryWF",
      200, /completed/]
  queries
end