lib/dor/workflow/response/workflow.rb in dor-workflow-client-3.5.0 vs lib/dor/workflow/response/workflow.rb in dor-workflow-client-3.6.0
- old
+ new
@@ -8,17 +8,21 @@
def initialize(xml:)
@xml = xml
end
def pid
- ng_xml.at_xpath('/workflow/@objectId').text
+ workflow['objectId']
end
def workflow_name
- ng_xml.at_xpath('/workflow/@id').text
+ workflow['id']
end
+ def repository
+ workflow['repository']
+ end
+
# @param [Integer] version the version we are checking for.
def active_for?(version:)
result = ng_xml.at_xpath("/workflow/process[@version=#{version}]")
result ? true : false
end
@@ -36,9 +40,13 @@
end
attr_reader :xml
private
+
+ def workflow
+ ng_xml.at_xpath('workflow')
+ end
def process_nodes_for(name:)
ng_xml.xpath("/workflow/process[@name = '#{name}']")
end