lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.140 vs lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.141

- old
+ new

@@ -171,11 +171,11 @@ node end end #}}} private :map_node - def build_ttree(branch,traces,enode=nil,debug=false) + def build_ttree(branch,traces,enode=nil,debug=false,down=0) while not traces.finished? ### if traces exist more than once, make it so they exist only once ### if somebody creates a modell with an inclusive/exclusive that ### has identical branches with different conditions, we are fucked ### but how are the odds? right? right? @@ -210,40 +210,40 @@ loops.pop_all else traces.shift_all end loops.remove_empty - build_ttree branch.last, loops, nil, debug + build_ttree branch.last, loops.dup, nil, debug, down + 1 else ### dont remove it, treat it as a normal conditional ### 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 - build_ttree branch.last, loops, nil, debug + build_ttree branch.last, loops.dup, nil, debug, down + 1 ### set outgoing to number of loops (without the break) so that it can be ignored (should be 1 all the time) node.outgoing -= len end else node.incoming -= loops.length ### throw away the loop traces, remove loop traces from front of all other traces traces.segment_by_loops loops - build_ttree branch, loops, nil, debug + build_ttree branch, loops.dup, nil, debug, down + 1 end traces.remove(loops) traces.remove_empty end else endnode = traces.find_endnode || enode tracesgroup, endnode = traces.segment_by endnode tracesgroup.each do |trcs| nb = branch.last.new_branch if trcs.finished? - build_ttree nb, Traces.new([[Break.new(1)]]), endnode, debug + build_ttree nb, Traces.new([[Break.new(1)]]), endnode, debug, down + 1 else - build_ttree nb, trcs, endnode, debug + build_ttree nb, trcs, endnode, debug, down + 1 end endnode.incoming -= 1 unless endnode.nil? end ### all before is reduced to one incoming arrow ### if now there is still more than one incoming we have a loop situation