[savara-commits] savara SVN: r75 - tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 6 19:25:46 EST 2009


Author: objectiser
Date: 2009-11-06 19:25:46 -0500 (Fri, 06 Nov 2009)
New Revision: 75

Modified:
   tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java
Log:
Simplify identification of port type - but does not solve absence of port type in particular example, as this was related to the fact that the generation is being done using a sub-conversation whose roles don't have access to the contracts of their mapped top level roles.

Modified: tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java
===================================================================
--- tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java	2009-11-06 23:20:02 UTC (rev 74)
+++ tools/eclipse/trunk/plugins/org.jboss.savara.tools.bpel/src/java/org/jboss/savara/tools/bpel/model/change/ConversationInteractionModelChangeRule.java	2009-11-07 00:25:46 UTC (rev 75)
@@ -104,8 +104,6 @@
 		}
 		
 		// Identify port type role
-		Role toPortTypeRole=role;
-		Role fromPortTypeRole=role;
 		String prefix=null;
 		
 		String mainPrefix=null;
@@ -116,28 +114,28 @@
 			mainPrefix = bpelModel.getBPELProcess().addNamespace(contract.getNamespace());
 		}
 		
+		Role roleType=null;
+		
 		if (InteractionUtil.isRequest(interaction)) {
-			toPortTypeRole = interaction.getToRole();
+			roleType = interaction.getToRole();
+			if (roleType == null) {
+				roleType = role;
+			}
 		} else {
-			fromPortTypeRole = interaction.getFromRole();
+			roleType = interaction.getFromRole();
+			if (roleType == null) {
+				roleType = role;
+			}
 		}
 		
-		if (toPortTypeRole != null &&
-				toPortTypeRole.getAnnotations().containsKey(Contract.class.getName())) {
-			Contract contract=(Contract)toPortTypeRole.getAnnotations().get(Contract.class.getName());
+		if (roleType != null &&
+				roleType.getAnnotations().containsKey(Contract.class.getName())) {
+			Contract contract=(Contract)roleType.getAnnotations().get(Contract.class.getName());
 
 			// Assume that contract only has one interface for now
 			if (contract.getInterfaces().size() > 0) {
 				intf = contract.getInterfaces().get(0);
 			}
-		} else if (fromPortTypeRole != null &&
-				fromPortTypeRole.getAnnotations().containsKey(Contract.class.getName())) {
-			Contract contract=(Contract)fromPortTypeRole.getAnnotations().get(Contract.class.getName());
-
-			// Assume that contract only has one interface for now
-			if (contract.getInterfaces().size() > 0) {
-				intf = contract.getInterfaces().get(0);
-			}
 		}
 		
 		if (intf != null) {



More information about the savara-commits mailing list