[savara-commits] savara SVN: r73 - in tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src: java/org/jboss/savara/tools/bpel/model/change and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 5 18:22:06 EST 2009


Author: objectiser
Date: 2009-11-05 18:22:06 -0500 (Thu, 05 Nov 2009)
New Revision: 73

Removed:
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/results/EventHandler at Store.bpel
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/testmodels/EventHandler at Store.scv
Modified:
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/IfModelChangeRule.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv
Log:
Updated to handle variables declared in catch blocks, generation of bpel deployment descriptor (most details), fix some generation tests - had to remove some based on just scribble to BPEL, as scribble model does not have enough details (i.e. the info from the Contract that is created by the choreography to scribble module).

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/generator/Generator.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -48,6 +48,46 @@
  */
 public class Generator {
 
+	private static final String BPEL_DEPLOY_DESCRIPTOR_FILENAME = "bpel-deploy.xml";
+
+	private static final String XMLNS_PREFIX = "xmlns:";
+
+	private static final String SERVICE_LABEL = "service";
+
+	private static final String PROVIDE_LABEL = "provide";
+
+	private static final String PARTNER_LINK_LABEL = "partnerLink";
+
+	private static final String INVOKE_LABEL = "invoke";
+
+	private static final String ACTIVE_LABEL = "active";
+
+	private static final String PROCESS_LABEL = "process";
+
+	private static final String DEPLOY_LABEL = "deploy";
+
+	private static final String APACHE_ODE_NAMESPACE = "http://www.apache.org/ode/schemas/dd/2007/03";
+
+	private static final String PORT_TYPE_LABEL = "portType";
+
+	private static final String TARGET_NAMESPACE_LABEL = "targetNamespace";
+
+	private static final String PLNK_ROLE = "plnk:role";
+
+	private static final String NAME_LABEL = "name";
+
+	private static final String PLNK_PARTNER_LINK_TYPE = "plnk:partnerLinkType";
+
+	private static final String WSDL_DEFINITIONS = "wsdl:definitions";
+
+	private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
+
+	private static final String PLNKTYPE_NS = "http://docs.oasis-open.org/wsbpel/2.0/plnktype";
+
+	private static final String XMLNS_WSDL = "xmlns:wsdl";
+
+	private static final String XMLNS_PLNK = "xmlns:plnk";
+	
 	/**
 	 * This is the constructor for the generator.
 	 * 
@@ -210,9 +250,12 @@
 			for (int i=0; i < roles.size(); i++) {
 				generateWSDL(roles.get(i), proj, localcm);
 			}
-						
+			
 			// Generate WSDL with partner link types
 			generatePartnerLinkTypes(role, proj, localcm, bpelProcess);
+			
+			// Generate BPEL deployment descriptor
+			generateBPELDeploy(role, proj, localcm, bpelProcess);
 		}
 	}
 	
@@ -276,22 +319,27 @@
 		
 		org.w3c.dom.Document doc=javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();;
 		
-		org.w3c.dom.Element defn=doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "definition");
+		org.w3c.dom.Element defn=doc.createElement(WSDL_DEFINITIONS);
 		doc.appendChild(defn);
 		
-		defn.setAttribute("xmlns:plnk", "http://docs.oasis-open.org/wsbpel/2.0/plnktype");
+		defn.setAttribute(XMLNS_PLNK, PLNKTYPE_NS);
+		defn.setAttribute(XMLNS_WSDL, WSDL_NS);
 		
+		defn.setAttribute(TARGET_NAMESPACE_LABEL, bpelProcess.getTargetNamespace());
+		
+		java.util.Map<String, String> nsMap=new java.util.HashMap<String, String>();
+		
 		for (PartnerLink pl : bpelProcess.getPartnerLinks()) {
-			org.w3c.dom.Element plt=doc.createElement("plnk:partnerLinkType");
+			org.w3c.dom.Element plt=doc.createElement(PLNK_PARTNER_LINK_TYPE);
 			
-			plt.setAttribute("name", pl.getPartnerLinkType());
+			plt.setAttribute(NAME_LABEL, XMLUtils.getLocalname(pl.getPartnerLinkType()));
 			
 			if (pl.getPartnerRole() != null && pl.getPartnerRole().trim().length() > 0) {
-				org.w3c.dom.Element plRole=doc.createElement("plnk:role");
+				org.w3c.dom.Element plRole=doc.createElement(PLNK_ROLE);
 				
 				plt.appendChild(plRole);
 				
-				plRole.setAttribute("name", pl.getPartnerRole());
+				plRole.setAttribute(NAME_LABEL, pl.getPartnerRole());
 				
 				Role useRole=null;
 				
@@ -309,17 +357,26 @@
 					if (contract.getInterfaces().size() > 0) {
 						Interface intf=contract.getInterfaces().get(0);
 						
-						plRole.setAttribute("portType", intf.getName());
+						String prefix=null;
+						String portType=intf.getName();
+						
+						if (intf.getNamespace() != null) {
+							prefix = XMLUtils.getPrefix(intf.getNamespace(), nsMap);
+							
+							portType = prefix+":"+portType;
+						}
+						
+						plRole.setAttribute(PORT_TYPE_LABEL, portType);
 					}
 				}
 			}
 			
 			if (pl.getMyRole() != null && pl.getMyRole().trim().length() > 0) {
-				org.w3c.dom.Element plRole=doc.createElement("plnk:role");
+				org.w3c.dom.Element plRole=doc.createElement(PLNK_ROLE);
 				
 				plt.appendChild(plRole);
 				
-				plRole.setAttribute("name", pl.getMyRole());
+				plRole.setAttribute(NAME_LABEL, pl.getMyRole());
 				
 				if (role.getAnnotations().containsKey(Contract.class.getName())) {
 					Contract contract=(Contract)role.getAnnotations().get(Contract.class.getName());
@@ -327,7 +384,16 @@
 					if (contract.getInterfaces().size() > 0) {
 						Interface intf=contract.getInterfaces().get(0);
 						
-						plRole.setAttribute("portType", intf.getName());
+						String prefix=null;
+						String portType=intf.getName();
+						
+						if (intf.getNamespace() != null) {
+							prefix = XMLUtils.getPrefix(intf.getNamespace(), nsMap);
+							
+							portType = prefix+":"+portType;
+						}
+						
+						plRole.setAttribute(PORT_TYPE_LABEL, portType);
 					}
 				}
 			}
@@ -335,6 +401,16 @@
 			defn.appendChild(plt);
 		}
 		
+		// Create remaining namespace/prefix mappings
+		java.util.Iterator<String> iter=nsMap.keySet().iterator();
+		while (iter.hasNext()) {
+			String ns=iter.next();
+			String prefix=nsMap.get(ns);
+			
+			defn.setAttribute(XMLNS_PREFIX+prefix, ns);
+		}
+		
+		// Write partner link types to file
 		IPath wsdlPath=proj.getFullPath().append(
 				new Path(getBuildSystem().getBPELFilePath())).
 					append(role.getName()+"PartnerLinkTypes.wsdl");
@@ -358,92 +434,116 @@
 		
 		xmlstr.close();
 		
-		String xml=reformat(new String(xmlstr.toByteArray()));
+		String xml=XMLUtils.format(new String(xmlstr.toByteArray()));
 		
 		wsdlFile.setContents(new java.io.ByteArrayInputStream(xml.getBytes()), true, false,
 					new org.eclipse.core.runtime.NullProgressMonitor());
 	}
 	
-	/**
-	 * This method reformats the XML text for presentation.
-	 * 
-	 * @param xmltext The original XML text
-	 * @return The reformatted text
-	 */
-	private static String reformat(String xmltext) {
-		String ret=xmltext;
-		int pos=0;
-		int prevpos=0;
-		StringBuffer buf=new StringBuffer();
-		int level=0;
+	
+	protected void generateBPELDeploy(Role role, IProject proj, ConversationModel localcm,
+			org.jboss.savara.tools.bpel.model.component.Process bpelProcess) throws Exception {	
 		
-		while ((pos=ret.indexOf('<', prevpos)) != -1) {
+		org.w3c.dom.Document doc=javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();;
+		
+		org.w3c.dom.Element defn=doc.createElementNS(APACHE_ODE_NAMESPACE,
+													DEPLOY_LABEL);
+		doc.appendChild(defn);
+		
+		java.util.Map<String, String> nsMap=new java.util.HashMap<String, String>();
+		
+		// Create process element
+		org.w3c.dom.Element proc=doc.createElement(PROCESS_LABEL);
+		defn.appendChild(proc);
+		
+		String name=bpelProcess.getName();
+		
+		if (bpelProcess.getTargetNamespace() != null) {
+			String prefix=XMLUtils.getPrefix(bpelProcess.getTargetNamespace(), nsMap);
 			
-			if (prevpos < pos &&
-					ret.substring(prevpos, pos).trim().length() > 0 &&
-					ret.charAt(prevpos-1) != '?') {
+			name = prefix+":"+name;
+		}
+		
+		proc.setAttribute(NAME_LABEL, name);
+		
+		org.w3c.dom.Element active=doc.createElement(ACTIVE_LABEL);
+		proc.appendChild(active);
+		
+		org.w3c.dom.Text activeText=doc.createTextNode(Boolean.TRUE.toString());
+		active.appendChild(activeText);
+		
+		// TODO: Need more info - possibly Contract should have interfaces based on
+		// the relationship between two roles, as this may provide the necessary
+		// information - but this requires the ability to have multiple interfaces
+		// per role, which some other parts of the BPEL generation would currently
+		// not handle.
+		
+		// Work through partner links for now
+		for (PartnerLink pl : bpelProcess.getPartnerLinks()) {
+			if (pl.getPartnerRole() != null && pl.getPartnerRole().trim().length() > 0) {
+				org.w3c.dom.Element invoke=doc.createElement(INVOKE_LABEL);
 				
-				if (ret.charAt(prevpos) == '\r' &&
-						ret.charAt(prevpos+1) == '\n') {
-					prevpos += 2;
-				}
-				for (int i=0; i < level; i++) {
-					buf.append("    ");
-				}
+				invoke.setAttribute(PARTNER_LINK_LABEL, XMLUtils.getLocalname(pl.getName()));
 				
-				buf.append(ret.substring(prevpos, pos).trim());
-				buf.append("\r\n");
+				org.w3c.dom.Element service=doc.createElement(SERVICE_LABEL);
+				
+				invoke.appendChild(service);
+				
+				proc.appendChild(invoke);
 			}
 			
-			int endpos=ret.indexOf('>', pos);
-		
-			if (endpos > 0) {
-				boolean noreturn=false;
+			if (pl.getMyRole() != null && pl.getMyRole().trim().length() > 0) {
+				org.w3c.dom.Element provide=doc.createElement(PROVIDE_LABEL);
 				
-				if (pos > 0 && ret.charAt(pos+1) == '/') {
-					level--;
-				}
+				provide.setAttribute(PARTNER_LINK_LABEL, XMLUtils.getLocalname(pl.getName()));
 				
-				for (int i=0; i < level; i++) {
-					buf.append("    ");
-				}
-				buf.append(ret.substring(pos, endpos+1));
+				org.w3c.dom.Element service=doc.createElement(SERVICE_LABEL);
 				
-				if (ret.charAt(endpos-1)== '?') {
-					//noreturn = true;
-					
-				} else if (ret.charAt(endpos-1) == '/') {
-					// Ignore
-				} else if (pos > 0 && ret.charAt(pos+1) == '/') {
-					// Ignore
-					
-				} else if (pos > 0 && ret.charAt(pos+1) == '!') {
-					// Ignore
-					
-				} else {
-					level++;
-				}
-							
-				if (noreturn == false) {
-					buf.append("\r\n");
-				}
+				provide.appendChild(service);
 				
-				pos = endpos+1;
+				proc.appendChild(provide);
 			}
-			
-			prevpos = pos;
 		}
 		
-		if (prevpos != -1 &&
-				ret.substring(prevpos).trim().length() > 0) {
-			buf.append(ret.substring(prevpos));
+		// Create remaining namespace/prefix mappings
+		java.util.Iterator<String> iter=nsMap.keySet().iterator();
+		while (iter.hasNext()) {
+			String ns=iter.next();
+			String prefix=nsMap.get(ns);
+			
+			defn.setAttribute(XMLNS_PREFIX+prefix, ns);
 		}
 		
-		ret = buf.toString();
+		// Write partner link types to file
+		IPath wsdlPath=proj.getFullPath().append(
+				new Path(getBuildSystem().getBPELFilePath())).
+					append(BPEL_DEPLOY_DESCRIPTOR_FILENAME);
 		
-		return(ret);
+		IFile wsdlFile=proj.getProject().getWorkspace().getRoot().getFile(wsdlPath);
+		GeneratorUtil.createParentFolder(wsdlFile);
+		wsdlFile.create(null, true,
+				new org.eclipse.core.runtime.NullProgressMonitor());
+		
+		java.io.ByteArrayOutputStream xmlstr=
+			new java.io.ByteArrayOutputStream();
+		
+		DOMSource source=new DOMSource();
+		source.setNode(doc);
+		
+		StreamResult result=new StreamResult(xmlstr);
+		
+		Transformer trans=
+				TransformerFactory.newInstance().newTransformer();
+		trans.transform(source, result);
+		
+		xmlstr.close();
+		
+		String xml=XMLUtils.format(new String(xmlstr.toByteArray()));
+		
+		wsdlFile.setContents(new java.io.ByteArrayInputStream(xml.getBytes()), true, false,
+					new org.eclipse.core.runtime.NullProgressMonitor());
 	}
-		
+	
 	/**
 	 * This method returns the WSDL file name for the supplied role and local
 	 * conversation model.

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -102,28 +102,48 @@
 			role = interaction.getEnclosingDefinition().
 						getLocatedName().getRole();
 		}
-
+		
 		// Identify port type role
-		Role portTypeRole=role;
+		Role toPortTypeRole=role;
+		Role fromPortTypeRole=role;
+		String prefix=null;
 		
-		if (InteractionUtil.isRequest(interaction) && interaction.getToRole() != null) {
-			portTypeRole = interaction.getToRole();
+		String mainPrefix=null;
+		
+		if (context.getRole().getAnnotations().containsKey(Contract.class.getName())) {
+			Contract contract=(Contract)context.getRole().getAnnotations().get(Contract.class.getName());
+
+			mainPrefix = bpelModel.getBPELProcess().addNamespace(contract.getNamespace());
 		}
 		
-		if (portTypeRole != null &&
-				portTypeRole.getAnnotations().containsKey(Contract.class.getName())) {
-			Contract contract=(Contract)portTypeRole.getAnnotations().get(Contract.class.getName());
+		if (InteractionUtil.isRequest(interaction)) {
+			toPortTypeRole = interaction.getToRole();
+		} else {
+			fromPortTypeRole = interaction.getFromRole();
+		}
+		
+		if (toPortTypeRole != null &&
+				toPortTypeRole.getAnnotations().containsKey(Contract.class.getName())) {
+			Contract contract=(Contract)toPortTypeRole.getAnnotations().get(Contract.class.getName());
 
 			// Assume that contract only has one interface for now
 			if (contract.getInterfaces().size() > 0) {
 				intf = contract.getInterfaces().get(0);
 			}
+		} else if (fromPortTypeRole != null &&
+				fromPortTypeRole.getAnnotations().containsKey(Contract.class.getName())) {
+			Contract contract=(Contract)fromPortTypeRole.getAnnotations().get(Contract.class.getName());
+
+			// Assume that contract only has one interface for now
+			if (contract.getInterfaces().size() > 0) {
+				intf = contract.getInterfaces().get(0);
+			}
 		}
 		
 		if (intf != null) {
 			portType = intf.getName();
 			
-			String prefix=bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+			prefix = bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
 			
 			if (prefix != null) {
 				portType = prefix+":"+portType;
@@ -161,7 +181,14 @@
 				
 				pl.setPartnerRole(interaction.getToRole().getName()+"Requester");
 				pl.setName(role.getName()+"To"+interaction.getToRole().getName());
-				pl.setPartnerLinkType(role.getName()+"To"+interaction.getToRole().getName()+"LT");
+				
+				String plt=role.getName()+"To"+interaction.getToRole().getName()+"LT";
+				
+				if (prefix != null) {
+					plt = mainPrefix+":"+plt;
+				}
+				
+				pl.setPartnerLinkType(plt);
 
 				//portType = interaction.getToRole().getName()+"PT";
 				
@@ -174,7 +201,14 @@
 		
 				pl.setMyRole(role.getName()+"Service");
 				pl.setName(interaction.getToRole().getName()+"To"+role.getName());
-				pl.setPartnerLinkType(interaction.getToRole().getName()+"To"+role.getName()+"Service"+"LT");
+				
+				String plt=interaction.getToRole().getName()+"To"+role.getName()+"Service"+"LT";
+				
+				if (prefix != null) {
+					plt = mainPrefix+":"+plt;
+				}
+				
+				pl.setPartnerLinkType(plt);
 
 				//portType = role.getName()+"PT";
 				
@@ -182,13 +216,13 @@
 					String faultName=InteractionPatterns.getFaultName(interaction);
 					
 					// Find namespace prefix
-					if (intf != null) {
-						String prefix=bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
+					//if (intf != null) {
+					//	String prefix=bpelModel.getBPELProcess().addNamespace(intf.getNamespace());
 						
 						if (prefix != null) {
 							faultName = prefix+":"+faultName;
 						}
-					}
+					//}
 					
 					((Reply)act).setFaultName(faultName);
 				}
@@ -222,14 +256,28 @@
 					pl.setMyRole(role.getName()+"Service");
 					//pl.setPartnerRole(interaction.getToRole().getName());
 					pl.setName(interaction.getFromRole().getName()+"To"+role.getName());
-					pl.setPartnerLinkType(interaction.getFromRole().getName()+"To"+role.getName()+"Service"+"LT");
+					
+					String plt=interaction.getFromRole().getName()+"To"+role.getName()+"Service"+"LT";
+					
+					if (prefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
 	
 					//portType = role.getName()+"PT";
 				} else {
 					pl.setMyRole(role.getName()+"Requester");
 					pl.setPartnerRole(interaction.getFromRole().getName()+"Service");
 					pl.setName(role.getName()+"To"+interaction.getFromRole().getName());
-					pl.setPartnerLinkType(role.getName()+"To"+interaction.getFromRole().getName()+"Requester"+"LT");
+					
+					String plt=role.getName()+"To"+interaction.getFromRole().getName()+"Requester"+"LT";
+					
+					if (prefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
 	
 					//portType = role.getName()+
 					//		interaction.getFromRole().getName()+"CallbackPT";				
@@ -300,10 +348,10 @@
 
 				// Find namespace prefix
 				if (namespace != null) {
-					String prefix=bpelModel.getBPELProcess().addNamespace(namespace);
+					String pfix=bpelModel.getBPELProcess().addNamespace(namespace);
 					
-					if (prefix != null) {
-						mesgType = prefix+":"+mesgType;
+					if (pfix != null) {
+						mesgType = pfix+":"+mesgType;
 					}
 				}
 				

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/IfModelChangeRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/IfModelChangeRule.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/IfModelChangeRule.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -22,6 +22,7 @@
 import org.jboss.savara.tools.bpel.model.util.InteractionUtil;
 import org.scribble.model.*;
 import org.scribble.model.change.*;
+import org.scribble.contract.model.Contract;
 import org.scribble.extensions.RegistryInfo;
 
 /**
@@ -220,6 +221,14 @@
 				
 				String prevPLName=role.getName()+"To"+recv.getFromRole().getName();
 				
+				String mainPrefix=null;
+				
+				if (context.getRole().getAnnotations().containsKey(Contract.class.getName())) {
+					Contract contract=(Contract)context.getRole().getAnnotations().get(Contract.class.getName());
+
+					mainPrefix = bpelModel.getBPELProcess().addNamespace(contract.getNamespace());
+				}
+				
 				// Check if partner link already exists in
 				// other direction
 				PartnerLink prev=
@@ -230,14 +239,28 @@
 					pl.setMyRole(role.getName()+"Service");
 					//pl.setPartnerRole(interaction.getToRole().getName());
 					pl.setName(recv.getFromRole().getName()+"To"+role.getName());
-					pl.setPartnerLinkType(recv.getFromRole().getName()+"To"+role.getName()+"Service"+"LT");
+					
+					String plt=recv.getFromRole().getName()+"To"+role.getName()+"Service"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
 
 					portType = role.getName()+"PT";
 				} else {
 					pl.setMyRole(role.getName()+"Requester");
 					pl.setPartnerRole(recv.getFromRole().getName()+"Service");
 					pl.setName(role.getName()+"To"+recv.getFromRole().getName());
-					pl.setPartnerLinkType(role.getName()+"To"+recv.getFromRole().getName()+"Requester"+"LT");
+					
+					String plt=role.getName()+"To"+recv.getFromRole().getName()+"Requester"+"LT";
+					
+					if (mainPrefix != null) {
+						plt = mainPrefix+":"+plt;
+					}
+					
+					pl.setPartnerLinkType(plt);
 
 					portType = role.getName()+
 							recv.getFromRole().getName()+"CallbackPT";				

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/ConversionContext.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -44,6 +44,13 @@
 	public void addVariable(Variable var);
 
 	/**
+	 * This method removes a variable from the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void removeVariable(Variable var);
+
+	/**
 	 * This method returns the namespace for the supplied prefix.
 	 * 
 	 * @param prefix The prefix

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/DefaultConversionContext.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -65,6 +65,15 @@
 	}
 	
 	/**
+	 * This method removes a variable from the context.
+	 * 
+	 * @param var The variable
+	 */
+	public void removeVariable(Variable var) {
+		m_variables.remove(var.getName());
+	}
+	
+	/**
 	 * This method returns the namespace for the supplied prefix.
 	 * 
 	 * @param prefix The prefix

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/FaultHandlers.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -126,8 +126,6 @@
 
 	@Override
 	public void convert(List<Activity> activities, ConversionContext context) {
-		// TODO Auto-generated method stub
-		
 	}
 
 	private static Log logger=LogFactory.getLog(FaultHandlers.class);

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Invoke.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -166,6 +166,16 @@
 					mesgType = catchBlock.getFaultMessageElement();
 				}
 				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
 				convertFaultResponse(fcb.getContents(), catchBlock.getFaultVariable(),
 									mesgType, context);
 				
@@ -179,6 +189,10 @@
 				fcb.getContents().add(raise);
 				
 				te.getConditionalBlocks().add(fcb);
+				
+				if (faultVar != null) {
+					context.removeVariable(faultVar);
+				}
 			}
 		}
 		

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Process.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -704,6 +704,16 @@
 					mesgType = catchBlock.getFaultMessageElement();
 				}
 				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
 				invoke.convertFaultResponse(fcb.getContents(), catchBlock.getFaultVariable(),
 									mesgType, context);
 				
@@ -712,6 +722,10 @@
 				}
 				
 				choice.getConditionalBlocks().add(fcb);
+				
+				if (faultVar != null) {
+					context.removeVariable(faultVar);
+				}
 			}
 			
 			activities.add(choice);
@@ -739,11 +753,25 @@
 					tref.setLocalpart(getFaultHandlers().getCatchPaths().get(i).getFaultName());
 					cb.setType(tref);
 					
+					Variable faultVar=null;
+					
+					if (getFaultHandlers().getCatchPaths().get(i).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());			
+						context.addVariable(faultVar);
+					}
+					
 					if (getFaultHandlers().getCatchPaths().get(i).getActivity() != null) {
 						getFaultHandlers().getCatchPaths().get(i).getActivity().
 										convert(cb.getContents(), context);
 					}
 					
+					if (faultVar != null) {
+						context.removeVariable(faultVar);
+					}
+
 					te.getEscapeBlocks().add(cb);
 				}
 			}

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/component/Scope.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -580,6 +580,16 @@
 					mesgType = catchBlock.getFaultMessageElement();
 				}
 				
+				Variable faultVar=null;
+				
+				if (catchBlock.getFaultVariable() != null) {
+					faultVar = new Variable(getModel());
+					faultVar.setName(catchBlock.getFaultVariable());
+					faultVar.setMessageType(catchBlock.getFaultMessageType());
+					faultVar.setElement(catchBlock.getFaultMessageElement());			
+					context.addVariable(faultVar);
+				}
+				
 				invoke.convertFaultResponse(fcb.getContents(), catchBlock.getFaultVariable(),
 									mesgType, context);
 				
@@ -588,6 +598,10 @@
 				}
 				
 				choice.getConditionalBlocks().add(fcb);
+				
+				if (faultVar != null) {
+					context.removeVariable(faultVar);
+				}
 			}
 			
 			activities.add(choice);

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/util/XMLUtils.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -28,10 +28,12 @@
 import org.w3c.dom.Node;
 
 /**
- *
+ * This class defines a set of XML related utility functions.
  */
 public final class XMLUtils {
 	
+	private static final String NS_LABEL = "ns";
+
 	/**
 	 * This class converts a DOM representation node to text.
 	 * @param node
@@ -168,11 +170,41 @@
 		return(ret);
 	}
 	
-	public static void main(String[] args) throws Exception {
-		String raw = "<books><book>The World is Flat</book></books>";
-		String pretty = format(raw);
-		System.out.println(pretty);
+	/**
+	 * This method returns the localname part of the supplied
+	 * qualified name.
+	 * 
+	 * @param qname The qualified name
+	 * @return The localname part
+	 */
+	public static String getLocalname(String qname) {
+		String ret=qname;
+		int pos=0;
+		
+		if (qname != null && ((pos=qname.indexOf(':')) != -1)) {
+			ret = qname.substring(pos+1);
+		}
+		
+		return(ret);
 	}
 	
+	/**
+	 * This method returns the prefix associated with the supplied namespace.
+	 * 
+	 * @param namespace The namespace
+	 * @param nsMap The existing namespace prefix mappings
+	 * @return The prefix
+	 */
+	public static String getPrefix(String namespace, java.util.Map<String,String> nsMap) {
+		String prefix=null;
+		
+		prefix = nsMap.get(namespace);
+		
+		if (prefix == null) {
+			prefix = NS_LABEL+(nsMap.size()+1);
+			nsMap.put(namespace, prefix);
+		}
+
+		return(prefix);
+	}
 }
-	

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/GeneratorTest.java	2009-11-05 23:22:06 UTC (rev 73)
@@ -23,9 +23,7 @@
 
 import org.jboss.savara.tools.bpel.model.BPELNotation;
 import org.jboss.savara.tools.bpel.model.DefaultBPELLanguageModel;
-import org.jboss.savara.tools.bpel.parser.ParserTest;
 import org.jboss.savara.tools.bpel.util.XMLUtils;
-import org.scribble.conversation.model.ConversationNotation;
 import org.scribble.pi4soa.cdm.model.CDMNotation;
 import org.scribble.extensions.RegistryFactory;
 import org.scribble.model.Definition;
@@ -38,7 +36,6 @@
     public static TestSuite suite() {
         TestSuite suite = new TestSuite("Conversation->BPEL Generator Tests");
         
-        suite.addTest(new ConversationToBPELTest("EventHandler at Store"));
         suite.addTest(new ChoreographyToBPELTest("ESBBroker", "Broker"));
         suite.addTest(new ChoreographyToBPELTest("ESBBroker", "Buyer"));
         suite.addTest(new ChoreographyToBPELTest("ESBBroker", "CreditAgency"));
@@ -58,200 +55,6 @@
     }
     
     /**
-     * The test case for running the conversation to BPEL test.
-     */
-	protected static class ConversationToBPELTest extends TestCase {
-
-		/**
-		 * This constructor is initialized with the test
-		 * name.
-		 * 
-		 * @param name The test name
-		 */
-		public ConversationToBPELTest(String name) {
-			super(name);
-			m_name = name;
-		}
-		
-		/**
-		 * This method runs the test.
-		 * 
-		 * @param result The test result
-		 */
-		public void run(TestResult result) {
-			result.startTest(this);
-			
-			String filename="testmodels/"+m_name+".scv";
-			
-			java.io.InputStream is=
-				GeneratorTest.class.getResourceAsStream(filename);
-			
-			if (is == null) {
-				result.addError(this,
-						new Throwable("Unable to locate resource: "+filename));
-			} else {			
-				org.scribble.parser.Parser p=new org.scribble.parser.DefaultParser();
-				org.scribble.model.ModelReference ref=
-						new org.scribble.model.ModelReference(ConversationNotation.NOTATION_CODE);
-				org.scribble.model.admin.ModelListener l=
-						new org.scribble.model.admin.DefaultModelListener();
-				
-				org.scribble.model.Model model=p.parse(ref, is, l);
-				
-				if (model == null) {
-					result.addError(this, new Throwable("Model is null"));
-				} else {
-					ModelGenerator generator=(ModelGenerator)
-							RegistryFactory.getRegistry().getExtension(
-									ModelGenerator.class, null);
-				
-					java.util.List<Definition> defns=model.getDefinitions();
-					Definition defn=null;
-					
-					if (defns.size() == 1) {
-						defn = defns.get(0);
-					}
-					
-					if (generator != null && defn != null) {
-						ModelReference targetRef=
-							new ModelReference(BPELNotation.NOTATION_CODE);
-						
-						targetRef.setAlias(defn.getLocatedName().getName());
-						targetRef.setLocatedRole(defn.getLocatedName().getRole().getName());
-						
-						DefaultBPELLanguageModel target=
-							new DefaultBPELLanguageModel(targetRef);
-
-						generator.generate(targetRef,
-								defn.getLocatedName().getRole(),
-									target, model);
-						
-						if (target.getBPELProcess().getDOMElement() != null) {
-							try {
-								String text=XMLUtils.toText(target.getBPELProcess().getDOMElement());
-								checkResults(result, text);
-							} catch(Exception e) {
-								result.addError(this, e);
-							}
-						} else {
-							result.addError(this,
-									new Throwable("No BPEL generated"));						
-						}
-						
-					} else {
-						result.addError(this,
-								new Throwable("Unable to find Model Generator"));						
-					}
-				}
-			}
-			
-			result.endTest(this);
-		}
-		
-		/**
-		 * This method checks the generated BPEL against a
-		 * previously stored correct version.
-		 * 
-		 * @param result The test result
-		 * @param bpel The BPEL
-		 */
-		protected void checkResults(TestResult result, String bpel) {
-			boolean f_valid=false;
-
-			String filename="results/"+m_name+".bpel";
-			
-			java.io.InputStream is=
-				GeneratorTest.class.getResourceAsStream(filename);
-			
-			if (is != null) {
-				
-				try {
-					byte[] b=new byte[is.available()];
-				
-					is.read(b);
-					
-					is.close();
-					
-					String orig=new String(b);
-					
-					if (orig.equals(bpel) == false) {
-						result.addError(this,
-							new Throwable("Generated BPEL does not match stored version"));
-					} else {
-						f_valid = true;
-					}
-				} catch(Exception e) {
-					result.addError(this, e);
-				}
-			} else {
-				result.addError(this,
-						new Throwable("Resulting BPEL '"+filename+
-								"' not found for comparison"));
-			}
-			
-			if (f_valid == false) {
-				String bpelfile="testmodels/"+m_name+".scv";
-				
-				java.net.URL url=GeneratorTest.class.getResource(bpelfile);
-				
-				try {
-					url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
-				} catch(Exception e) {
-					e.printStackTrace();
-				}
-				
-				if (url != null) {
-					// URL will point to copy of test models in the classes folder, so need
-					// to obtain reference back to source version
-					java.io.File f=null;
-					
-					if (url.getFile().indexOf("classes") != -1) {
-						f = new java.io.File(url.getFile().replaceFirst("classes","src/plugintest"));
-					} else if (url.getFile().indexOf("bin") != -1) {						
-						f = new java.io.File(url.getFile().replaceFirst("bin","src/plugintest"));
-					} else {
-						result.addError(this, new Exception("Could not locate results folder to record expected result"));
-					}
-					
-					if (f != null && f.exists()) {
-						f = f.getParentFile().getParentFile();
-						
-						java.io.File resultsDir=new java.io.File(f, "results");
-						
-						if (resultsDir.exists() == false) {
-							resultsDir.mkdirs();
-						}
-						
-						java.io.File resultFile=new java.io.File(resultsDir,
-											m_name+".expected");
-						
-						if (resultFile.exists() == false) {
-							try {
-								java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
-								
-								fos.write(bpel.getBytes());
-								
-								fos.flush();
-								fos.close();
-								
-							} catch(Exception e){
-								result.addError(this, e);
-							}
-						} else {
-							System.err.println("NOTE: Expected output '"+resultFile+
-										"' already exists - not being overwritten");
-						}
-					} else {
-						result.addError(this, new Throwable("Unable to obtain URL for SCV model source '"+
-								m_name+"': "+url));
-					}
-				}
-			}
-		}
-
-		private String m_name=null;
-	}
-    /**
      * The test case for running the choreography to BPEL test.
      */
 	protected static class ChoreographyToBPELTest extends TestCase {

Deleted: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/results/EventHandler at Store.bpel
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/results/EventHandler at Store.bpel	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/results/EventHandler at Store.bpel	2009-11-05 23:22:06 UTC (rev 73)
@@ -1,22 +0,0 @@
-<process xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="EventHandler at Store" name="EventHandler_Store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
-    <partnerLinks>
-        <partnerLink myRole="StoreService" name="BuyerToStore" partnerLinkType="BuyerToStoreServiceLT"/>
-        <partnerLink myRole="StoreRequester" name="StoreToCreditAgency" partnerLinkType="StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
-    </partnerLinks>
-    <sequence>
-        <receive operation="buy" partnerLink="BuyerToStore" portType="StorePT"/>
-        <invoke operation="creditCheck" partnerLink="StoreToCreditAgency" portType="CreditAgencyPT"/>
-        <pick>
-            <onMessage operation="checkCreditOk" partnerLink="StoreToCreditAgency" portType="StoreCreditAgencyCallbackPT">
-                <sequence>
-                    <reply operation="buy" partnerLink="BuyerToStore" portType="StorePT"/>
-                </sequence>
-            </onMessage>
-            <onMessage operation="checkCreditInvalid" partnerLink="StoreToCreditAgency" portType="StoreCreditAgencyCallbackPT">
-                <sequence>
-                    <reply operation="buy" partnerLink="BuyerToStore" portType="StorePT"/>
-                </sequence>
-            </onMessage>
-        </pick>
-    </sequence>
-</process>

Deleted: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/testmodels/EventHandler at Store.scv
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/testmodels/EventHandler at Store.scv	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/generator/testmodels/EventHandler at Store.scv	2009-11-05 23:22:06 UTC (rev 73)
@@ -1,19 +0,0 @@
-namespace org.examples;
-
-conversation EventHandler at Store {
-	role	Buyer, CreditAgency;
-
-	buy(BuyInfo) from Buyer to Store request "buy";
-	
-	creditCheck(CreditInformation) from Store to CreditAgency;
-	
-	// No request/replyTo, so will be treated as invocations on a callback interface
-	
-	if @ CreditAgency {
-		checkCreditOk(CreditCheckOk) from CreditAgency to Store;
-		buy(Confirmed) from Store to Buyer replyTo "buy";
-	} else if {
-		checkCreditInvalid(CreditCheckInvalid) from CreditAgency to Store;
-		buy(Rejected) from Store to Buyer replyTo "buy";
-	}
-}
\ No newline at end of file

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv	2009-11-05 23:13:40 UTC (rev 72)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/plugintest/org/jboss/savara/tools/bpel/parser/results/LoanApprovalService at Service.scv	2009-11-05 23:22:06 UTC (rev 73)
@@ -4,16 +4,16 @@
 	try {
 		boolean	receive-to-assess, receive-to-approval, approval-to-reply, assess-to-setMessage, setMessage-to-reply, assess-to-approval;
 		parallel {
-			request(lns:creditInformationMessage) from customer;
+			request(creditInformationMessage) from customer;
 			receive-to-assess = xpath[true()];
 			receive-to-approval = xpath[true()];
 		} and {
 			when (xpath[$receive-to-assess])  {
-				check(lns:creditInformationMessage) to assessor;
+				check(creditInformationMessage) to assessor;
 				if {
-					check(lns:riskAssessmentMessage) from assessor;
+					check(riskAssessmentMessage) from assessor;
 				} else if {
-					check(lns:errorMessage) from assessor;
+					check(errorMessage) from assessor;
 					raise lns:loanProcessFault;
 				}
 				assess-to-setMessage = xpath[true()];
@@ -21,21 +21,21 @@
 			}
 		} and {
 			when (xpath[$receive-to-approval and $assess-to-approval])  {
-				approve(lns:creditInformationMessage) to approver;
+				approve(creditInformationMessage) to approver;
 				if {
-					approve(lns:approvalMessage) from approver;
+					approve(approvalMessage) from approver;
 				} else if {
-					approve(lns:errorMessage) from approver;
+					approve(errorMessage) from approver;
 					raise lns:loanProcessFault;
 				}
 				approval-to-reply = xpath[true()];
 			}
 		} and {
 			when (xpath[$setMessage-to-reply and $approval-to-reply])  {
-				request(lns:approvalMessage) to customer;
+				request(approvalMessage) to customer;
 			}
 		}
 	} catch lns:loanProcessFault {
-		request() to customer;
+		request(errorMessage) to customer;
 	}
 }
\ No newline at end of file



More information about the savara-commits mailing list