Class: RubyTeamSite::WFworkflow

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_teamsite/wfworkflow.rb

Instance Method Summary collapse

Constructor Details

#initialize(wf_id) ⇒ WFworkflow

Initialize the WFworkflow class by getting the workflow from the workflow system by ID.



12
13
14
15
16
17
# File 'lib/ruby_teamsite/wfworkflow.rb', line 12

def initialize(wf_id)
  @workflow_id = wf_id.strip
  @ts_bin = ts_bin
  @workflow = `#{@ts_bin}/iwgetwfobj #{wf_id.strip}`
  set_wf_info(@workflow)
end

Instance Method Details

#creatorObject

Return the name of the workflow creator.



30
31
32
# File 'lib/ruby_teamsite/wfworkflow.rb', line 30

def creator
  return @wf_creator 
end

#descriptionObject

Return the description of the workflow.



40
41
42
# File 'lib/ruby_teamsite/wfworkflow.rb', line 40

def description
  return @wf_desc 
end

#idObject

Return the id of the workflow.



25
26
27
# File 'lib/ruby_teamsite/wfworkflow.rb', line 25

def id
  return @workflow_id 
end

#nameObject

Return the name of the workflow.



20
21
22
# File 'lib/ruby_teamsite/wfworkflow.rb', line 20

def name
  return @wf_name 
end

#ownerObject

Return the name of the workflow owner.



35
36
37
# File 'lib/ruby_teamsite/wfworkflow.rb', line 35

def owner
  return @wf_owner 
end

#variablesObject

Return a hash of variables for this workflow. The key is the name of the variable and the value is its value.



50
51
52
53
54
55
56
57
58
# File 'lib/ruby_teamsite/wfworkflow.rb', line 50

def variables
  wf = Nokogiri::XML(@workflow, nil, 'UTF-8')
  elmnt_vars = wf.css('variables variable')
  wf_vars = Hash.new
  if elmnt_vars.empty? == false
    elmnt_vars.each {|v| wf_vars[v.attribute('key').to_s] = v.attribute('value').to_s}
  end
  return wf_vars
end

#xmlObject

Return the XML output of the workflow.



45
46
47
# File 'lib/ruby_teamsite/wfworkflow.rb', line 45

def xml
  return @workflow 
end