Package sg.edu.nus.comp.simTL.engine.tracing

Examples of sg.edu.nus.comp.simTL.engine.tracing.TraceLink


     
     
      template.addChildTo(tParent, tParent2tChildRef, tChild, position, context);
      //introduce trace link!!
      modelCorrespondence.add(
          new TraceLink(
            (StaticContext)context, //neighbor has the same context presumably
            new TraceLinkNode(
              template,
              tChild
            ),
View Full Code Here


   * @return
   * @throws SimTLException
   */
  private EObjectTraceLinkReturnContainer findTObject(EObject tiObject) throws SimTLException{
    EObject tObject = null;
    TraceLink tl = null;
    int i = 0;
    for(TraceLinkNode tObjectTLN : modelCorrespondence.getCorrespondingElement(tiObject)){
      if(tObjectTLN.getModel().getModelType()!=ModelType.TEMPLATE_MODEL){
        throw new SynchronizingException("ME2MELink pointed from template instance to " + tObjectTLN.getModel().getModelType().toString());
      }
View Full Code Here

        //negate if condition
        parameterModelHandler.negateCondition(new TIfStatement(tObject,context,template), true);
       
        //introduce trace link
        modelCorrespondence.add(
            new TraceLink(
              (StaticContext)context, //context is been adapted
              new TraceLinkNode(
                template,
                tChild
              ),
              new TraceLinkNode(
                instance,
                tiChild
              )
            ));
       
      } else if(TForLoop.isTForLoop(tObject)){
        TForLoop forLoop = new TForLoop(tObject, context, template);
        EObject neighborInputElement = context.getVariableValue(forLoop.getName());
       
        Reference2Element pPointerToList = (Reference2Element)forLoop.getSetToBeIterated().getReferenceFromParent();
        List<EObject> parameterList = (List<EObject>)pPointerToList.getReferencedValue();
        if(parameterList.size()>0
            && (neighborInputElement==null
              ||!parameterList.contains(neighborInputElement))){
          throw new SimTLException("InputModel collection doesn't contain neighbor input element. It does contain other elements though");
         
        }
       
        Reference2Element pPointerToListElement = (Reference2Element)pPointerToList;
        EClass pClass = pPointerToListElement.getReferenceToChildren().getEReferenceType();
        //create new inputElement
        EObject pElement = pClass.getEPackage().getEFactoryInstance().create(pClass);
       
       
        if(pElement==null) throw new SimTLException("Couldn't instantiate parameter element type " + pClass.getName());
       
        //Add element to parameter model
        if(parameterList.size()>1){
          //It must be a new iteration => Existing is covered in position above
          boolean insertToRightOfParam = ((NewIterationAddAllocation)grayElementAddAllocation).isInsertToRightOfParam();
          int neighborIndex = parameterList.indexOf(neighborInputElement);
          int pIndex =
            insertToRightOfParam
              ?neighborIndex+1
              :neighborIndex;
          parameterModelHandler.addElement(pElement, pIndex, pPointerToList);
        } else {
          parameterModelHandler.addElement(pElement, Util.NO_POSITION, pPointerToList);
        }
       
        //Update context
        context = addVariableToContext(context, forLoop.getName(), pElement);
        //introduce trace link
        modelCorrespondence.add(
            new TraceLink(
              (StaticContext)context, //context is been adapted
              new TraceLinkNode(
                template,
                tChild
              ),
View Full Code Here

//        }
//      }
    }
   
    modelCorrespondence.add(
        new TraceLink(
          currentContext.saveToStaticContext(),
          new TraceLinkNode(
            template,
            tObject
          ),
View Full Code Here

    }
    //TODO validate that not both attribute and placeholder are set
   
    if(checkActualAttribute(tAttributeClass,iAttributeClass,tObject,iObject)){
      modelCorrespondence.add(
          new TraceLink(
            currentContext.saveToStaticContext(),
            new TraceLinkNode(
              template,
              new Reference2Attribute(
                tObject,
                tAttributeClass
              )
            ),
            new TraceLinkNode(
              instance,
              new Reference2Attribute(
                iObject,
                iAttributeClass
              )
            )
          ));
    } else{
      ReferenceFromParent refFromParent =
        checkPlaceholder(tAttributeClass,iAttributeClass,tObject,iObject);
      if(refFromParent!=null){
        //HANDLE TRACELINK
        //1) importedModel - resultModel
        StaticContext staticContext = currentContext.saveToStaticContext();
        modelCorrespondence.add(
          new TraceLink(
            staticContext,
            new TraceLinkNode(
              getImportedModel(refFromParent.getParent().eResource()),
              (Reference2Attribute)refFromParent
            ),
View Full Code Here

        pPointer2Att);
    TraceLinkNode iTLN =new TraceLinkNode(
        template,
        iPointerToAtt);
   
    TraceLink traceLink = modelCorrespondence.getTraceLink(pTLN,iTLN);
    if(traceLink==null){
      log.debug("Add new attribute2attribute-TraceLink");
      modelCorrespondence.add(new TraceLink(
          (StaticContext)context, pTLN, iTLN));
    }   
  }
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.tracing.TraceLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.