lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.153 vs lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.154

- old
+ new

@@ -71,11 +71,11 @@ end end def extract_nodelink(doc) doc.find("/bm:definitions/bm:process/bm:*[@id and @name and not(@itemSubjectRef) and not(name()='sequenceFlow')]").each do |e| - n = Node.new(e.attributes['id'],e.qname.name.to_sym,e.attributes['name'].strip,e.find('count(bm:incoming)'),e.find('count(bm:outgoing)')) + n = Node.new(self.object_id,e.attributes['id'],e.qname.name.to_sym,e.attributes['name'].strip,e.find('count(bm:incoming)'),e.find('count(bm:outgoing)')) if e.attributes['scriptFormat'] != '' n.script_type = e.attributes['scriptFormat'] end @@ -187,11 +187,12 @@ puts '--> now on ' + down.to_s if debug debug_print debug, traces if node = traces.same_first if branch.empty? && branch.respond_to?(:id) li = if (branch.id == traces.first_node.id) - ### for tail controlled loops + ### for tail controlled loops, use the link from this to next + ### if a tasks loops to itself, then second_nodes returns the first @graph.link(branch.id,traces.second_nodes.first.id) else @graph.link(branch.id,traces.first_node.id) end unless li.nil? @@ -236,11 +237,11 @@ ### an infinite loop that can only be left by break is created node.incoming = 1 branch << InfiniteLoop.new(node.id) ### add the blank conditional to get a break len = loops.length - loops.add_breaks + loops.add_breaks(self.object_id) puts '--> down loop2 to ' + (down + 1).to_s if debug build_ttree branch.last, loops.dup, nil, debug, down + 1 puts '--> up loop2 from ' + (down + 1).to_s if debug ### set outgoing to number of loops (without the break) so that it can be ignored (should be 1 all the time) node.outgoing -= len @@ -262,10 +263,10 @@ tracesgroup, endnode = traces.segment_by endnode tracesgroup.each do |trcs| nb = branch.last.new_branch if trcs.finished? puts '--> branch down to ' + (down + 1).to_s if debug - build_ttree nb, Traces.new([[Break.new(1)]]), endnode, debug, down + 1 + build_ttree nb, Traces.new([[Break.new(self.object_id,1)]]), endnode, debug, down + 1 puts '--> branch up from ' + (down + 1).to_s if debug else puts '--> branch down to ' + (down + 1).to_s if debug build_ttree nb, trcs, endnode, debug, down + 1 puts '--> branch up from ' + (down + 1).to_s if debug