[savara-commits] savara SVN: r649 - branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Feb 10 17:03:37 EST 2011


Author: objectiser
Date: 2011-02-10 17:03:36 -0500 (Thu, 10 Feb 2011)
New Revision: 649

Modified:
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
Log:
Obtain contract for the roles, to define the port type for the partner link type.

Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.bpel/src/java/org/savara/tools/bpel/generator/Generator.java	2011-02-10 22:03:36 UTC (rev 649)
@@ -565,9 +565,15 @@
 		while (roles.hasNext()) {
 			Role r=roles.next();
 			
-			if (r != null && r.getProperties().containsKey(Contract.class.getName())) {
-				Contract contract=(Contract)r.getProperties().get(Contract.class.getName());
-				
+			ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+			Contract contract=null;
+			
+			if (cg != null) {
+				CachedJournal journal=new CachedJournal();
+				contract=cg.generate(m_protocolModel.getProtocol(), null, r, journal);
+			}
+			
+			if (contract != null) {
 				boolean gen=false;
 				
 				java.util.Iterator<Interface> iter=contract.getInterfaces().iterator();
@@ -617,9 +623,15 @@
 					}
 				}
 				
-				if (useRole != null && 
-							useRole.getProperties().containsKey(Contract.class.getName())) {
-					Contract contract=(Contract)useRole.getProperties().get(Contract.class.getName());
+				ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+				Contract contract=null;
+				
+				if (cg != null && useRole != null) {
+					CachedJournal journal=new CachedJournal();
+					contract=cg.generate(m_protocolModel.getProtocol(), null, useRole, journal);
+				}
+				
+				if (contract != null) {
 					Interface intf=null;
 					
 					if (pl.getMyRole() != null) {
@@ -652,8 +664,15 @@
 				
 				plRole.setAttribute(NAME_LABEL, pl.getMyRole());
 				
-				if (role.getProperties().containsKey(Contract.class.getName())) {
-					Contract contract=(Contract)role.getProperties().get(Contract.class.getName());
+				ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+				Contract contract=null;
+				
+				if (cg != null) {
+					CachedJournal journal=new CachedJournal();
+					contract=cg.generate(m_protocolModel.getProtocol(), null, role, journal);
+				}
+				
+				if (contract != null) {
 					Interface intf=null;
 					
 					if (pl.getMyRole() != null) {



More information about the savara-commits mailing list