Package org.emftrace.metamodel.RuleModel

Examples of org.emftrace.metamodel.RuleModel.RuleCatalog


        for(int i = 0; i < catalogs.size(); i++)
            ruleCount +=  accessLayer.getAllChildren(catalogs.get(i)).size();
       
        if( ruleCount < rules.size() )
        {
            RuleCatalog orphans = null;
           
            for(int i = 0; i < rules.size(); i++)
            {
                boolean isOrphan = true;
               
                for(int j = 0; j < catalogs.size(); j++)
                {
                    if( accessLayer.getAllChildren(catalogs.get(j)).contains(rules.get(i)) )
                    {
                        isOrphan = false;
                        break;
                    }
                }
               
                if( isOrphan )
                {
                    if( orphans == null )
                    {
                        // search for an existing orphan catalog:
                        for(int j = 0; j < catalogs.size(); j++)
                        {
                            String name = ((RuleCatalog)catalogs.get(j)).getName();
                            if( name != null && name.contains("Orphans"))
                            {
                                orphans = (RuleCatalog)catalogs.get(j);
                                break;
                            }
                        }
                       
                        // create a new one, if none exists:
                        if( orphans == null )
                        {
                            orphans = RuleModelFactory.eINSTANCE.createRuleCatalog();
                            accessLayer.addElement(project, orphans);
                            orphans.setName("Orphans");
                        }
                    }
                   
                    orphans.getRules().add((Rule)rules.get(i));
                }
            }           
        }
       
        if( isLoggingEnabled ) printToLog("cleanUpRuleOrphans", "1. checked for rule-orphans");
View Full Code Here


        Rule r2 = RuleModelFactory.eINSTANCE.createRule();
       
        accessLayer.addElement(project, r1);
        accessLayer.addElement(project, r2);
       
        RuleCatalog c1 = RuleModelFactory.eINSTANCE.createRuleCatalog();
       
        accessLayer.addElement(project, c1);
       
        c1.getRules().add(r1);
       
        assertEquals(1, c1.getRules().size());
        assertEquals(1, accessLayer.getElements(project, "RuleCatalog").size());
        assertEquals(2, accessLayer.getElements(project, "Rule").size());
        projectCleaner.cleanUpRuleOrphans(project);
        assertEquals(1, c1.getRules().size());
        assertEquals(2, accessLayer.getElements(project, "Rule").size());
        assertEquals(2, accessLayer.getElements(project, "RuleCatalog").size());
       
        Rule r3 = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, r3);
View Full Code Here

        Rule r2 = RuleModelFactory.eINSTANCE.createRule();
       
        accessLayer.addElement(project, r1);
        accessLayer.addElement(project, r2);
       
        RuleCatalog c1 = RuleModelFactory.eINSTANCE.createRuleCatalog();
       
        accessLayer.addElement(project, c1);
       
        c1.getRules().add(r1);
       
        assertEquals(1, c1.getRules().size());
        assertEquals(1, accessLayer.getElements(project, "RuleCatalog").size());
        assertEquals(2, accessLayer.getElements(project, "Rule").size());
        projectCleaner.cleanUpRuleOrphans(project);
        assertEquals(1, c1.getRules().size());
        assertEquals(2, accessLayer.getElements(project, "Rule").size());
        assertEquals(2, accessLayer.getElements(project, "RuleCatalog").size());
       
        accessLayer.removeElement(project, r2);
        assertEquals(1, accessLayer.getElements(project, "Rule").size());
View Full Code Here

      rule1LC.getBaseConditions().add(rule1BC1);
      rule1LC.getBaseConditions().add(rule1BC2);
      rule2LC.getBaseConditions().add(rule2BC1);
      rule2LC.getBaseConditions().add(rule2BC2);
     
      RuleCatalog impactRules = RuleModelFactory.eINSTANCE.createRuleCatalog();
     
      accessLayer.addElement(project, impactRules);
     
      impactRules.getRules().add(impactRule1);
      impactRules.getRules().add(impactRule2);
     
      List<EObject> startingImpactSet = new ArrayList<EObject>();
     
      startingImpactSet.add(changeType1);
      startingImpactSet.add(a1);
