Changeset 2001 for trunk/autoquest-plugin-uml
- Timestamp:
- 07/10/15 10:23:29 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java
r2000 r2001 60 60 import org.eclipse.uml2.uml.MessageSort; 61 61 import org.eclipse.uml2.uml.Model; 62 import org.eclipse.uml2.uml.NamedElement; 62 63 import org.eclipse.uml2.uml.Operation; 63 64 import org.eclipse.uml2.uml.Package; … … 77 78 78 79 import de.ugoe.cs.autoquest.eventcore.Event; 79 import de.ugoe.cs.autoquest.eventcore.EventUtils;80 80 import de.ugoe.cs.autoquest.plugin.http.SOAPUtils; 81 81 import de.ugoe.cs.autoquest.plugin.http.eventcore.SOAPEventType; … … 536 536 getOperationFromName(targetInterface.getOperations(), methodName); 537 537 // get connector 538 Connector connector = inferConnector(msgSourceLifeline, msgTargetLifeline); 538 System.out.println(event.getType()); 539 Connector connector = inferConnector(msgSourceLifeline, msgTargetLifeline, targetInterface); 540 if( connector==null ) { 541 throw new RuntimeException("Error creating message: could not find connector between the two life lines that supports the target interface at the target lifeline"); 542 } 539 543 540 544 boolean asynch = false; … … 979 983 * Infers connector between two lifelines. 980 984 * </p> 981 * <p>982 * TODO: Currently assumes only one connector between two lifelines possible. This assumption is983 * invalid as soon as there are two ports that connect the same two properties.984 * </p>985 985 * 986 986 * @param msgSourceLifeline … … 989 989 * target lifeline of the message 990 990 */ 991 private static Connector inferConnector(Lifeline msgSourceLifeline, Lifeline msgTargetLifeline )991 private static Connector inferConnector(Lifeline msgSourceLifeline, Lifeline msgTargetLifeline, Interface targetInterface) 992 992 { 993 993 EList<Property> userAttributes = 994 ((Component) msgSourceLifeline.getRepresents().getType()).getA ttributes();994 ((Component) msgSourceLifeline.getRepresents().getType()).getAllAttributes(); 995 995 EList<Property> targetAttributes = 996 ((Component) msgTargetLifeline.getRepresents().getType()).getA ttributes();996 ((Component) msgTargetLifeline.getRepresents().getType()).getAllAttributes(); 997 997 for (Property userAttribute : userAttributes) { 998 998 if (userAttribute instanceof Port) { … … 1002 1002 for (Property targetAttribute : targetAttributes) { 1003 1003 if (targetAttribute instanceof Port) { 1004 EList<ConnectorEnd> targetEnds = ((Port) targetAttribute).getEnds(); 1005 for (ConnectorEnd targetEnd : targetEnds) { 1006 Connector targetConnector = (Connector) targetEnd.eContainer(); 1007 if (targetConnector == userConnector) { 1008 return targetConnector; 1004 if( ((Port) targetAttribute).getProvideds().contains(targetInterface) ) { 1005 EList<ConnectorEnd> targetEnds = ((Port) targetAttribute).getEnds(); 1006 for (ConnectorEnd targetEnd : targetEnds) { 1007 Connector targetConnector = (Connector) targetEnd.eContainer(); 1008 if (targetConnector == userConnector) { 1009 return targetConnector; 1010 } 1009 1011 } 1010 1012 }
Note: See TracChangeset
for help on using the changeset viewer.