Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.RelToResolve


      return false;
    }
    //TODO check if the embedding composite can see the target.
    //Difficult since we do not know which composite relation is used
   
    RelToResolve rel = getRelToResolve() ;
    if (source.getKind() != rel.getSourceKind()) {
      return false;
    }
   
    if (destination.getKind() != rel.getTargetKind()) {
      return false;
    }
   
    if (hasConstraints && !rel.matchRelationConstraints(destination)) {
      return false ;
    }
    return true ;
  }
View Full Code Here


      testResolutionExceptionCase16(instance));
  Assert.assertEquals(
    "No relations should have been created (no instance of dependency existing)",
    0, instance.getRawLinks().size());

  RelToResolve rel = new RelToResolveImpl(instance,
    instance.getRelation("testexist02"));
  instance.createLink(instancedep, rel, false, false);

  testResolutionExceptionCase16(instance);
  auxListInstances();
View Full Code Here


    /*
     *  Creates an relToResolve only considering the relation. Not completely initialized.
     */
    RelToResolve relToResolve  = new RelToResolveImpl(source, rel);
    Resolved<Component> resolved     = null;

    /*
     * If the source is an instance, verify if there is explicit promotions declared in the composite
     *
     *  TODO When an explicit promotion is declared, we perform resolution inside the composite if the
     *  promotion fails. This is not very intuitive but is more resilient, to discuss which is the good
     *  specification.
     */
    if (source instanceof Instance) {
      resolved = checkExplicitPromotion((Instance) source, relToResolve);
    }

    /*
     * If the source is not an instance or there is no explicit promotion, delegate to managers
     */
    if (resolved == null) {

      /*
       * Delegate resolution to managers and update the model
       */
      resolved = this.resolveByManagers(relToResolve);
      if (resolved != null) {
        updateModel(source, relToResolve, resolved, relToResolve.hasConstraints(),false);
      }
     
      /*
       * As a last resort try implicit promotion
       *
       * NOTE Notice that we recreate the relation to resolve from the declarations, to be sure
       * that we ignore all constraints that could be added by the managers during the first try
       */
      if (resolved == null && source instanceof Instance) {
        resolved = checkImplicitPromotion((Instance) source,new RelToResolveImpl(source,rel));
      }
      else if (resolved != null && source instanceof Instance && relToResolve.isMultiple()) {
        /*
         * TODO For relations with cardinality multiple, we try to merge all available targets,
         * so we merge the managers' result with the implicit promotions. This is not very intuitive
         * but is more resilient, to discuss which is the good specification.
         */
 
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.RelToResolve

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.