Changeset 1761


Ignore:
Timestamp:
09/24/14 12:04:59 (10 years ago)
Author:
sherbold
Message:
  • fixed another but related to the DSL compability of the generated sequence diagrams
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-uml/src/main/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtils.java

    r1759 r1761  
    4040import org.eclipse.uml2.uml.Port; 
    4141import org.eclipse.uml2.uml.Profile; 
     42import org.eclipse.uml2.uml.Property; 
    4243import org.eclipse.uml2.uml.Region; 
    4344import org.eclipse.uml2.uml.StateMachine; 
     
    286287            (Interaction) testContext.createPackagedElement(interactionName + "_Impl", 
    287288                                                            UMLPackage.Literals.INTERACTION); 
     289         
     290        operation.getMethods().add(interaction); 
    288291 
    289292        Lifeline userLifeline = interaction.createLifeline("user"); 
     
    293296        Component userComponent = 
    294297            (Component) model.getPackagedElement("User", true, UMLPackage.Literals.COMPONENT, true); 
    295         Port userPort = (Port) userComponent.getAttribute("p_user_rlus", null); 
     298         
     299        EList<Property> userAttributes = userComponent.getAttributes(); 
     300        List<Port> userPorts = new LinkedList<>(); 
     301        for( Property userAttribute : userAttributes ) { 
     302            if( userAttribute instanceof Port ) { 
     303                userPorts.add((Port) userAttribute); 
     304            } 
     305        } 
    296306 
    297307        int i = 0; 
     
    342352                message.setSendEvent(sendFragment); 
    343353                message.setReceiveEvent(recvFragment); 
    344  
    345                 EList<ConnectorEnd> sourceEnds = userPort.getEnds(); 
     354                 
    346355                EList<ConnectorEnd> targetEnds = portMap.get(serviceName).getEnds(); 
    347356 
    348                 for (ConnectorEnd sourceEnd : sourceEnds) { 
    349                     Connector sourceConnector = (Connector) sourceEnd.eContainer(); 
    350                     for (ConnectorEnd targetEnd : targetEnds) { 
    351                         Connector targetConnector = (Connector) targetEnd.eContainer(); 
    352                         if (targetConnector == sourceConnector) { 
    353                             message.setConnector(targetConnector); 
     357                for( Port userPort : userPorts ) { 
     358                    EList<ConnectorEnd> sourceEnds = userPort.getEnds(); 
     359                    for (ConnectorEnd sourceEnd : sourceEnds) { 
     360                        Connector sourceConnector = (Connector) sourceEnd.eContainer(); 
     361                        for (ConnectorEnd targetEnd : targetEnds) { 
     362                            Connector targetConnector = (Connector) targetEnd.eContainer(); 
     363                            if (targetConnector == sourceConnector) { 
     364                                message.setConnector(targetConnector); 
     365                            } 
    354366                        } 
    355367                    } 
Note: See TracChangeset for help on using the changeset viewer.