Hi, all
I implelemted a pause/resume control.
I use /process_definitions/vacation_request_0.rb
I pause the process a the process shows the paused to true,
but when I try to resume,
I got this error from OpenWFE:Engine Class

Errno::ENOENT in EadminController#resume_process
No such file or directory - work_development/ejournal/20070913-
narerubano.ejournal
vendor/openwfe-ruby/lib/openwfe/expool/errorjournal.rb:407:in `delete'
vendor/openwfe-ruby/lib/openwfe/expool/errorjournal.rb:407:in
`remove_errors'
vendor/openwfe-ruby/lib/openwfe/expool/expressionpool.rb:463:in
`resume_process'
vendor/openwfe-ruby/lib/openwfe/engine/engine.rb:581:in
`resume_process'
app/controllers/eadmin_controller.rb:73:in `resume_process'

The patch that the pause/resume is implemented
1ª Implement eadmin methods to "prototype" js (rails way) toggleErrors
togglePauseResume
2º Rename some div id
3º clean valign=top
4º Add pause/resume process control

Index: app/controllers/eadmin_controller.rb
===================================================================
--- app/controllers/eadmin_controller.rb        (revisión: 1033)
+++ app/controllers/eadmin_controller.rb        (copia de trabajo)
@@ -66,5 +66,22 @@
     @status = $openwferu_engine.list_process_status(wfid)
     render :partial => "show_process_errors"
   end
+
+  def resume_process
+    wfid = params[:id]

+    $openwferu_engine.resume_process(wfid)
+
+    render :partial => "show_process_status"
+  end
+
+  def pause_process
+    wfid = params[:id]
+
+    $openwferu_engine.pause_process(wfid)
+
+    @status = $openwferu_engine.list_process_status(wfid)
+
+    render :partial => "show_process_status"
+  end
 end
Index: app/views/eadmin/_show_process_status.rhtml
===================================================================
--- app/views/eadmin/_show_process_status.rhtml (revisión: 0)
+++ app/views/eadmin/_show_process_status.rhtml (revisión: 0)
@@ -0,0 +1,7 @@
+<%
+    @status.values.each do |sta|
+-%>
+        <%= sta.paused? %>
+<%
+    end
+-%>
\ Sin fin-de-línea al final del archivo
Index: app/views/eadmin/index.rhtml
===================================================================
--- app/views/eadmin/index.rhtml        (revisión: 1033)
+++ app/views/eadmin/index.rhtml        (copia de trabajo)
@@ -2,37 +2,81 @@
 function toggleErrors (wfid) {

     element_errors = $("errors_"+wfid);
-    element_unhide = $("unhide_"+wfid);
-    element_hide = $("hide_"+wfid);
+    element_unhide = $("err_unhide_"+wfid);
+    element_hide = $("err_hide_"+wfid);

     if ( ! element_errors.visible()) {

-        element_unhide.style.display = 'none';
-        element_hide.style.display = 'block';
-        element_errors.style.display = 'block';
+        element_unhide.hide();
+        element_hide.show();
+        element_errors.show();
     }
     else {
-        element_hide.style.display = 'none';
-        element_unhide.style.display = 'block';
-        element_errors.style.display = 'none';
+        element_hide.hide();
+        element_unhide.show();
+        element_errors.hide();
     }

     return false;
 }
+
+function togglePauseResume (wfid) {
+
+    element_pause = $("pause_ctl_"+wfid);
+    element_resume = $("resume_ctl_"+wfid);
+
+    if ( ! element_pause.visible()) {
+
+        element_resume.hide();
+        element_pause.show();
+    }
+    else {
+        element_pause.hide();
+        element_resume.show();
+    }
+
+    return false;
+}
 </script>

 <table border=0>
     <tr>
-        <th>workflow instance id</th><th>name</th><th>errors</
th><th>paused</d><th></th><th></th>
+        <th>workflow instance id</th><th>name</th><th>errors</
th><th>paused</d><th></th><th></th><th></th>
     </tr>
     <%
         @status.values.each do |sta|
     -%>
     <tr>
-        <td valign="top"><%=sta.wfid%></td>
-        <td valign="top"><%=sta.expressions[0].fei.wfname%></td>
-        <td valign="top"><%=sta.errors.length%></td>
-        <td valign="top"><%=sta.paused?%></td>
+        <td><%=sta.wfid%></td>
+        <td><%=sta.expressions[0].fei.wfname%></td>
+        <td><%=sta.errors.length%></td>
+        <td>
+            <div id="sta_paused_<%= sta.wfid %>">
+                <%= sta.paused? %>
+            </div>
+        </td>
+        <td>
+            <div id="pause_ctl_<%=sta.wfid%>"
+                style="display: <%= sta.paused? ? "none" : "block"
%>"
+            >
+                <%= link_to_remote(
+                        "pause",
+                        :update => "sta_paused_" + sta.wfid,
+                        :url => {
+                            :action => 'pause_process', :id =>
sta.wfid },
+                        :loaded => "togglePauseResume('"+sta.wfid
+"')") -%>
+            </div>
+            <div id="resume_ctl_<%=sta.wfid%>"
+                style="display: <%= sta.paused? ? "block" : "none"
%>"
+            >
+                <%= link_to_remote(
+                        "resume",
+                        :update => "sta_paused_" + sta.wfid,
+                        :url => {
+                            :action => 'resume_process', :id =>
sta.wfid },
+                        :loaded => "togglePauseResume('"+sta.wfid
+"')") -%>
+            </div>
+        </td>
         <td valign="top"><%=
             link_to(
                 'cancel',
@@ -40,9 +84,9 @@
                 :confirm => "Are you sure ?",
                 :title => "cancels the process instance entirely")
         -%></td>
-        <td valign="top">
+        <td>
             <div
-                id="unhide_<%=sta.wfid%>"
+                id="err_unhide_<%=sta.wfid%>"
                 style="display: <%= sta.errors.length.zero? ?
"none" : "block" %>;"
             >
                 <%= link_to_remote(
@@ -52,7 +96,7 @@
                             :action => 'show_process_errors', :id =>
sta.wfid },
                         :loaded => "toggleErrors('"+sta.wfid+"')") -
%>
             </div>
-            <div id="hide_<%= sta.wfid %>" style="display: none">
+            <div id="err_hide_<%= sta.wfid %>" style="display: none">
                 <%= link_to_function(
                     "hide errors",
                     "toggleErrors('"+sta.wfid+"')") -%>
@@ -60,7 +104,7 @@
        </td>
    </tr>
    <tr>
-       <td valign="top" colspan="6">
+       <td colspan="7">
            <div id="errors_<%= sta.wfid %>" style="display: none">
            </div>
        </td>


Thanks a lot, best regards.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to