Class: CPEE::Transformation::Source::PTML

Inherits:
Object
  • Object
show all
Defined in:
lib/cpee/transformation/ptml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ PTML

{{{



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cpee/transformation/ptml.rb', line 31

def initialize(xml) #{{{
  Node.class_variable_set(:@@niceid,  {})

  @tree = Tree.new
  @start = nil

  doc = XML::Smart.string(xml)

  @graph = Graph.new
  extract_nodelink(doc)

  if @start.nil?
    @traces = Traces.new [[]]
  else
    @traces = Traces.new [[@start]]
  end
end

Instance Attribute Details

#dataelementsObject (readonly)

Returns the value of attribute dataelements.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def dataelements
  @dataelements
end

#endpointsObject (readonly)

Returns the value of attribute endpoints.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def endpoints
  @endpoints
end

#graphObject (readonly)

Returns the value of attribute graph.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def graph
  @graph
end

#startObject (readonly)

Returns the value of attribute start.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def start
  @start
end

#tracesObject (readonly)

Returns the value of attribute traces.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def traces
  @traces
end

#treeObject (readonly)

Returns the value of attribute tree.



29
30
31
# File 'lib/cpee/transformation/ptml.rb', line 29

def tree
  @tree
end

Instance Method Details

}}}



124
125
126
127
128
129
130
131
# File 'lib/cpee/transformation/ptml.rb', line 124

def extract_nodelink(doc) #{{{
  #extract nodes
  sid = doc.find("//processTree/@root").first.value
  @last = 0
  iterate_ptml(sid,doc)
  pp @last
  pp @graph
end