[savara-commits] savara SVN: r655 - in branches/experimental/2.0.x: bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator and 11 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Feb 11 07:26:07 EST 2011


Author: objectiser
Date: 2011-02-11 07:26:06 -0500 (Fri, 11 Feb 2011)
New Revision: 655

Added:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/ProtocolToBPELGeneratorTest.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Buyer_CreditAgency.contract
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at CreditAgency_CreditAgency.contract
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Store_CreditAgency.contract
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_Store.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/creditAgency.xsd
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/store.xsd
   branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_CreditAgency.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_StoreArtifacts.wsdl
   branches/experimental/2.0.x/samples/purchasing/completed/store/creditAgency.xsd
   branches/experimental/2.0.x/samples/purchasing/completed/store/store.xsd
Removed:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java
Modified:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at Broker.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at CreditAgency.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at SupplierTxnProcessor.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods at CreditAgency.bpel
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/pom.xml
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/contract/generator/impl/ContractIntrospector.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/ProtocolToContractGeneratorTest.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at CreditCheckService.contract
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at PolicyQuoteProcessService.contract
   branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/ProtocolToWSDLGeneratorTest.java
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
   branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml
   branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
   branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml
Log:
Required some changes to the BPEL gen, to remove unnecessary WSDL, and then was able to deploy the purchasing example into RiftSaw.

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/parser/BPELProtocolParser.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -27,6 +27,7 @@
 import org.scribble.common.logging.Journal;
 import org.scribble.protocol.ProtocolContext;
 import org.scribble.protocol.model.*;
