lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.148 vs lib/cpee/processtransformation/bpmn2.rb in cpee-1.3.149

- old
+ new

@@ -139,11 +139,11 @@ build_ttree @tree, @traces.dup, nil, debug debug_print debug, 'Tree finished' @tree end #}}} - def build_extraces(traces, node) #{{{ + def build_extraces(traces, node) #{{{ dupt = traces.last.dup @graph.next_nodes(node).each_with_index do |n,i| traces << dupt.dup if i > 0 if traces.last.include?(n) traces.last << n @@ -171,10 +171,14 @@ node end end #}}} private :map_node + def print_node(niceid) + @graph.find_node(niceid) + end + 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 @@ -219,32 +223,32 @@ traces.shift_all end puts '--> down loop1 to ' + (down + 1).to_s if debug loops.remove_empty build_ttree branch.last, loops.dup, nil, debug, down + 1 - puts '--> up loop1 from ' + down.to_s if debug + puts '--> up loop1 from ' + (down + 1).to_s if debug 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 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.to_s if debug + 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 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 puts '--> down loop3 to ' + (down + 1).to_s if debug build_ttree branch, loops.dup, nil, debug, down + 1 - puts '--> up loop3 from ' + down.to_s if debug + puts '--> up loop3 from ' + (down + 1).to_s if debug end traces.remove(loops) traces.remove_empty end else @@ -254,14 +258,14 @@ 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 - puts '--> branch up from ' + down.to_s if debug + 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.to_s if debug + puts '--> branch up from ' + (down + 1).to_s if debug end endnode.incoming -= 1 unless endnode.nil? end traces.empty! if endnode.nil? ### all before is reduced to one incoming arrow