Package org.emftrace.metamodel.RuleModel

Examples of org.emftrace.metamodel.RuleModel.ElementDefinition


            result.get(1).add(c2);
                   
            Rule rule = RuleModelFactory.eINSTANCE.createRule();
            accessLayer.addElement(project, rule);
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e2);
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
           
            e1.setAlias("number_1");
            e2.setAlias("number_2");
           
            BaseCondition baseCondition1 = RuleModelFactory.eINSTANCE.createBaseCondition();
            BaseCondition baseCondition2 = RuleModelFactory.eINSTANCE.createBaseCondition();
            LogicCondition logicCondition = RuleModelFactory.eINSTANCE.createLogicCondition();
            accessLayer.addElement(project, baseCondition1);
View Full Code Here


          Rule impactRule2 = RuleModelFactory.eINSTANCE.createRule();
         
          accessLayer.addElement(project, impactRule1);
          accessLayer.addElement(project, impactRule2);
         
          ElementDefinition rule1ED1 = RuleModelFactory.eINSTANCE.createElementDefinition();
          ElementDefinition rule1ED2 = RuleModelFactory.eINSTANCE.createElementDefinition();
          ElementDefinition rule1ED3 = RuleModelFactory.eINSTANCE.createElementDefinition();
          ElementDefinition rule2ED1 = RuleModelFactory.eINSTANCE.createElementDefinition();
          ElementDefinition rule2ED2 = RuleModelFactory.eINSTANCE.createElementDefinition();
          ElementDefinition rule2ED3 = RuleModelFactory.eINSTANCE.createElementDefinition();
         
          accessLayer.addElement(project, rule1ED1);
          accessLayer.addElement(project, rule1ED2);
          accessLayer.addElement(project, rule1ED3);
          accessLayer.addElement(project, rule2ED1);
          accessLayer.addElement(project, rule2ED2);
          accessLayer.addElement(project, rule2ED3);
         
          rule1ED1.setType("Concern");
          rule1ED1.setAlias("e1");
          rule1ED2.setType("Concern");
          rule1ED2.setAlias("e2");
          rule1ED3.setType("AtomicChangeType");
          rule1ED3.setAlias("e3");
         
          rule2ED1.setType("Concern");
          rule2ED1.setAlias("e1");
          rule2ED2.setType("Concern");
          rule2ED2.setAlias("e2");
          rule2ED3.setType("AtomicChangeType");
          rule2ED3.setAlias("e3");
         
          impactRule1.getElements().add(rule1ED1);
          impactRule1.getElements().add(rule1ED2);
          impactRule1.getElements().add(rule1ED3);
         
View Full Code Here

            rule.setConditions(cnd1);
            cnd1.getBaseConditions().add(cnd2);
            cnd2.setSource("e1::Id");
            cnd2.setTarget("e2::Id");
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e1.setType("Concern");
            e2.setType("Actor");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
           
            LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

            bc2.setValue("test");
           
            bc3.setSource("e1::name");
            bc3.setValue("test2");
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e1.setType("Concern");
            e2.setType("Concern");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
           
            LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

            action.setSourceElement("e1");
            action.setTargetElement("e2");
            action.setResultType("Test");
            action.setActionType(ActionType.CREATE_LINK);
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e1.setType("Concern");
            e2.setType("Concern");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
            rule.setRuleID("TestRule");
           
View Full Code Here

            action.setSourceElement("e1");
            action.setImpactedElement("e2");
            action.setResultType("Test");
            action.setActionType(ActionType.REPORT_IMPACT);
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e3 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            accessLayer.addElement(project, e3);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e3.setAlias("e3");
            e1.setType("Concern");
            e2.setType("Concern");
            e3.setType("AtomicChangeType");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
            rule.getElements().add(e3);
            rule.setRuleID("TestRule");
View Full Code Here

            rule.setConditions(cnd1);
            cnd1.getBaseConditions().add(cnd2);
            cnd2.setSource("Test");
            cnd2.setTarget("Test");
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e1.setType("Concern");
            e2.setType("Concern");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
            rule.setRuleID("TestRule");
           
View Full Code Here

    }
   
    // check of the change type matches the one defined in the rule:
    for(int i = 0; i < rule.getElements().size(); i++)
    {
      ElementDefinition element = rule.getElements().get(i);
     
      if( element.getType().equalsIgnoreCase("AtomicChangeType") || element.getType().equalsIgnoreCase("CompositeChangeType") )
      {         
        String alias = element.getAlias() + "::name";
        String name  = ((AbstractChangeType) startingImpactSet.get(0)).getName();
               
        List<EObject> conditions = accessLayer.getAllChildren(rule.getConditions());
       
        for(int j = 0; j < conditions.size(); j++)
View Full Code Here

    }

    @Test
    public void testCheckElementDefinition()
    {
        ElementDefinition elemDef = RuleModelFactory.eINSTANCE.createElementDefinition();
        List<String> elements = new ArrayList<String>();
       
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        elemDef.setAlias("");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setAlias("e1");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setType("");
        assertFalse(ruleValidator.checkElementDefinition(elemDef, elements));
        assertTrue(elements.isEmpty());
        elemDef.setType("Concern");
        assertTrue(ruleValidator.checkElementDefinition(elemDef, elements));
        assertFalse(elements.isEmpty());
    }
View Full Code Here

            rule.setConditions(cnd1);
            cnd1.getBaseConditions().add(cnd2);
            cnd2.setSource("e1::creator");
            cnd2.setTarget("e2::creator");
           
            ElementDefinition e1 = RuleModelFactory.eINSTANCE.createElementDefinition();
            ElementDefinition e2 = RuleModelFactory.eINSTANCE.createElementDefinition();
            accessLayer.addElement(project, e1);
            accessLayer.addElement(project, e2);
            e1.setAlias("e1");
            e2.setAlias("e2");
            e1.setType("Concern");
            e2.setType("Actor");
           
            rule.getElements().add(e1);
            rule.getElements().add(e2);
           
            LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
View Full Code Here

TOP

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

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.