+import org.scribble.protocol.parser.AnnotationProcessor;
 import org.scribble.protocol.parser.ProtocolParser;
 
 /**
@@ -78,5 +79,9 @@
 		
 		return(ret);
 	}
+
+	public void setAnnotationProcessor(AnnotationProcessor ap) {
+		// Not required
+	}
 	
 }

Deleted: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,340 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- */
-package org.savara.bpel.generator;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.savara.bpel.generator.ProtocolToBPELModelGenerator;
-import org.savara.bpel.model.TProcess;
-import org.savara.bpel.util.BPELModelUtil;
-import org.savara.common.model.annotation.Annotation;
-import org.savara.common.model.annotation.AnnotationDefinitions;
-import org.savara.common.model.generator.ModelGenerator;
-import org.scribble.common.logging.CachedJournal;
-import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
-
-public class GeneratorTest {
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Protocol->BPEL Generator Tests");
-
-        suite.addTest(new ProtocolToBPELTester("ESBBroker", "Broker"));
-        
-        suite.addTest(new ProtocolToBPELTester("ESBBroker", "Buyer"));     
-        suite.addTest(new ProtocolToBPELTester("ESBBroker", "SupplierTxnProcessor"));
-        suite.addTest(new ProtocolToBPELTester("ESBBroker", "CreditAgency"));
-        suite.addTest(new ProtocolToBPELTester("ESBBroker", "SupplierQuoteEngine"));
-        
-        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "Buyer"));
-        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "CreditAgency"));
-        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "Store"));
-        
-        suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Buyer"));
-        suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Seller"));
-        
-        suite.addTest(new ProtocolToBPELTester("PolicyQuote", "PolicyQuoteProcessService"));
-        
-        return suite;
-    }
-    
-    protected static class ProtocolToBPELTester extends TestCase {
-
-    	/**
-    	 * This constructor is initialized with the test
-    	 * name.
-    	 * 
-    	 * @param name The test name
-    	 * @param role The role
-    	 */
-    	public ProtocolToBPELTester(String name,
-    						String role) {
-    		super(name+"@"+role);
-    		m_name = name;
-    		m_role = role;
-    	}
-    	
-    	/**
-    	 * This method runs the test.
-    	 * 
-    	 * @param result The test result
-    	 */
-    	public void run(TestResult result) {
-    		// Setup scribble services
-    		//ProtocolServices.setProtocolProjector(
-    		//		new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
-    		
-    		// Run test
-    		result.startTest(this);
-    		
-    		String filename="testmodels/protocol/"+m_name+".spr";
-    		
-    		java.io.InputStream is=
-    			ClassLoader.getSystemResourceAsStream(filename);
-    		
-    		if (is == null) {
-    			result.addError(this,
-    					new Throwable("Unable to locate resource: "+filename));
-    		} else {			
-    			CachedJournal journal=new CachedJournal();
-    			
-    			org.scribble.protocol.model.ProtocolModel model=null;
-    			
-				ANTLRProtocolParser parser=new ANTLRProtocolParser();
-				parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
-				
-    			try {
-    				model = parser.parse(is, journal, null);
-    			} catch(Exception e) {
-    				result.addError(this, new Throwable("Parsing choreography failed"));
-    			}
-    			
-    			if (model == null) {
-    				result.addError(this, new Throwable("Model is null"));
-    			} else {
-    				//org.scribble.protocol.projection.ProtocolProjector projector=
-    				//	new org.scribble.projector.DefaultProjector();
-    				
-    				org.scribble.protocol.model.Role role=null;
-    				
-    				// Obtain role from definition
-     				//Protocol defn=model.getProtocol();
-    				    				
-    				// Check if subpath definition defined
-    				/*
-    				if (m_subDefinitionPath != null) {
-    					defn = defn.getSubDefinition(m_subDefinitionPath);
-    				}
-    				*/
-    				
-    				java.util.List<org.scribble.protocol.model.Role> roles=model.getRoles();
-    					//new org.scribble.model.Role(m_role);
-    				
-    				for (int i=0; role == null && i < roles.size(); i++) {
-    					if (roles.get(i).getName().equals(m_role)) {
-    						role = roles.get(i);
-    					}
-    				}
-    				
-    				if (role == null) {
-    					result.addError(this,
-    							new Throwable("Role '"+m_role+"' not found"));						
-    				} else {
-    					org.scribble.protocol.projection.ProtocolProjector projector=
-    						new org.scribble.protocol.projection.impl.ProtocolProjectorImpl();
-    					
-    					/* GPB: CONTRACT
-   						ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
-						if (cg != null) {
-							cg.generate(model, journal, null);
-						}
-						*/
-						
-						org.scribble.protocol.model.ProtocolModel projected=
-    									projector.project(model, role, journal, null);
-    					
-    					/* Currently if a 'fail' is performed in Tycho build, it
-    					 * hangs the build.
-    					if (l.getErrors().size() > 0) {
-    						fail("Projection has errors: "+l.getErrors());
-    					} else if (projected == null) {
-    						fail("Projected model is null, for "+filename+" role "+role);
-    					}
-    					 */
-    					
-    					// TODO: SAVARA-167 - issue when projection is based on a sub-protocol
-    					if (AnnotationDefinitions.getAnnotation(projected.getProtocol().getAnnotations(),
-    									AnnotationDefinitions.TYPE) == null &&
-    							AnnotationDefinitions.getAnnotation(model.getProtocol().getAnnotations(),
-    	    									AnnotationDefinitions.TYPE) != null) {
-    						AnnotationDefinitions.copyAnnotations(model.getProtocol().getAnnotations(),
-    								projected.getProtocol().getAnnotations(), AnnotationDefinitions.TYPE);
-    					}
-    					
-    					//java.util.List<Role> projectedRoles=projected.getRoles();
-    					
-    					ModelGenerator generator=new ProtocolToBPELModelGenerator();
-    				
-						Object target=generator.generate(projected, journal, null);
-						
-						/*
-						ModelReference targetRef=
-							new ModelReference(BPELNotation.NOTATION_CODE);
-						targetRef.setAlias(m_name);
-						targetRef.setLocatedRole(m_role);
-						
-						DefaultBPELLanguageModel target=
-							new DefaultBPELLanguageModel(targetRef);
-
-						generator.generate(targetRef, role,
-									target, projected);
-						*/
-						
-						if (target instanceof TProcess) {
-							// Obtain any namespace prefix map
-							java.util.Map<String, String> prefixes=
-									new java.util.HashMap<String, String>();
-							
-							java.util.List<Annotation> list=
-								AnnotationDefinitions.getAnnotations(projected.getProtocol().getAnnotations(),
-										AnnotationDefinitions.TYPE);
-							
-							for (Annotation annotation : list) {
-								if (annotation.getProperties().containsKey(AnnotationDefinitions.NAMESPACE_PROPERTY) &&
-										annotation.getProperties().containsKey(AnnotationDefinitions.PREFIX_PROPERTY)) {
-									prefixes.put((String)annotation.getProperties().get(AnnotationDefinitions.NAMESPACE_PROPERTY),
-											(String)annotation.getProperties().get(AnnotationDefinitions.PREFIX_PROPERTY));
-								}
-							}
-							
-							try {
-								java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
-								
-								BPELModelUtil.serialize((TProcess)target, baos, prefixes);
-								
-								baos.close();
-								
-								String text=new String(baos.toByteArray());
-								
-								checkResults(result, text);
-							} catch(Exception e) {
-								result.addError(this, e);
-							}
-						} else {
-							result.addError(this,
-									new Throwable("No BPEL generated"));						
-						}
-     				}
-    			}
-    		}
-    		
-    		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/bpel/"+m_name+"@"+m_role+".bpel";
-    		
-    		java.io.InputStream is=
-    			//ChoreographyToBPELTester.class.getResourceAsStream(filename);
-    				ClassLoader.getSystemResourceAsStream(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 srcfile="testmodels/protocol/"+m_name+".spr";
-    			
-    			java.net.URL url=ClassLoader.getSystemResource(srcfile);
-    			
-    			/*
-    			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("target/test-classes") != -1) {
-    					f = new java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
-    				} else if (url.getFile().indexOf("classes") != -1) {
-        				f = new java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
-    				} else if (url.getFile().indexOf("bin") != -1) {						
-    					f = new java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
-    				} else {
-    					result.addError(this, new Exception("Could not locate results folder to record expected result"));
-    				}
-    				
-    				if (f != null && f.exists()) {
-    					f = f.getParentFile().getParentFile().getParentFile();
-    					
-    					java.io.File resultsDir=new java.io.File(f, "results/bpel");
-    					
-    					if (resultsDir.exists() == false) {
-    						resultsDir.mkdirs();
-    					}
-    					
-    					java.io.File resultFile=new java.io.File(resultsDir,
-    										m_name+"@"+m_role+".generated");
-    					
-    					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: Generated output '"+resultFile+
-    									"' already exists - not being overwritten");
-    					}
-    				} else {
-    					result.addError(this, new Throwable("Unable to obtain URL for CDM model source '"+
-    							m_name+"': "+url));
-    				}
-    			}
-    		}
-    	}
-
-    	private String m_name=null;
-    	private String m_role=null;
-    }
-}

Copied: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/ProtocolToBPELGeneratorTest.java (from rev 648, branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java)
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/ProtocolToBPELGeneratorTest.java	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/ProtocolToBPELGeneratorTest.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,339 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.savara.bpel.generator;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.savara.bpel.generator.ProtocolToBPELModelGenerator;
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.util.BPELModelUtil;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
+import org.savara.common.model.generator.ModelGenerator;
+import org.scribble.common.logging.CachedJournal;
+import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
+
+public class ProtocolToBPELGeneratorTest {
+
+    public static Test suite() {
+        TestSuite suite = new TestSuite("Protocol->BPEL Generator Tests");
+
+        suite.addTest(new ProtocolToBPELTester("ESBBroker", "Broker"));       
+        suite.addTest(new ProtocolToBPELTester("ESBBroker", "Buyer"));     
+        suite.addTest(new ProtocolToBPELTester("ESBBroker", "SupplierTxnProcessor"));
+        suite.addTest(new ProtocolToBPELTester("ESBBroker", "CreditAgency"));
+        suite.addTest(new ProtocolToBPELTester("ESBBroker", "SupplierQuoteEngine"));
+        
+        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "Buyer"));
+        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "CreditAgency"));
+        suite.addTest(new ProtocolToBPELTester("PurchaseGoods", "Store"));
+        
+        suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Buyer"));
+        suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Seller"));
+        
+        suite.addTest(new ProtocolToBPELTester("PolicyQuote", "PolicyQuoteProcessService"));
+        
+        return suite;
+    }
+    
+    protected static class ProtocolToBPELTester extends TestCase {
+
+    	/**
+    	 * This constructor is initialized with the test
+    	 * name.
+    	 * 
+    	 * @param name The test name
+    	 * @param role The role
+    	 */
+    	public ProtocolToBPELTester(String name,
+    						String role) {
+    		super(name+"@"+role);
+    		m_name = name;
+    		m_role = role;
+    	}
+    	
+    	/**
+    	 * This method runs the test.
+    	 * 
+    	 * @param result The test result
+    	 */
+    	public void run(TestResult result) {
+    		// Setup scribble services
+    		//ProtocolServices.setProtocolProjector(
+    		//		new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
+    		
+    		// Run test
+    		result.startTest(this);
+    		
+    		String filename="testmodels/protocol/"+m_name+".spr";
+    		
+    		java.io.InputStream is=
+    			ClassLoader.getSystemResourceAsStream(filename);
+    		
+    		if (is == null) {
+    			result.addError(this,
+    					new Throwable("Unable to locate resource: "+filename));
+    		} else {			
+    			CachedJournal journal=new CachedJournal();
+    			
+    			org.scribble.protocol.model.ProtocolModel model=null;
+    			
+				ANTLRProtocolParser parser=new ANTLRProtocolParser();
+				parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+				
+    			try {
+    				model = parser.parse(is, journal, null);
+    			} catch(Exception e) {
+    				result.addError(this, new Throwable("Parsing choreography failed"));
+    			}
+    			
+    			if (model == null) {
+    				result.addError(this, new Throwable("Model is null"));
+    			} else {
+    				//org.scribble.protocol.projection.ProtocolProjector projector=
+    				//	new org.scribble.projector.DefaultProjector();
+    				
+    				org.scribble.protocol.model.Role role=null;
+    				
+    				// Obtain role from definition
+     				//Protocol defn=model.getProtocol();
+    				    				
+    				// Check if subpath definition defined
+    				/*
+    				if (m_subDefinitionPath != null) {
+    					defn = defn.getSubDefinition(m_subDefinitionPath);
+    				}
+    				*/
+    				
+    				java.util.List<org.scribble.protocol.model.Role> roles=model.getRoles();
+    					//new org.scribble.model.Role(m_role);
+    				
+    				for (int i=0; role == null && i < roles.size(); i++) {
+    					if (roles.get(i).getName().equals(m_role)) {
+    						role = roles.get(i);
+    					}
+    				}
+    				
+    				if (role == null) {
+    					result.addError(this,
+    							new Throwable("Role '"+m_role+"' not found"));						
+    				} else {
+    					org.scribble.protocol.projection.ProtocolProjector projector=
+    						new org.scribble.protocol.projection.impl.ProtocolProjectorImpl();
+    					
+    					/* GPB: CONTRACT
+   						ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+						if (cg != null) {
+							cg.generate(model, journal, null);
+						}
+						*/
+						
+						org.scribble.protocol.model.ProtocolModel projected=
+    									projector.project(model, role, journal, null);
+    					
+    					/* Currently if a 'fail' is performed in Tycho build, it
+    					 * hangs the build.
+    					if (l.getErrors().size() > 0) {
+    						fail("Projection has errors: "+l.getErrors());
+    					} else if (projected == null) {
+    						fail("Projected model is null, for "+filename+" role "+role);
+    					}
+    					 */
+    					
+    					// TODO: SAVARA-167 - issue when projection is based on a sub-protocol
+    					if (AnnotationDefinitions.getAnnotation(projected.getProtocol().getAnnotations(),
+    									AnnotationDefinitions.TYPE) == null &&
+    							AnnotationDefinitions.getAnnotation(model.getProtocol().getAnnotations(),
+    	    									AnnotationDefinitions.TYPE) != null) {
+    						AnnotationDefinitions.copyAnnotations(model.getProtocol().getAnnotations(),
+    								projected.getProtocol().getAnnotations(), AnnotationDefinitions.TYPE);
+    					}
+    					
+    					//java.util.List<Role> projectedRoles=projected.getRoles();
+    					
+    					ModelGenerator generator=new ProtocolToBPELModelGenerator();
+    				
+						Object target=generator.generate(projected, journal, null);
+						
+						/*
+						ModelReference targetRef=
+							new ModelReference(BPELNotation.NOTATION_CODE);
+						targetRef.setAlias(m_name);
+						targetRef.setLocatedRole(m_role);
+						
+						DefaultBPELLanguageModel target=
+							new DefaultBPELLanguageModel(targetRef);
+
+						generator.generate(targetRef, role,
+									target, projected);
+						*/
+						
+						if (target instanceof TProcess) {
+							// Obtain any namespace prefix map
+							java.util.Map<String, String> prefixes=
+									new java.util.HashMap<String, String>();
+							
+							java.util.List<Annotation> list=
+								AnnotationDefinitions.getAnnotations(projected.getProtocol().getAnnotations(),
+										AnnotationDefinitions.TYPE);
+							
+							for (Annotation annotation : list) {
+								if (annotation.getProperties().containsKey(AnnotationDefinitions.NAMESPACE_PROPERTY) &&
+										annotation.getProperties().containsKey(AnnotationDefinitions.PREFIX_PROPERTY)) {
+									prefixes.put((String)annotation.getProperties().get(AnnotationDefinitions.NAMESPACE_PROPERTY),
+											(String)annotation.getProperties().get(AnnotationDefinitions.PREFIX_PROPERTY));
+								}
+							}
+							
+							try {
+								java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+								
+								BPELModelUtil.serialize((TProcess)target, baos, prefixes);
+								
+								baos.close();
+								
+								String text=new String(baos.toByteArray());
+								
+								checkResults(result, text);
+							} catch(Exception e) {
+								result.addError(this, e);
+							}
+						} else {
+							result.addError(this,
+									new Throwable("No BPEL generated"));						
+						}
+     				}
+    			}
+    		}
+    		
+    		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/bpel/"+m_name+"@"+m_role+".bpel";
+    		
+    		java.io.InputStream is=
+    			//ChoreographyToBPELTester.class.getResourceAsStream(filename);
+    				ClassLoader.getSystemResourceAsStream(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 srcfile="testmodels/protocol/"+m_name+".spr";
+    			
+    			java.net.URL url=ClassLoader.getSystemResource(srcfile);
+    			
+    			/*
+    			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("target/test-classes") != -1) {
+    					f = new java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
+    				} else if (url.getFile().indexOf("classes") != -1) {
+        				f = new java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
+    				} else if (url.getFile().indexOf("bin") != -1) {						
+    					f = new java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
+    				} else {
+    					result.addError(this, new Exception("Could not locate results folder to record expected result"));
+    				}
+    				
+    				if (f != null && f.exists()) {
+    					f = f.getParentFile().getParentFile().getParentFile();
+    					
+    					java.io.File resultsDir=new java.io.File(f, "results/bpel");
+    					
+    					if (resultsDir.exists() == false) {
+    						resultsDir.mkdirs();
+    					}
+    					
+    					java.io.File resultFile=new java.io.File(resultsDir,
+    										m_name+"@"+m_role+".generated");
+    					
+    					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: Generated output '"+resultFile+
+    									"' already exists - not being overwritten");
+    					}
+    				} else {
+    					result.addError(this, new Throwable("Unable to obtain URL for CDM model source '"+
+    							m_name+"': "+url));
+    				}
+    			}
+    		}
+    	}
+
+    	private String m_name=null;
+    	private String m_role=null;
+    }
+}

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at Broker.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at Broker.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at Broker.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker" xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ESBBrokerProcess_Broker" targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Broker.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_BrokerArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
     <partnerLinks>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at CreditAgency.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at CreditAgency.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker" xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ESBBrokerProcess_CreditAgency" targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Buyer.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
     <partnerLinks>
         <partnerLink myRole="CreditAgency" name="BrokerToCreditAgency" partnerLinkType="cay:BrokerToCreditAgencyServiceLT"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at SupplierTxnProcessor.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at SupplierTxnProcessor.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker at SupplierTxnProcessor.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,8 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker" xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer" xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency" xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier" xmlns:tns="http://www.pi4soa.org/ESBBroker" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ESBBrokerProcess_SupplierTxnProcessor" targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_SupplierTxnProcessor.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Buyer.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_CreditAgency.wsdl" namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_Supplier.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="ESBBrokerProcess_SupplierTxnProcessorArtifacts.wsdl" namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
     <partnerLinks>
         <partnerLink myRole="SupplierTxnProcessor" name="BrokerToSupplierTxnProcessor" partnerLinkType="spr:BrokerToSupplierTxnProcessorServiceLT"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://creditagency.com/creditCheckService" xmlns:cred="http://creditagency.com/creditCheck" xmlns:dmv="http://dmv.com/drivingRecordService" xmlns:drv="http://dmv.com/drivingRecord" xmlns:pcs="http://www.example.org/policyQuoteCalculationService" xmlns:pes="http://www.example.org/policyQuoteEntityService" xmlns:pol="http://www.example.org/policyQuote" xmlns:pps="http://www.example.org/policyQuoteProcessService" xmlns:tns="http://www.pi4soa.org/PolicyQuote" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PolicyQuoteProcess_PolicyQuoteProcessService" targetNamespace="http://www.example.org/policyQuoteProcessService">
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteProcessService.wsdl" namespace="http://www.example.org/policyQuoteProcessService"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_Driver.wsdl" namespace="http://www.pi4soa.org/PolicyQuote"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_CreditCheckService.wsdl" namespace="http://creditagency.com/creditCheckService"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_DrivingRecordService.wsdl" namespace="http://dmv.com/drivingRecordService"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteCalculationService.wsdl" namespace="http://www.example.org/policyQuoteCalculationService"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods at CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods at CreditAgency.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods at CreditAgency.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pur="java:org.jboss.savara.examples.purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="java:org.jboss.savara.examples.purchasing">
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Buyer.wsdl" namespace="http://www.jboss.org/savara/examples"/>
     <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="java:org.jboss.savara.examples.purchasing"/>
     <partnerLinks>
         <partnerLink myRole="CreditAgency" name="StoreToCreditAgency" partnerLinkType="pur:StoreToCreditAgencyServiceLT"/>

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/CDMProtocolParser.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -29,6 +29,7 @@
 import org.scribble.common.logging.Journal;
 import org.scribble.protocol.ProtocolContext;
 import org.scribble.protocol.model.ProtocolModel;
+import org.scribble.protocol.parser.AnnotationProcessor;
 import org.scribble.protocol.parser.ProtocolParser;
 
 /**
@@ -97,5 +98,9 @@
 		return(ret);
 	}
 
+	public void setAnnotationProcessor(AnnotationProcessor ap) {
+		// Not required
+	}
+
 	private static Logger logger = Logger.getLogger("org.pi4soa.scribble.cdm.parser");
 }

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/pom.xml	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/pom.xml	2011-02-11 12:26:06 UTC (rev 655)
@@ -28,8 +28,15 @@
 			<groupId>org.scribble.bundles</groupId>
 			<artifactId>org.scribble.protocol.parser</artifactId>
 			<version>${scribble.version}</version>
+			<scope>test</scope>
 		</dependency>
 		<dependency>
+			<groupId>org.scribble.bundles</groupId>
+			<artifactId>org.scribble.protocol.projection</artifactId>
+			<version>${scribble.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
 			<groupId>org.savara.bundles</groupId>
 			<artifactId>org.savara.common</artifactId>
 			<version>${savara.version}</version>

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/contract/generator/impl/ContractIntrospector.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/contract/generator/impl/ContractIntrospector.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/contract/generator/impl/ContractIntrospector.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -38,6 +38,7 @@
 import org.savara.contract.model.Type;
 import org.savara.contract.model.TypeDefinition;
 import org.scribble.common.logging.Journal;
+import org.scribble.protocol.model.Choice;
 import org.scribble.protocol.model.DefaultVisitor;
 import org.scribble.protocol.model.Protocol;
 import org.scribble.protocol.model.Interaction;
@@ -282,8 +283,36 @@
 	}
 	*/
 
+	protected boolean isRoleRelevant(java.util.List<Role> roles) {
+		boolean ret=false;
+		
+		for (Role role : roles) {
+			ret = isRoleRelevant(role);
+			if (ret) {
+				break;
+			}
+		}
+		
+		return(ret);
+	}
+	
+	protected boolean isRoleRelevant(Role role) {
+		boolean ret=false;
+		
+		ret = (role != null && role.equals(m_serverRole));
+		
+		return(ret);
+	}
+	
 	public void accept(Interaction interaction) {
 		
+		// Check if interaction is relevant for the server role 
+		if (!isRoleRelevant(interaction.getModel().getProtocol().getRole()) &&
+				!isRoleRelevant(interaction.getFromRole()) &&
+				!isRoleRelevant(interaction.getToRoles())) {
+			return;		
+		}
+		
 		// Receiving a request - so record this in the contract
 		Interface intf=getInterface();
 
@@ -376,6 +405,13 @@
 	 */
 	public boolean start(When when) {	
 		
+		// Check if interaction is relevant for the server role 
+		if (!isRoleRelevant(when.getModel().getProtocol().getRole()) &&
+				!isRoleRelevant(((Choice)when.getParent()).getFromRole()) &&
+				!isRoleRelevant(((Choice)when.getParent()).getToRole())) {
+			return(true);		
+		}
+		
 		// Receiving a request - so record this in the contract
 		Interface intf=getInterface();
 

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -20,7 +20,7 @@
 import org.savara.common.model.annotation.Annotation;
 import org.scribble.common.logging.Journal;
 
-public class AnnotationProcessor implements org.scribble.protocol.parser.antlr.AnnotationProcessor {
+public class AnnotationProcessor implements org.scribble.protocol.parser.AnnotationProcessor {
 
 	public Annotation getAnnotation(String annotation, java.util.Map<String, Object> properties,
 								Journal journal) {

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -16,6 +16,8 @@
 package org.savara.protocol.util;
 
 import org.scribble.protocol.export.ProtocolExportManager;
+import org.scribble.protocol.parser.DefaultProtocolParserManager;
+import org.scribble.protocol.parser.ProtocolParser;
 import org.scribble.protocol.parser.ProtocolParserManager;
 import org.scribble.protocol.projection.ProtocolProjector;
 import org.scribble.protocol.validation.ProtocolValidationManager;
@@ -43,6 +45,27 @@
 	}
 	
 	public static ProtocolParserManager getParserManager() {
+		if (m_parserManager == null) {
+			
+			// Instantiate default parser
+			try {
+				Class<?> cls=Class.forName("org.scribble.protocol.parser.antlr.ANTLRProtocolParser");
+				
+				Object obj=cls.newInstance();
+				
+				if (obj instanceof ProtocolParser) {
+					m_parserManager = new DefaultProtocolParserManager();
+					
+					ProtocolParser pp=(ProtocolParser)obj;
+					pp.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+					
+					m_parserManager.addParser(pp);
+				}
+			} catch(Exception e) {
+				// Ignore
+			}
+		}
+		
 		return(m_parserManager);
 	}
 	
@@ -60,15 +83,28 @@
 	}
 	*/
 	
-	/*
 	public static ProtocolProjector getProtocolProjector() {
+		if (m_protocolProjector == null) {
+			// Instantiate default projector
+			try {
+				Class<?> cls=Class.forName("org.scribble.protocol.projection.impl.ProtocolProjectorImpl");
+				
+				Object obj=cls.newInstance();
+				
+				if (obj instanceof ProtocolProjector) {
+					m_protocolProjector = (ProtocolProjector)obj;
+				}
+			} catch(Exception e) {
+				// Ignore
+			}
+		}
+		
 		return(m_protocolProjector);
 	}
 	
 	public static void setProtocolProjector(ProtocolProjector projector) {
 		m_protocolProjector = projector;
 	}
-	*/	
 	
 	public static ProtocolExportManager getProtocolExportManager() {
 		return(m_protocolExportManager);

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/ProtocolToContractGeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/ProtocolToContractGeneratorTest.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/contract/generator/ProtocolToContractGeneratorTest.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -25,48 +25,58 @@
 import org.savara.contract.model.Contract;
 import org.scribble.common.logging.CachedJournal;
 import org.scribble.protocol.model.Role;
-import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
 import org.savara.protocol.contract.generator.ContractGenerator;
 import org.savara.protocol.contract.generator.ContractGeneratorFactory;
+import org.savara.protocol.util.ProtocolServices;
 
 public class ProtocolToContractGeneratorTest {
 
     public static Test suite() {
         TestSuite suite = new TestSuite("Protocol->Contract Generator Tests");
 
-        suite.addTest(new ProtocolToContractTester("PolicyQuote", "CreditCheckService"));
-        suite.addTest(new ProtocolToContractTester("PolicyQuote", "PolicyQuoteProcessService"));
+        suite.addTest(new ProtocolToContractTester("PolicyQuote", "CreditCheckService", null));
+        suite.addTest(new ProtocolToContractTester("PolicyQuote", "PolicyQuoteProcessService", null));
         
-        suite.addTest(new ProtocolToContractTester("ESBBroker", "Broker"));
-        suite.addTest(new ProtocolToContractTester("ESBBroker", "Buyer"));     
-        suite.addTest(new ProtocolToContractTester("ESBBroker", "SupplierTxnProcessor"));
-        suite.addTest(new ProtocolToContractTester("ESBBroker", "CreditAgency"));
-        suite.addTest(new ProtocolToContractTester("ESBBroker", "SupplierQuoteEngine"));
+        suite.addTest(new ProtocolToContractTester("ESBBroker", "Broker", null));
+        suite.addTest(new ProtocolToContractTester("ESBBroker", "Buyer", null));     
+        suite.addTest(new ProtocolToContractTester("ESBBroker", "SupplierTxnProcessor", null));
+        suite.addTest(new ProtocolToContractTester("ESBBroker", "CreditAgency", null));
+        suite.addTest(new ProtocolToContractTester("ESBBroker", "SupplierQuoteEngine", null));
         
-        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Buyer"));
-        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "CreditAgency"));
-        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Store"));
+        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Buyer", null));
+        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Buyer", "CreditAgency"));
+        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "CreditAgency", null));
+        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Store", null));
+        suite.addTest(new ProtocolToContractTester("PurchaseGoods", "Store", "CreditAgency"));
         
-        suite.addTest(new ProtocolToContractTester("ReqRespFault", "Buyer"));
-        suite.addTest(new ProtocolToContractTester("ReqRespFault", "Seller"));
+        suite.addTest(new ProtocolToContractTester("ReqRespFault", "Buyer", null));
+        suite.addTest(new ProtocolToContractTester("ReqRespFault", "Seller", null));
         
         return suite;
     }
     
     protected static class ProtocolToContractTester extends TestCase {
 
+    	private String m_name=null;
+    	private String m_role=null;
+    	private String m_projectedRole=null;
+
     	/**
     	 * This constructor is initialized with the test
-    	 * name.
+    	 * name. If the optional projected role is provided, then
+    	 * use that role to generated a local model, upon which the
+    	 * contract role should be derived.
     	 * 
     	 * @param name The test name
     	 * @param role The role
+    	 * @param projectedRole The optional role that should be used to generated the projection
     	 */
     	public ProtocolToContractTester(String name,
-    						String role) {
-    		super(name+"@"+role);
+    						String role, String projectedRole) {
+    		super(name+"@"+role+(projectedRole == null ? "" : "_"+projectedRole));
     		m_name = name;
     		m_role = role;
+    		m_projectedRole = projectedRole;
     	}
     	
     	/**
@@ -92,15 +102,31 @@
     			
     			org.scribble.protocol.model.ProtocolModel model=null;
     			
-				ANTLRProtocolParser parser=new ANTLRProtocolParser();
-				parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
-				
+				//ANTLRProtocolParser parser=new ANTLRProtocolParser();
+				//parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+    			
     			try {
-    				model = parser.parse(is, journal, null);
+    				model = ProtocolServices.getParserManager().parse("spr", is, journal, null);
     			} catch(Exception e) {
     				result.addError(this, new Throwable("Parsing choreography failed"));
     			}
     			
+    			// Check if should project model
+    			if (m_projectedRole != null && model != null) {
+    				org.scribble.protocol.projection.ProtocolProjector projector=
+    							ProtocolServices.getProtocolProjector();
+    				
+    				if (projector != null) {
+    					model = projector.project(model, new Role(m_projectedRole), journal, null);
+    					
+    					if (model == null) {
+    	    				result.addError(this, new Throwable("Projected model is null"));
+    					}
+    				} else {
+        				result.addError(this, new Throwable("Could not located protocol projector"));
+    				}
+    			}
+    			
     			if (model == null) {
     				result.addError(this, new Throwable("Model is null"));
     			} else {
@@ -130,7 +156,8 @@
     	protected void checkResults(TestResult result, String bpel) {
     		boolean f_valid=false;
 
-    		String filename="results/contract/"+m_name+"@"+m_role+".contract";
+    		String filename="results/contract/"+m_name+"@"+m_role+
+    					(m_projectedRole == null ? "" : "_"+m_projectedRole)+".contract";
     		
     		java.io.InputStream is=
     			//ChoreographyToBPELTester.class.getResourceAsStream(filename);
@@ -202,7 +229,8 @@
     					}
     					
     					java.io.File resultFile=new java.io.File(resultsDir,
-    										m_name+"@"+m_role+".generated");
+    										m_name+"@"+m_role+
+    										(m_projectedRole == null ? "" : "_"+m_projectedRole)+".generated");
     					
     					//if (resultFile.exists() == false) {
     						try {
@@ -229,8 +257,5 @@
     			}
     		}
     	}
-
-    	private String m_name=null;
-    	private String m_role=null;
     }
 }

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at CreditCheckService.contract
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at CreditCheckService.contract	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at CreditCheckService.contract	2011-02-11 12:26:06 UTC (rev 655)
@@ -5,8 +5,6 @@
 	[[ XSDElement ]]
 	TypeDef CreditCheckResponse type={http://creditagency.com/creditCheck}creditCheckResponse location=null typeSystem=xsd
 	Interface {http://creditagency.com/creditCheckService}CreditCheckService {
-		OneWayRequestMEP label0( )
 		RequestResponseMEP checkCredit( CreditCheckRequest ) : CreditCheckResponse 
-		OneWayRequestMEP label1( )
 	}
 }

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at PolicyQuoteProcessService.contract
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at PolicyQuoteProcessService.contract	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PolicyQuote at PolicyQuoteProcessService.contract	2011-02-11 12:26:06 UTC (rev 655)
@@ -12,7 +12,5 @@
 	Interface {http://www.example.org/policyQuoteProcessService}PolicyQuoteProcessService {
 		RequestResponseMEP receivePolicyQuote( PolicyQuote ) : PolicyQuoteReply Fault policyQuoteFault( PolicyQuoteFault ) 
 		OneWayRequestMEP receiveDrivingRecord( DrivingRecordResponse )
-		OneWayRequestMEP label0( )
-		OneWayRequestMEP label1( )
 	}
 }

Added: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Buyer_CreditAgency.contract
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Buyer_CreditAgency.contract	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Buyer_CreditAgency.contract	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,2 @@
+Contract {http://www.jboss.org/savara/examples}Buyer {
+}

Added: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at CreditAgency_CreditAgency.contract
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at CreditAgency_CreditAgency.contract	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at CreditAgency_CreditAgency.contract	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,12 @@
+Contract {java:org.jboss.savara.examples.purchasing}CreditAgency {
+	Namespace prefix=pur uri=java:org.jboss.savara.examples.purchasing schemaLocation=null
+	[[ XSDType ]]
+	TypeDef CreditCheckInvalid type={java:org.jboss.savara.examples.purchasing}CreditCheckInvalid location=null typeSystem=xsd
+	[[ XSDType ]]
+	TypeDef CreditCheckOk type={java:org.jboss.savara.examples.purchasing}CreditCheckOk location=null typeSystem=xsd
+	[[ XSDType ]]
+	TypeDef CreditCheckRequest type={java:org.jboss.savara.examples.purchasing}CreditCheckRequest location=null typeSystem=xsd
+	Interface {java:org.jboss.savara.examples.purchasing}CreditAgency {
+		RequestResponseMEP checkCredit( CreditCheckRequest ) : CreditCheckOk Fault CreditCheckFailed( CreditCheckInvalid ) 
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Store_CreditAgency.contract
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Store_CreditAgency.contract	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/resources/results/contract/PurchaseGoods at Store_CreditAgency.contract	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,4 @@
+Contract {http://www.jboss.org/examples/store}Store {
+	Interface {http://www.jboss.org/examples/store}Store {
+	}
+}

Modified: branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/ProtocolToWSDLGeneratorTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/ProtocolToWSDLGeneratorTest.java	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/ProtocolToWSDLGeneratorTest.java	2011-02-11 12:26:06 UTC (rev 655)
@@ -27,9 +27,9 @@
 import org.savara.contract.model.Contract;
 import org.scribble.common.logging.CachedJournal;
 import org.scribble.protocol.model.Role;
-import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
 import org.savara.protocol.contract.generator.ContractGenerator;
 import org.savara.protocol.contract.generator.ContractGeneratorFactory;
+import org.savara.protocol.util.ProtocolServices;
 import org.savara.wsdl.generator.soap.SOAPRPCWSDLBinding;
 
 public class ProtocolToWSDLGeneratorTest {
@@ -95,11 +95,12 @@
     			
     			org.scribble.protocol.model.ProtocolModel model=null;
     			
-				ANTLRProtocolParser parser=new ANTLRProtocolParser();
-				parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+				//ANTLRProtocolParser parser=new ANTLRProtocolParser();
+				//parser.setAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
 				
     			try {
-    				model = parser.parse(is, journal, null);
+    				//model = parser.parse(is, journal, null);
+    				model = ProtocolServices.getParserManager().parse("spr", is, journal, null);
     			} catch(Exception e) {
     				result.addError(this, new Throwable("Parsing choreography failed"));
     			}

Modified: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,65 +1,64 @@
-<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Common at CreditAgency" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
-    <partnerLinks>
-        <partnerLink myRole="CreditAgencyService" name="StoreToCreditAgency" partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
-    </partnerLinks>
-    <variables>
-        <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
-        <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
-        <variable messageType="ca:CreditCheckFailedFault" name="creditCheckInvalidVar"/>
-    </variables>
-    <sequence>
-        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckRequestVar"/>
-        <if>
-			<bpel:condition><![CDATA[
-				$creditCheckRequestVar.content/@amount <= 500
-			]]></bpel:condition>
-            <sequence>
-				<assign name="CopyPurchaseDetails">
-                    <bpel:copy>
-                        <bpel:from>
-                            <bpel:literal xml:space="preserve">
-                            	<tns:CreditCheckOk xmlns:tns="http://www.jboss.org/examples/creditAgency" 
-                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
-                            				id="" amount="" >
-                            	</tns:CreditCheckOk>
-                            </bpel:literal>
-                        </bpel:from>
-                        <bpel:to variable="creditCheckOkVar" part="content"></bpel:to>
-                    </bpel:copy>
-				    <copy>
-				        <from>$creditCheckRequestVar.content/@id</from>
-				        <to>$creditCheckOkVar.content/@id</to>
-				    </copy>
-				</assign>
-                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckOkVar"/>
-            </sequence>
-            <else>
-                <sequence>
-					<assign name="CopyPurchaseDetails">
-	                    <bpel:copy>
-	                        <bpel:from>
-	                            <bpel:literal xml:space="preserve">
-	                            	<tns:CreditCheckInvalid xmlns:tns="http://www.jboss.org/examples/creditAgency" 
-	                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
-	                            				id="" amount="" >
-	                            	</tns:CreditCheckInvalid>
-	                            </bpel:literal>
-	                        </bpel:from>
-	                        <bpel:to variable="creditCheckInvalidVar" part="content"></bpel:to>
-	                    </bpel:copy>
-					    <copy>
-					        <from>$creditCheckRequestVar.content/@id</from>
-					        <to>$creditCheckInvalidVar.content/@id</to>
-					    </copy>
-					</assign>
-                    <reply faultName="ca:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface" variable="creditCheckInvalidVar"/>
-                </sequence>
-            </else>
-        </if>
-    </sequence>
-</process>
+<?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PurchaseGoodsProcess_CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <partnerLinks>
+        <partnerLink myRole="CreditAgency" name="StoreToCreditAgency" partnerLinkType="ca:StoreToCreditAgencyServiceLT"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="ca:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="ca:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="ca:CreditCheckFailedFault" name="CreditCheckFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_CreditCheckRequest" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgency" variable="checkCreditRequestVar"/>
+        <if>
+			<bpel:condition><![CDATA[
+				$checkCreditRequestVar.content/@amount <= 500
+			]]></bpel:condition>
+            <sequence>
+				<assign name="CopyPurchaseDetails">
+                    <bpel:copy>
+                        <bpel:from>
+                            <bpel:literal xml:space="preserve">
+                            	<tns:CreditCheckOk xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+                            				id="" amount="" >
+                            	</tns:CreditCheckOk>
+                            </bpel:literal>
+                        </bpel:from>
+                        <bpel:to variable="checkCreditResponseVar" part="content"></bpel:to>
+                    </bpel:copy>
+				    <copy>
+				        <from>$checkCreditRequestVar.content/@id</from>
+				        <to>$checkCreditResponseVar.content/@id</to>
+				    </copy>
+				</assign>
+                <reply name="Send_CreditCheckOk" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgency" variable="checkCreditResponseVar"/>
+            </sequence>
+            <else>
+                <sequence>
+					<assign name="CopyPurchaseDetails">
+	                    <bpel:copy>
+	                        <bpel:from>
+	                            <bpel:literal xml:space="preserve">
+	                            	<tns:CreditCheckInvalid xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+	                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+	                            				id="" amount="" >
+	                            	</tns:CreditCheckInvalid>
+	                            </bpel:literal>
+	                        </bpel:from>
+	                        <bpel:to variable="CreditCheckFailedFaultVar" part="content"></bpel:to>
+	                    </bpel:copy>
+					    <copy>
+					        <from>$checkCreditRequestVar.content/@id</from>
+					        <to>$CreditCheckFailedFaultVar.content/@id</to>
+					    </copy>
+					</assign>
+                    <reply faultName="ca:CreditCheckFailed" name="Send_CreditCheckInvalid" operation="checkCredit" partnerLink="StoreToCreditAgency" portType="ca:CreditAgency" variable="CreditCheckFailedFaultVar"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgency.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.jboss.org/examples/creditAgency" name="CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema">
+            <import namespace="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+        </schema>
+    </types>
+    <wsdl:message name="checkCreditResponse">
+        <wsdl:part element="ca:CreditCheckOk" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="CreditCheckFailedFault">
+        <wsdl:part element="ca:CreditCheckInvalid" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="checkCreditRequest">
+        <wsdl:part element="ca:CreditCheckRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="CreditAgency">
+        <wsdl:operation name="checkCredit">
+            <wsdl:input message="ca:checkCreditRequest">
+            </wsdl:input>
+            <wsdl:output message="ca:checkCreditResponse">
+            </wsdl:output>
+            <wsdl:fault message="ca:CreditCheckFailedFault" name="CreditCheckFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CreditAgencyBinding" type="ca:CreditAgency">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="checkCredit">
+            <soap:operation soapAction="http://www.jboss.org/examples/creditAgency/checkCredit"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="CreditCheckFailed">
+                <soap:fault name="CreditCheckFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CreditAgencyService">
+        <wsdl:port binding="ca:CreditAgencyBinding" name="CreditAgencyPort">
+            <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.jboss.org/examples/creditAgency" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.jboss.org/examples/creditAgency">
+    <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <wsdl:import location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <plnk:partnerLinkType name="StoreToCreditAgencyServiceLT">
+        <plnk:role name="CreditAgency" portType="ns1:CreditAgency"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_Store.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_Store.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/PurchaseGoodsProcess_Store.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" name="Store" targetNamespace="http://www.jboss.org/examples/store">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema">
+            <import namespace="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+        </schema>
+    </types>
+    <wsdl:message name="BuyFailedFault">
+        <wsdl:part element="tns:BuyFailed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyRequest">
+        <wsdl:part element="tns:BuyRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyResponse">
+        <wsdl:part element="tns:BuyConfirmed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="Store">
+        <wsdl:operation name="buy">
+            <wsdl:input message="tns:buyRequest">
+            </wsdl:input>
+            <wsdl:output message="tns:buyResponse">
+            </wsdl:output>
+            <wsdl:fault message="tns:BuyFailedFault" name="BuyFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="StoreBinding" type="tns:Store">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="buy">
+            <soap:operation soapAction="http://www.jboss.org/examples/store/buy"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="BuyFailed">
+                <soap:fault name="BuyFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="StoreService">
+        <wsdl:port binding="tns:StoreBinding" name="StorePort">
+            <soap:address location="http://localhost:8080/StoreService/StorePort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Modified: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/bpel-deploy.xml	2011-02-11 12:26:06 UTC (rev 655)
@@ -5,7 +5,7 @@
             true
         </active>
         <provide partnerLink="StoreToCreditAgency">
-            <service name="ns1:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+            <service name="ns1:CreditAgencyService" port="CreditAgencyPort"/>
         </provide>
     </process>
 </deploy>

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/creditAgency.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/creditAgency.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/creditAgency.xsd	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns:tns="http://www.jboss.org/examples/creditAgency" elementFormDefault="qualified">
+
+    <element name="CreditCheckRequest" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckOk" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckInvalid" type="tns:CreditCheckType"></element>
+
+    <complexType name="CreditCheckType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/store.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/store.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/creditAgency/store.xsd	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" elementFormDefault="qualified">
+
+    <element name="BuyRequest" type="tns:StoreType"></element>
+    <element name="BuyConfirmed" type="tns:StoreType"></element>
+    <element name="BuyFailed" type="tns:StoreType"></element>
+
+    <complexType name="StoreType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_CreditAgency.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_CreditAgency.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_CreditAgency.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.jboss.org/examples/creditAgency" name="CreditAgency" targetNamespace="http://www.jboss.org/examples/creditAgency">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema">
+            <import namespace="http://www.jboss.org/examples/creditAgency" schemaLocation="creditAgency.xsd"/>
+        </schema>
+    </types>
+    <wsdl:message name="checkCreditResponse">
+        <wsdl:part element="ca:CreditCheckOk" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="CreditCheckFailedFault">
+        <wsdl:part element="ca:CreditCheckInvalid" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="checkCreditRequest">
+        <wsdl:part element="ca:CreditCheckRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="CreditAgency">
+        <wsdl:operation name="checkCredit">
+            <wsdl:input message="ca:checkCreditRequest">
+            </wsdl:input>
+            <wsdl:output message="ca:checkCreditResponse">
+            </wsdl:output>
+            <wsdl:fault message="ca:CreditCheckFailedFault" name="CreditCheckFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CreditAgencyBinding" type="ca:CreditAgency">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="checkCredit">
+            <soap:operation soapAction="http://www.jboss.org/examples/creditAgency/checkCredit"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="CreditCheckFailed">
+                <soap:fault name="CreditCheckFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CreditAgencyService">
+        <wsdl:port binding="ca:CreditAgencyBinding" name="CreditAgencyPort">
+            <soap:address location="http://localhost:8080/CreditAgencyService/CreditAgencyPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Modified: branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.bpel	2011-02-11 12:26:06 UTC (rev 655)
@@ -1,94 +1,90 @@
-<process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:pur="http://www.jboss.org/examples/purchasing" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://www.scribble.org/conversation" ns0:conversationType="savara.samples.Purchasing at Store" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
-    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
-    <partnerLinks>
-        <partnerLink myRole="StoreService" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
-        <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
-    </partnerLinks>
-    <bpel:messageExchanges>
-        <bpel:messageExchange name="messageExchange"></bpel:messageExchange>
-        <bpel:messageExchange name="messageExchange1"></bpel:messageExchange>
-    </bpel:messageExchanges>
-    <variables>
-        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
-        <variable messageType="ca:checkCreditRequest" name="creditCheckRequestVar"/>
-        <variable messageType="ca:checkCreditResponse" name="creditCheckOkVar"/>
-        <variable messageType="sto:buyResponse" name="buyConfirmedVar"/>
-        <variable messageType="sto:BuyFailedFault" name="buyFailedVar"/>
-    </variables>
-    <sequence>
-        <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyRequestVar"/>
-        <scope>
-            <faultHandlers>
-                <catch faultMessageType="ca:CreditCheckFailedFault" faultName="ca:CreditCheckFailed" faultVariable="creditCheckInvalidVar">
-                    <sequence>
-						<assign name="CopyPurchaseDetails">
-		                    <bpel:copy>
-		                        <bpel:from>
-		                            <bpel:literal xml:space="preserve">
-										<tns:BuyFailed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-													xmlns:tns="http://www.jboss.org/examples/store" 
-													xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
-													id="" />
-		                            </bpel:literal>
-		                        </bpel:from>
-		                        <bpel:to variable="buyFailedVar" part="content"></bpel:to>
-		                    </bpel:copy>
-						    <copy>
-						        <from>$creditCheckInvalidVar.content/@id</from>
-						        <to>$buyFailedVar.content/@id</to>
-						    </copy>
-						</assign>
-                        <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyFailedVar"/>
-                    </sequence>
-                </catch>
-            </faultHandlers>
-            <sequence>
-				<assign name="CopyPurchaseDetails">
+<?xml version="1.0" encoding="UTF-8"?><process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ca="http://www.jboss.org/examples/creditAgency" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/savara/examples" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PurchaseGoodsProcess_Store" targetNamespace="http://www.jboss.org/examples/store" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PurchaseGoodsProcess_StoreArtifacts.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <partnerLinks>
+        <partnerLink myRole="Store" name="BuyerToStore" partnerLinkType="sto:BuyerToStoreServiceLT"/>
+        <partnerLink name="StoreToCreditAgency" partnerLinkType="sto:StoreToCreditAgencyLT" partnerRole="CreditAgencyRequester"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="sto:buyRequest" name="buyRequestVar"/>
+        <variable messageType="ca:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="ca:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="sto:buyResponse" name="buyResponseVar"/>
+        <variable messageType="sto:BuyFailedFault" name="BuyFailedFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" name="Receive_BuyRequest" operation="buy" partnerLink="BuyerToStore" portType="sto:Store" variable="buyRequestVar"/>
+        <scope>
+            <faultHandlers>
+                <catch faultMessageType="ca:CreditCheckFailedFault" faultName="ca:CreditCheckFailed" faultVariable="CreditCheckFailedFaultVar">
+                    <sequence>
+						<assign name="CopyPurchaseDetails">
+		                    <bpel:copy>
+		                        <bpel:from>
+		                            <bpel:literal xml:space="preserve">
+										<tns:BuyFailed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+													xmlns:tns="http://www.jboss.org/examples/store" 
+													xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+													id="" />
+		                            </bpel:literal>
+		                        </bpel:from>
+		                        <bpel:to variable="BuyFailedFaultVar" part="content"></bpel:to>
+		                    </bpel:copy>
+						    <copy>
+						        <from>$CreditCheckFailedFaultVar.content/@id</from>
+						        <to>$BuyFailedFaultVar.content/@id</to>
+						    </copy>
+						</assign>
+                        <reply faultName="sto:BuyFailed" name="Send_BuyFailed" operation="buy" partnerLink="BuyerToStore" portType="sto:Store" variable="BuyFailedFaultVar"/>
+                    </sequence>
+                </catch>
+            </faultHandlers>
+            <sequence>
+				<assign name="CopyPurchaseDetails">
                     <bpel:copy>
                         <bpel:from>
-                            <bpel:literal xml:space="preserve">
-                            	<tns:CreditCheckRequest xmlns:tns="http://www.jboss.org/examples/creditAgency" 
-                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
-                            				id="" amount="" >
-                            	</tns:CreditCheckRequest>
+                            <bpel:literal xml:space="preserve">
+                            	<tns:CreditCheckRequest xmlns:tns="http://www.jboss.org/examples/creditAgency" 
+                            				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+                            				xsi:schemaLocation="http://www.jboss.org/examples/creditAgency creditAgency.xsd "
+                            				id="" amount="" >
+                            	</tns:CreditCheckRequest>
                             </bpel:literal>
                         </bpel:from>
-                        <bpel:to variable="creditCheckRequestVar" part="content"></bpel:to>
+                        <bpel:to variable="checkCreditRequestVar" part="content"></bpel:to>
                     </bpel:copy>
-				    <copy>
-				        <from>$buyRequestVar.content/@id</from>
-				        <to>$creditCheckRequestVar.content/@id</to>
-				    </copy>
-				    <copy>
-				        <from>$buyRequestVar.content/@amount</from>
-				        <to>$creditCheckRequestVar.content/@amount</to>
-				    </copy>
-                </assign>
+				    <copy>
+				        <from>$buyRequestVar.content/@id</from>
+				        <to>$checkCreditRequestVar.content/@id</to>
+				    </copy>
+				    <copy>
+				        <from>$buyRequestVar.content/@amount</from>
+				        <to>$checkCreditRequestVar.content/@amount</to>
+				    </copy>
+                </assign>
                 
-                <invoke inputVariable="creditCheckRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="creditCheckOkVar" partnerLink="StoreToCreditAgency" portType="ca:CreditAgencyInterface"/>
-
-				<assign name="CopyPurchaseDetails">
-                    <bpel:copy>
-                        <bpel:from>
-                            <bpel:literal xml:space="preserve">
-								<tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-											xmlns:tns="http://www.jboss.org/examples/store" 
-											xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
-											id="" />
-                            </bpel:literal>
-                        </bpel:from>
-                        <bpel:to variable="buyConfirmedVar" part="content"></bpel:to>
-                    </bpel:copy>
-				    <copy>
-				        <from>$creditCheckOkVar.content/@id</from>
-				        <to>$buyConfirmedVar.content/@id</to>
-				    </copy>
-				</assign>
-                <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:StoreInterface" variable="buyConfirmedVar"/>
-            </sequence>
-        </scope>
-    </sequence>
-</process>
+                <invoke inputVariable="checkCreditRequestVar" name="Send_CreditCheckRequest" operation="checkCredit" outputVariable="checkCreditResponseVar" partnerLink="StoreToCreditAgency" portType="ca:CreditAgency"/>
+
+				<assign name="CopyPurchaseDetails">
+                    <bpel:copy>
+                        <bpel:from>
+                            <bpel:literal xml:space="preserve">
+								<tns:BuyConfirmed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+											xmlns:tns="http://www.jboss.org/examples/store" 
+											xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd " 
+											id="" />
+                            </bpel:literal>
+                        </bpel:from>
+                        <bpel:to variable="buyResponseVar" part="content"></bpel:to>
+                    </bpel:copy>
+				    <copy>
+				        <from>$checkCreditResponseVar.content/@id</from>
+				        <to>$buyResponseVar.content/@id</to>
+				    </copy>
+				</assign>
+                <reply name="Send_BuyConfirmed" operation="buy" partnerLink="BuyerToStore" portType="sto:Store" variable="buyResponseVar"/>
+            </sequence>
+        </scope>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_Store.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:sto="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" name="Store" targetNamespace="http://www.jboss.org/examples/store">
+    <types xmlns="http://schemas.xmlsoap.org/wsdl/">
+        <schema xmlns="http://www.w3.org/2001/XMLSchema">
+            <import namespace="http://www.jboss.org/examples/store" schemaLocation="store.xsd"/>
+        </schema>
+    </types>
+    <wsdl:message name="BuyFailedFault">
+        <wsdl:part element="tns:BuyFailed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyRequest">
+        <wsdl:part element="tns:BuyRequest" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="buyResponse">
+        <wsdl:part element="tns:BuyConfirmed" name="content">
+        </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="Store">
+        <wsdl:operation name="buy">
+            <wsdl:input message="tns:buyRequest">
+            </wsdl:input>
+            <wsdl:output message="tns:buyResponse">
+            </wsdl:output>
+            <wsdl:fault message="tns:BuyFailedFault" name="BuyFailed">
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="StoreBinding" type="tns:Store">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="buy">
+            <soap:operation soapAction="http://www.jboss.org/examples/store/buy"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="BuyFailed">
+                <soap:fault name="BuyFailed" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="StoreService">
+        <wsdl:port binding="tns:StoreBinding" name="StorePort">
+            <soap:address location="http://localhost:8080/StoreService/StorePort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_StoreArtifacts.wsdl
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_StoreArtifacts.wsdl	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/PurchaseGoodsProcess_StoreArtifacts.wsdl	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.jboss.org/examples/store" xmlns:ns2="http://www.jboss.org/examples/creditAgency" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" targetNamespace="http://www.jboss.org/examples/store">
+    <wsdl:import location="PurchaseGoodsProcess_Store.wsdl" namespace="http://www.jboss.org/examples/store"/>
+    <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl" namespace="http://www.jboss.org/examples/creditAgency"/>
+    <plnk:partnerLinkType name="BuyerToStoreServiceLT">
+        <plnk:role name="Store" portType="ns1:Store"/>
+    </plnk:partnerLinkType>
+    <plnk:partnerLinkType name="StoreToCreditAgencyLT">
+        <plnk:role name="CreditAgencyRequester" portType="ns2:CreditAgency"/>
+    </plnk:partnerLinkType>
+</wsdl:definitions>

Modified: branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml	2011-02-10 22:54:15 UTC (rev 654)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/bpel-deploy.xml	2011-02-11 12:26:06 UTC (rev 655)
@@ -6,10 +6,10 @@
             true
         </active>
         <provide partnerLink="BuyerToStore">
-            <service name="ns1:StoreService" port="StoreInterfacePort"/>
+            <service name="ns1:StoreService" port="StorePort"/>
         </provide>
         <invoke partnerLink="StoreToCreditAgency">
-            <service name="ns2:CreditAgencyService" port="CreditAgencyInterfacePort"/>
+            <service name="ns2:CreditAgencyService" port="CreditAgencyPort"/>
         </invoke>
     </process>
 </deploy>

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/creditAgency.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/creditAgency.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/creditAgency.xsd	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/creditAgency" xmlns:tns="http://www.jboss.org/examples/creditAgency" elementFormDefault="qualified">
+
+    <element name="CreditCheckRequest" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckOk" type="tns:CreditCheckType"></element>
+    <element name="CreditCheckInvalid" type="tns:CreditCheckType"></element>
+
+    <complexType name="CreditCheckType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file

Added: branches/experimental/2.0.x/samples/purchasing/completed/store/store.xsd
===================================================================
--- branches/experimental/2.0.x/samples/purchasing/completed/store/store.xsd	                        (rev 0)
+++ branches/experimental/2.0.x/samples/purchasing/completed/store/store.xsd	2011-02-11 12:26:06 UTC (rev 655)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" elementFormDefault="qualified">
+
+    <element name="BuyRequest" type="tns:StoreType"></element>
+    <element name="BuyConfirmed" type="tns:StoreType"></element>
+    <element name="BuyFailed" type="tns:StoreType"></element>
+
+    <complexType name="StoreType">
+    	<attribute name="id" type="string"></attribute>
+    	<attribute name="amount" type="integer"></attribute>
+    </complexType>
+</schema>
\ No newline at end of file



More information about the savara-commits mailing list