Class: WorkflowProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/datastreams/workflow_definition_ds.rb

Instance Method Summary collapse

Constructor Details

#initialize(workflow, node) ⇒ WorkflowProcess

Returns a new instance of WorkflowProcess.



3
4
5
6
# File 'lib/datastreams/workflow_definition_ds.rb', line 3

def initialize(workflow, node)
  @workflow = workflow
  @node = node
end

Instance Method Details

#labelObject



20
21
22
# File 'lib/datastreams/workflow_definition_ds.rb', line 20

def label
  @node.at_xpath('label/text()').to_s
end

#lifecycleObject



16
17
18
# File 'lib/datastreams/workflow_definition_ds.rb', line 16

def lifecycle
  @node['lifecycle']
end

#nameObject



8
9
10
# File 'lib/datastreams/workflow_definition_ds.rb', line 8

def name
  @node['name']
end

#prerequisitesObject



24
25
26
27
28
29
30
31
32
# File 'lib/datastreams/workflow_definition_ds.rb', line 24

def prerequisites
  @node.xpath('prereq').collect do |p| 
    if (p['repository'].nil? and p['workflow'].nil?) or (p['repository'] == workflow.repository and p['workflow'] == workflow.name)
      p.text.to_s
    else
      [(p['repository'] or workflow.repository),(p['workflow'] or workflow.name),p.text.to_s].join(':')
    end
  end
end

#sequenceObject



12
13
14
# File 'lib/datastreams/workflow_definition_ds.rb', line 12

def sequence
  @node['sequence']
end