New patch
Change unhide div to not display when errors=0
+ <div id="unhide_<%=sta.wfid%>" style="display:
+ <%= sta.errors.length.zero? ? "none" : "block" %> ">
Javascript "a la rails"
+ <%=link_to_function( "hide errors",
+ "toggleErrors('"<< sta.wfid << "')")%>
Index: app/controllers/eadmin_controller.rb
===================================================================
--- app/controllers/eadmin_controller.rb (revisión: 1028)
+++ app/controllers/eadmin_controller.rb (copia de trabajo)
@@ -58,6 +58,12 @@
flash[:notice] = "process instance #{wfid} got cancelled"
redirect_to :action => "index"
- end
-
+ end
+
+ def show_process_errors
+
+ wfid = params[:id]
+ @status=$openwferu_engine.list_process_status(wfid)
+ render :partial => "show_process_errors"
+ end
end
Index: app/views/eadmin/index.rhtml
===================================================================
--- app/views/eadmin/index.rhtml (revisión: 1028)
+++ app/views/eadmin/index.rhtml (copia de trabajo)
@@ -1,26 +1,71 @@
+<script>
+
+function toggleErrors(wfid){
+ element_errors = document.getElementById("errors_"+wfid);
+ element_unhide = document.getElementById("unhide_"+wfid);
+ element_hide = document.getElementById("hide_"+wfid);
+
+ if (element_errors.style.display == 'none') {
+ element_unhide.style.display = 'none';
+ element_hide.style.display = 'block';
+ element_errors.style.display = 'block';
+
+ } else {
+ element_hide.style.display = 'none';
+ element_unhide.style.display = 'block';
+ element_errors.style.display = 'none';
+ }
+}
+</script>
+
+
<table border=0>
<tr>
- <td>workflow instance id</td><td>name</td><td>errors</
td><td>paused</d><td></td>
+ <th>workflow instance id</th><th>name</th><th>errors</
th><th>paused</th><th></th><th></th>
</tr>
<%
@status.values.each do |sta|
-%>
<tr>
- <td><%=sta.wfid%></td>
- <td><%=sta.expressions[0].fei.wfname%></td>
- <td><%=sta.errors.length%></td>
- <td><%=sta.paused?%></td>
- <td><%=
+ <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 valign="top">
+ <%=
link_to(
'cancel',
{ :action => 'cancel_process', :id => sta.wfid },
:confirm => "Are you sure ?",
:title => "cancels the process instance entirely")
- -%></td>
+ -%>
+ </td >
+ <td valign="top">
+ <div id="unhide_<%=sta.wfid%>" style="display:
+ <%= sta.errors.length.zero? ? "none" : "block" %> ">
+ <%= link_to_remote( "errors details",
+ :update => "errors_" << sta.wfid,
+ :url =>{ :action =>
'show_process_errors', :id => sta.wfid },
+ :loaded => "toggleErrors('" << sta.wfid <<
"')") %>
+ </div>
+ <div id="hide_<%=sta.wfid%>" style="display: none">
+ <%=link_to_function( "hide errors",
+ "toggleErrors('"<< sta.wfid << "')")%>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" colspan="6">
+ <div id="errors_<%=sta.wfid%>" style="display: none">
+ </div>
+ </td>
</tr>
<%
end
-%>
</table>
+
+
+
Index: app/views/eadmin/_show_process_errors.rhtml
===================================================================
--- app/views/eadmin/_show_process_errors.rhtml (revisión: 0)
+++ app/views/eadmin/_show_process_errors.rhtml (revisión: 0)
@@ -0,0 +1,15 @@
+<%
+ @status.each_pair do |stafeid,staerr|
+ staerr.errors.each_pair do |feid,perror|
+-%>
+ <b>fei:</b> <%=perror.fei%></br>
+ <b>workitem:</b> <%=perror.workitem%></br>
+ <b>date:</b> <%=perror.date%></br>
+ <b>class:</b> <%=perror.error_class%></br>
+ <b>message:</b> <%=perror.message%></br>
+ <b>stacktrace:</b> <%=perror.stacktrace%></br>
+<%
+ end
+ end
+-%>
+
Saludos cordiales.
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
-~----------~----~----~----~------~----~------~--~---