[savara-commits] savara SVN: r421 - branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Sep 22 07:07:51 EDT 2010


Author: objectiser
Date: 2010-09-22 07:07:50 -0400 (Wed, 22 Sep 2010)
New Revision: 421

Modified:
   branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
   branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
Log:
Apply positional information to try/catch blocks to help with error reporting.

Modified: branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java	2010-09-22 11:07:40 UTC (rev 420)
+++ branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java	2010-09-22 11:07:50 UTC (rev 421)
@@ -828,32 +828,36 @@
 							getFaultHandlers().getCatchAll() != null)) {
 				org.scribble.conversation.model.TryEscape te=
 						new org.scribble.conversation.model.TryEscape();
+				te.derivedFrom(this);
+				te.getBlock().derivedFrom(this);
 				
 				acts.add(te);
 				
 				acts = te.getBlock().getContents();
 		
 				for (int i=0; i < getFaultHandlers().getCatchPaths().size(); i++) {
+					Catch catchPath=getFaultHandlers().getCatchPaths().get(i);
+					
 					org.scribble.conversation.model.CatchBlock cb=
 						new org.scribble.conversation.model.CatchBlock();
+					cb.derivedFrom(catchPath);				
 					
 					TypeReference tref=new TypeReference();
-					tref.setLocalpart(getFaultHandlers().getCatchPaths().get(i).getFaultName());
+					tref.setLocalpart(catchPath.getFaultName());
 					cb.setType(tref);
 					
 					Variable faultVar=null;
 					
-					if (getFaultHandlers().getCatchPaths().get(i).getFaultVariable() != null) {
+					if (catchPath.getFaultVariable() != null) {
 						faultVar = new Variable(getModel());
-						faultVar.setName(getFaultHandlers().getCatchPaths().get(i).getFaultVariable());
-						faultVar.setMessageType(getFaultHandlers().getCatchPaths().get(i).getFaultMessageType());
-						faultVar.setElement(getFaultHandlers().getCatchPaths().get(i).getFaultMessageElement());			
+						faultVar.setName(catchPath.getFaultVariable());
+						faultVar.setMessageType(catchPath.getFaultMessageType());
+						faultVar.setElement(catchPath.getFaultMessageElement());			
 						context.addVariable(faultVar);
 					}
 					
-					if (getFaultHandlers().getCatchPaths().get(i).getActivity() != null) {
-						getFaultHandlers().getCatchPaths().get(i).getActivity().
-										convert(cb.getContents(), context);
+					if (catchPath.getActivity() != null) {
+						catchPath.getActivity().convert(cb.getContents(), context);
 					}
 					
 					if (faultVar != null) {

Modified: branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
===================================================================
--- branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java	2010-09-22 11:07:40 UTC (rev 420)
+++ branches/1.1.x/tools/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java	2010-09-22 11:07:50 UTC (rev 421)
@@ -617,24 +617,42 @@
 							getFaultHandlers().getCatchAll() != null)) {
 				org.scribble.conversation.model.TryEscape te=
 						new org.scribble.conversation.model.TryEscape();
+				te.derivedFrom(this);
+				te.getBlock().derivedFrom(this);
 				
 				acts.add(te);
 				
 				acts = te.getBlock().getContents();
 		
 				for (int i=0; i < getFaultHandlers().getCatchPaths().size(); i++) {
+					Catch catchPath=getFaultHandlers().getCatchPaths().get(i);
+					
 					org.scribble.conversation.model.CatchBlock cb=
 						new org.scribble.conversation.model.CatchBlock();
+					cb.derivedFrom(catchPath);
 					
 					TypeReference tref=new TypeReference();
-					tref.setLocalpart(getFaultHandlers().getCatchPaths().get(i).getFaultName());
+					tref.setLocalpart(catchPath.getFaultName());
 					cb.setType(tref);
 					
-					if (getFaultHandlers().getCatchPaths().get(i).getActivity() != null) {
-						getFaultHandlers().getCatchPaths().get(i).getActivity().
-										convert(cb.getContents(), context);
+					Variable faultVar=null;
+					
+					if (catchPath.getFaultVariable() != null) {
+						faultVar = new Variable(getModel());
+						faultVar.setName(catchPath.getFaultVariable());
+						faultVar.setMessageType(catchPath.getFaultMessageType());
+						faultVar.setElement(catchPath.getFaultMessageElement());			
+						context.addVariable(faultVar);
 					}
 					
+					if (catchPath.getActivity() != null) {
+						catchPath.getActivity().convert(cb.getContents(), context);
+					}
+					
+					if (faultVar != null) {
+						context.removeVariable(faultVar);
+					}
+
 					te.getEscapeBlocks().add(cb);
 				}
 			}



More information about the savara-commits mailing list