Project: OpenWFEru
Revision: 1657
Author: jmettraux
Date: 12 Apr 2008 02:30:12
Changes:todo #19440 : replay at error broken. Fixed.
Files:modified: /trunk/densha/public/stylesheets/stores.css (
try)
modified: /trunk/densha/app/controllers/processes_controller.rb (
try)
modified: /trunk/densha/app/views/process/_fexp_environment.rhtml (
try)
modified: /trunk/densha/config/openwferu_engine.rb (
try)
modified: /trunk/densha/public/javascripts/fluo-min.js (
try)
modified: /trunk/densha/app/controllers/process_controller.rb (
try)
Diff:
| ... | ...@@ -72,5 +72,5 @@ |
| 72 | 72 | .store_wi_activity |
| 73 | 73 | { |
| 74 | | width: 20%; |
| 74 | width: 17%; |
| 75 | 75 | float: left; |
| 76 | 76 | } |
| ... | ...@@ -69,9 +69,4 @@ |
| 69 | 69 | @status = $openwferu_engine.process_status @wfid |
| 70 | 70 | |
| 71 | | peh = session[:process_errors] ||= {} |
| 72 | | @status.errors.each do |fei, error| |
| 73 | | peh[fei.to_web_s] = error |
| 74 | | end |
| 75 | | |
| 76 | 71 | render :partial => "process_errors" |
| 77 | 72 | end |
| ... | ...@@ -81,9 +76,12 @@ |
| 81 | 76 | error_wfei = params[:id] |
| 82 | 77 | |
| 83 | | error = session[:process_errors][error_wfei] |
| 78 | wfid, expid = OpenWFE::FlowExpressionId.split_web_s error_wfei |
| 79 | |
| 80 | status = $openwferu_engine.process_status wfid |
| 81 | error = status.errors.values.find { |err| err.fei.expid == expid } |
| 84 | 82 | |
| 85 | 83 | $openwferu_engine.replay_at_error error |
| 86 | 84 | |
| 87 | | session[:process_errors] = nil |
| 85 | #session[:process_errors] = nil |
| 88 | 86 | |
| 89 | 87 | flash[:notice] = "replayed at error" |
| ... | ...@@ -33,5 +33,5 @@ |
| 33 | 33 | -%> |
| 34 | 34 | <div |
| 35 | | id="fexp_<%= fei.expid %>" |
| 35 | id="fexp_<%= fei.expid %>e" |
| 36 | 36 | class="process_unapplied_expression" |
| 37 | 37 | style="<%= style %>" |
| ... | ...@@ -2,5 +2,5 @@ |
| 2 | 2 | #$LOAD_PATH << "~/openwfe-ruby/lib" |
| 3 | 3 | #$LOAD_PATH << "vendor/openwfe-ruby/lib" |
| 4 | | $LOAD_PATH << "../openwfe-ruby/lib" |
| 4 | $LOAD_PATH << "../ruote/lib" |
| 5 | 5 | |
| 6 | 6 | require 'rubygems' |
| ... | ...@@ -54,5 +54,5 @@ |
| 54 | 54 | this.content_div.appendChild(eChildren);this.content_div.appendChild(divClear());this.content_div.appendChild |
| 55 | 55 | (FluoCanvas.newConcurrenceClosing |
| 56 | | (this.content_div.scrollWidth,this.exp_children.length));}});var ProcessDefinitionExpression=Class.create(Expression,{initialize:function($super,container,exp_id,array,desired_width){$super(container,exp_id,array,desired_width);this.process_definition=array;},cssName:function(){return"process_definition";},renderHead:function(){var eHead=newDiv('fluo_exp_pdef_head');this.content_div.appendChild(eHead);var pdef=this.exp_attributes.get('name');var rev=this.exp_attributes.get('revision');if(rev)pdef=pdef+" (rev "+rev+")";var ePdef=newDiv();ePdef.appendChild(tdiv(pdef));eHead.appendChild(ePdef);this.exp_children.each(function(child){if(child[0]=='description'){var eDesc=newDiv();var eItal=new Element("i");eItal.appendChild(tdiv(child[2][0]));eDesc.appendChild(eItal);eHead.appendChild(eDesc);}});},renderChildren:function($super){var a=new Array();this.exp_children.each(function(child){if(child[0]!='description')a.push(child);});this.exp_children=a;$super();}});var NoChildrenExpression=Class.create(Expression,{renderChildren:function(){}});var UnknownExpression=Class.create(NoChildrenExpression,{cssName:function(){return"unknown";},render:function(){var width=this.attMaxSize()*7+35;if(width>this.desired_width)width=this.desired_width-1;var height=this.exp_attributes.size()*21+21;this.renderBox(width,height,null);this.renderHead();}});var OneLineExpression=Class.create(NoChildrenExpression,{cssName:function(){return"oneline";},render:function(){this.renderHead();},renderHead:function(){var eDiv=newDiv(this.cssPrefix()+"_head");var text=this.exp_name;this.exp_attributes.each(function(att){text+=(" "+att.key+": '"+att.value+"'");});eDiv.appendChild(document.createTextNode(text));this.content_div.appendChild(eDiv);}});var ParticipantExpression=Class.create(NoChildrenExpression,{cssName:function(){return"participant";},render:function(){var width=this.attMaxSize()*5+35;if(width>this.desired_width)width=this.desired_width-1;att_count=this.exp_attributes.size()-1;if(att_count<0)att_count=0;var height=25+20*att_count;this.renderBox(width,height,null);this.renderHead();},renderHead:function(){var eDiv=newDiv(this.cssPrefix()+"_head");var ref=this.fetchAttribute('ref');if(!ref)ref=this.fetchText();if(!ref)ref=this.exp_name;var activity=this.exp_attributes.get('activity');eDiv.appendChild(tdiv(ref));if(activity)eDiv.appendChild(tdiv(activity));this.content_div.appendChild(eDiv);}});var SubprocessExpression=Class.create(ParticipantExpression,{cssName:function(){return"subprocess";},render:function(){var width=130;var height=40;this.renderBox(width,height,"subprocess");this.renderHead();}});var CaseExpression=Class.create(Expression,{cssName:function(){return"case";},renderHead:function(){var eDiamond=new Element("img",{"src":"/images/fluo/diamond.png"});this.content_div.appendChild(eDiamond);this.content_div.appendChild(document.createTextNode(this.exp_name));this.content_div.appendChild(divClear());},renderChildren:function(){var consequence=false;for(var i=0;i<this.exp_children.length;i++){var child=this.exp_children[i];if(i==this.exp_children.length-1&&(!consequence)) |
| 56 | (this.content_div.scrollWidth,this.exp_children.length));}});var ProcessDefinitionExpression=Class.create(Expression,{initialize:function($super,container,exp_id,array,desired_width){$super(container,exp_id,array,desired_width);this.process_definition=array;},cssName:function(){return"process_definition";},renderHead:function(){var eHead=newDiv('fluo_exp_pdef_head');this.content_div.appendChild(eHead);var pdef=this.exp_attributes.get('name');var rev=this.exp_attributes.get('revision');if(rev)pdef=pdef+" (rev "+rev+")";var ePdef=newDiv();ePdef.appendChild(tdiv(pdef));eHead.appendChild(ePdef);this.exp_children.each(function(child){if(child[0]=='description'){var eDesc=newDiv();var eItal=new Element("i");eItal.appendChild(tdiv(child[2][0]));eDesc.appendChild(eItal);eHead.appendChild(eDesc);}});},renderChildren:function($super){var a=new Array();this.exp_children.each(function(child){if(child[0]!='description')a.push(child);});this.exp_children=a;$super();}});var NoChildrenExpression=Class.create(Expression,{renderChildren:function(){}});var UnknownExpression=Class.create(NoChildrenExpression,{cssName:function(){return"unknown";},render:function(){var width=this.attMaxSize()*7+35;if(width>this.desired_width)width=this.desired_width-1;var height=this.exp_attributes.size()*21+25;this.renderBox(width,height,null);this.renderHead();}});var OneLineExpression=Class.create(NoChildrenExpression,{cssName:function(){return"oneline";},render:function(){this.renderHead();},renderHead:function(){var eDiv=newDiv(this.cssPrefix()+"_head");var text=this.exp_name;this.exp_attributes.each(function(att){text+=(" "+att.key+": '"+att.value+"'");});eDiv.appendChild(document.createTextNode(text));this.content_div.appendChild(eDiv);}});var ParticipantExpression=Class.create(NoChildrenExpression,{cssName:function(){return"participant";},render:function(){var width=this.attMaxSize()*5+35;if(width>this.desired_width)width=this.desired_width-1;att_count=this.exp_attributes.size()-1;if(att_count<0)att_count=0;var height=25+21*att_count;this.renderBox(width,height,null);this.renderHead();},renderHead:function(){var eDiv=newDiv(this.cssPrefix()+"_head");var ref=this.fetchAttribute('ref');if(!ref)ref=this.fetchText();if(!ref)ref=this.exp_name;var activity=this.exp_attributes.get('activity');eDiv.appendChild(tdiv(ref));if(activity)eDiv.appendChild(tdiv(activity));this.content_div.appendChild(eDiv);}});var SubprocessExpression=Class.create(ParticipantExpression,{cssName:function(){return"subprocess";},render:function(){var width=130;var height=40;this.renderBox(width,height,"subprocess");this.renderHead();}});var CaseExpression=Class.create(Expression,{cssName:function(){return"case";},renderHead:function(){var eDiamond=new Element("img",{"src":"/images/fluo/diamond.png"});this.content_div.appendChild(eDiamond);this.content_div.appendChild(document.createTextNode(this.exp_name));this.content_div.appendChild(divClear());},renderChildren:function(){var consequence=false;for(var i=0;i<this.exp_children.length;i++){var child=this.exp_children[i];if(i==this.exp_children.length-1&&(!consequence)) |
| 57 | 57 | consequence=true;if(consequence){this.renderConsequence(i,child);this.content_div.appendChild(divClear());} |
| 58 | 58 | else{this.renderCondition(i,child);} |
| ... | ...@@ -69,5 +69,6 @@ |
| 69 | 69 | end |
| 70 | 70 | |
| 71 | | @process_stack = @process_stack.sort_by { |fe| fe.fei.expid } |
| 71 | #@process_stack = @process_stack.sort_by { |fe| fe.fei.expid } |
| 72 | @process_stack = sort_process_stack @process_stack |
| 72 | 73 | |
| 73 | 74 | @workitems = @process_stack.inject([]) do |r, fexp| |
| ... | ...@@ -157,5 +158,5 @@ |
| 157 | 158 | unless fei.wfid == wfid |
| 158 | 159 | |
| 159 | | $openwferu_engine.update fexp |
| 160 | $openwferu_engine.update_expression fexp |
| 160 | 161 | |
| 161 | 162 | flash[:notice] = |
| ... | ...@@ -175,4 +176,37 @@ |
| 175 | 176 | end |
| 176 | 177 | |
| 178 | # |
| 179 | # This sort method makes sure that |
| 180 | # a) exps are sorted by expression_id |
| 181 | # b) environments come right after the expression they're bound to. |
| 182 | # |
| 183 | def sort_process_stack (ps) |
| 184 | |
| 185 | #ps = ps.sort_by { |fe| fe.fei.expid } |
| 186 | ps.sort_by do |fe| |
| 187 | |
| 188 | s = "#{fe.fei.expid} #{fe.apply_time ? '' : 'XXX' }" |
| 189 | |
| 190 | s += "z" if ( ! fe.apply_time) or fe.is_a?(OpenWFE::Environment) |
| 191 | |
| 192 | s |
| 193 | end |
| 194 | |
| 195 | #exps, envs = ps.inject([[], []]) do |r, fe| |
| 196 | # target = fe.is_a?(OpenWFE::Environment) ? r[1] : r[0] |
| 197 | # target << fe |
| 198 | # r |
| 199 | #end |
| 200 | #envs.each do |env| |
| 201 | # exps.each_with_index do |exp, i| |
| 202 | # if exp.fei.expid == env.fei.expid |
| 203 | # exps.insert i+1, env |
| 204 | # break |
| 205 | # end |
| 206 | # end |
| 207 | #end |
| 208 | #exps |
| 209 | end |
| 210 | |
| 177 | 211 | end |
| 178 | 212 | |
To list