<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,8 +4,9 @@
 
 == ruote - 0.9.21    not yet released
 
-- bug : passing a URI for launching failed. Fixed by Enrico Bianco
-- bug : engine.process_status(wfid) not listing subp expressions. Fixed.
+- bug    issue with on_cancel and get /processes. Thanks Gonzalo
+- bug    passing a URI for launching failed. Fixed by Enrico Bianco
+- bug    engine.process_status(wfid) not listing subp expressions. Fixed.
 - bug   #25953 : conflict with Rails #observers method. Fixed.
 - todo  #25799 : implemented engine.reapply(exp)
 - bug   #25832 : scheduled launch broken. Fixed.</diff>
      <filename>CHANGELOG.txt</filename>
    </modified>
    <modified>
      <diff>@@ -66,11 +66,24 @@ module OpenWFE
     #
     def find_root_expression
 
-      self.find do |fexp|
+      #self.sort { |fe0, fe1|
+      #  fei0 = fe0.fei; fei1 = fe1.fei
+      #  &quot;#{fei0.wfid} #{fei0.expid}&quot; &lt;=&gt; &quot;#{fei1.wfid} #{fei1.expid}&quot;
+      #}.collect { |fexp|
+      #  puts &quot;#{fexp.fei.wfid} #{fexp.fei.expid}&quot;
+      #}
+
+      self.find { |fexp|
         fexp.fei.expid == '0' &amp;&amp;
         ( ! fexp.is_a?(OpenWFE::Environment)) &amp;&amp;
         fexp.fei.is_in_parent_process?
-      end
+      } ||
+      self.sort { |fe0, fe1|
+        fei0 = fe0.fei; fei1 = fe1.fei
+        &quot;#{fei0.wfid} #{fei0.expid}&quot; &lt;=&gt; &quot;#{fei1.wfid} #{fei1.expid}&quot;
+      }.find { |fexp|
+        ( ! fexp.is_a?(OpenWFE::Environment))
+      }
     end
 
     #
@@ -83,23 +96,23 @@ module OpenWFE
 
     protected
 
-      #
-      # If a child expression is present (in the process stack)
-      # makes sure to take its current representation and include
-      # it in the parent representation.
-      #
-      def get_updated_rep (flow_expression)
-
-        rep = flow_expression.raw_representation.dup
-        rep[2] = rep[2].dup
+    #
+    # If a child expression is present (in the process stack)
+    # makes sure to take its current representation and include
+    # it in the parent representation.
+    #
+    def get_updated_rep (flow_expression)
 
-        (flow_expression.children || []).each do |fei|
-          fexp = find_expression(fei)
-          next unless fexp
-          rep[2][fei.child_id.to_i] = get_updated_rep(fexp)
-        end
+      rep = flow_expression.raw_representation.dup
+      rep[2] = rep[2].dup
 
-        rep
+      (flow_expression.children || []).each do |fei|
+        fexp = find_expression(fei)
+        next unless fexp
+        rep[2][fei.child_id.to_i] = get_updated_rep(fexp)
       end
+
+      rep
+    end
   end
 end</diff>
      <filename>lib/openwfe/expool/representation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -197,7 +197,7 @@ module OpenWFE
               object_to_xml(k, options)
               object_to_xml(v, options)
             end
-          end
+          end if h
         end
       end
     end</diff>
      <filename>lib/openwfe/util/xml.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5cc4a81016fb45f5e4754c407cc202b3ef0470ad</id>
    </parent>
  </parents>
  <author>
    <name>John Mettraux</name>
    <email>jmettraux@gmail.com</email>
  </author>
  <url>http://github.com/jmettraux/ruote/commit/bbb90e68d5399a2a62c020b83ecf65403ac0f75d</url>
  <id>bbb90e68d5399a2a62c020b83ecf65403ac0f75d</id>
  <committed-date>2009-11-02T21:53:58-08:00</committed-date>
  <authored-date>2009-11-02T21:53:58-08:00</authored-date>
  <message>small fix for issue with on_cancel and get /processes. Thanks Gonzalo</message>
  <tree>fae8d1ab378f8e790de98c2a6d7f83a0b0bb5201</tree>
  <committer>
    <name>John Mettraux</name>
    <email>jmettraux@gmail.com</email>
  </committer>
</commit>