View Full Code Here

        for(int i = 0; i < catalogs.size(); i++)
            ruleCount +=  accessLayer.getAllChildren(catalogs.get(i)).size();
       
        if( ruleCount < rules.size() )
        {
            RuleCatalog orphans = null;
           
            for(int i = 0; i < rules.size(); i++)
            {
                boolean isOrphan = true;
               
                for(int j = 0; j < catalogs.size(); j++)
                {
                    if( accessLayer.getAllChildren(catalogs.get(j)).contains(rules.get(i)) )
                    {
                        isOrphan = false;
                        break;
                    }
                }
               
                if( isOrphan )
                {
                    if( orphans == null )
                    {
                        // search for an existing orphan catalog:
                        for(int j = 0; j < catalogs.size(); j++)
                        {
                            String name = ((RuleCatalog)catalogs.get(j)).getName();
                            if( name != null && name.contains("Orphans"))
                            {
                                orphans = (RuleCatalog)catalogs.get(j);
                                break;
                            }
                        }
                       
                        // create a new one, if none exists:
                        if( orphans == null )
                        {
                            orphans = RuleModelFactory.eINSTANCE.createRuleCatalog();
                            accessLayer.addElement(project, orphans);
                            orphans.setName("Orphans");
                        }
                    }
                   
                    orphans.getRules().add((Rule)rules.get(i));
                }
            }           
        }
       
        if( isLoggingEnabled ) printToLog("cleanUpRuleOrphans", "1. checked for rule-orphans");
View Full Code Here

          rule1LC.getBaseConditions().add(rule1BC1);
          rule1LC.getBaseConditions().add(rule1BC2);
          rule2LC.getBaseConditions().add(rule2BC1);
          rule2LC.getBaseConditions().add(rule2BC2);
         
          RuleCatalog impactRules = RuleModelFactory.eINSTANCE.createRuleCatalog();
         
          accessLayer.addElement(project, impactRules);
         
          impactRules.getRules().add(impactRule1);
          impactRules.getRules().add(impactRule2);
         
          List<EObject> startingImpactSet = new ArrayList<EObject>();
         
          startingImpactSet.add(changeType1);
          startingImpactSet.add(a1);
View Full Code Here

            Rule r2 = RuleModelFactory.eINSTANCE.createRule();
           
            accessLayer.addElement(project, r1);
            accessLayer.addElement(project, r2);
           
            RuleCatalog c1 = RuleModelFactory.eINSTANCE.createRuleCatalog();
           
            accessLayer.addElement(project, c1);
           
            c1.getRules().add(r1);
           
            assertEquals(1, c1.getRules().size());
            assertEquals(1, accessLayer.getElements(project, "RuleCatalog").size());
            assertEquals(2, accessLayer.getElements(project, "Rule").size());
            projectCleaner.cleanUpRuleOrphans(project);
            assertEquals(1, c1.getRules().size());
            assertEquals(2, accessLayer.getElements(project, "Rule").size());
            assertEquals(2, accessLayer.getElements(project, "RuleCatalog").size());
           
            Rule r3 = RuleModelFactory.eINSTANCE.createRule();
            accessLayer.addElement(project, r3);
View Full Code Here

            project.deleteElements(project.getContents());
           
            accessLayer.addElement(project, r1);
            accessLayer.addElement(project, r2);
           
            RuleCatalog c1 = RuleModelFactory.eINSTANCE.createRuleCatalog();
           
            accessLayer.addElement(project, c1);
           
            c1.getRules().add(r1);
           
            assertEquals(1, c1.getRules().size());
            assertEquals(1, accessLayer.getElements(project, "RuleCatalog").size());
            assertEquals(2, accessLayer.getElements(project, "Rule").size());
            projectCleaner.cleanUpRuleOrphans(project);
            assertEquals(1, c1.getRules().size());
            assertEquals(2, accessLayer.getElements(project, "Rule").size());
            assertEquals(2, accessLayer.getElements(project, "RuleCatalog").size());
           
            accessLayer.removeElement(project, r2);
            assertEquals(1, accessLayer.getElements(project, "Rule").size());
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.RuleModel.RuleCatalog

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.