Examples of ActionDefinition


Examples of org.dmd.dms.ActionDefinition

    }
   
    Iterator<ActionDefinition> actions = schema.getActionDefList();
    if (actions != null){
      while(actions.hasNext()){
        ActionDefinition ad = actions.next();
        sb.append("    public static ActionDefinition _" + ad.getName() + ";\n");
        allVars.add(new VarToObject("_" + ad.getName(), ad, "ActionDefinition"));
        actionVars.add(new VarToObject("_" + ad.getName(), ad, "ActionDefinition"));
      }
      sb.append("\n");
      allVars.add(new VarToObject("", null,null));
    }
   
View Full Code Here

Examples of org.dmd.dms.ActionDefinition

//        else if (wrapper instanceof RuleDefinition){
//          RuleDefinition rd = (RuleDefinition) wrapper;
//          rules.put(rd.getName(), rd);
//        }
        else if (wrapper instanceof ActionDefinition){
          ActionDefinition actd = (ActionDefinition) wrapper;
          actions.put(actd.getName(), actd);
        }
      }
           
      out.write(formatUsage(classes,rules,actions));
     
View Full Code Here

Examples of org.dmd.dms.ActionDefinition

    StringBuffer sb = new StringBuffer();
   
    Iterator<ActionDefinition> actions = cd.getActions();
    if (actions != null){
      while(actions.hasNext()){
        ActionDefinition ad = actions.next();
        String capped = GenUtility.capTheName(ad.getName().getNameString());
        sb.append("\n");
        sb.append("    /**\n");
        sb.append("     * Returns the parameter container for the " + ad.getName() + " action.\n");
        sb.append("     */\n");
        sb.append("    // " + DebugInfo.getWhereWeAreNow() + "\n");
        sb.append("    static public " + capped + "ATI get" + capped + "ATI(){\n");
        sb.append("        return(new " + capped + "ATI());\n");
        sb.append("    }\n");
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

        result.get(1).add(c2);
       
        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
       
        ActionDefinition action = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, action);
       
        rule.getActions().add(action);       
       
        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);
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

        tuples.get(0)[2] = type;

        Rule rule = RuleModelFactory.eINSTANCE.createRule();
        accessLayer.addElement(project, rule);
       
        ActionDefinition action = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, action);
       
        rule.getActions().add(action);       
       
        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);
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
        a1.setResultType("Test");
        a1.setActionType(ActionType.CREATE_LINK);
       
        BaseCondition baseCondition = RuleModelFactory.eINSTANCE.createBaseCondition();
        baseCondition.setSource("e1");
        baseCondition.setTarget("e2");
               
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
        a1.setResultType("Test");
        a1.setActionType(ActionType.CREATE_LINK);
       
        rule.getActions().add(a1);
       
        assertEquals(0, accessLayer.getElements(project, "TraceLink").size());
        ruleEngine.applyRule(null, null, rule);
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

       
        LinkType l2 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l2);
        l2.setName("TestRelation");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
        a1.setResultType("Test");
        a1.setActionType(ActionType.CREATE_LINK);
       
        rule.getActions().add(a1);
       
        /*
         * case 1:
         *
         * <and>
         *     e1.name = e2.name
         *      <not>
         *         e1.name = "test"
         *      </not>
         * </and>
         */
       
         lc2.getBaseConditions().add(bc2);
        
         assertEquals(0, accessLayer.getElements(project, "TraceLink").size());       
         ruleEngine.applyRule(project, null, rule);
         assertEquals(1, accessLayer.getElements(project, "TraceLink").size());
       
        /*
         * case 2:
         *
         * <and>
         *     e1.name = e2.name
         *      <not>
         *        <and>
         *             e1.name = "test"
         *              e1.name = "test2"
         *          </and>
         *      </not>
         * </and>
         */
       
         a1.setResultType("TestRelation");
         lc2.getBaseConditions().clear();
         lc2.getLogicConditions().add(lc3);
         lc3.getBaseConditions().add(bc2);
         lc3.getBaseConditions().add(bc3);
        
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

    }
   
    @Test
    public void testCheckActionDefinition()
    {
        ActionDefinition actionDef = RuleModelFactory.eINSTANCE.createActionDefinition();
        actionDef.setActionType(ActionType.CREATE_LINK);
        List<String> elements = new ArrayList<String>();
        elements.add("e1");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        actionDef.setSourceElement("e2");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        actionDef.setSourceElement("e1");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        actionDef.setTargetElement("e2");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        elements.add("e2");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        actionDef.setResultType("test");
        assertFalse(ruleValidator.checkActionDefinition(project, actionDef, elements));
        LinkType linkType = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, linkType);
        linkType.setName("test");
        assertTrue(ruleValidator.checkActionDefinition(project, actionDef, elements));
View Full Code Here

Examples of org.emftrace.metamodel.RuleModel.ActionDefinition

       
        LinkType l1 = LinkModelFactory.eINSTANCE.createLinkType();
        accessLayer.addElement(project, l1);
        l1.setName("Test");
       
        ActionDefinition a1 = RuleModelFactory.eINSTANCE.createActionDefinition();
        accessLayer.addElement(project, a1);
        a1.setSourceElement("e1");
        a1.setTargetElement("e2");
        a1.setResultType("Test");
        a1.setActionType(ActionType.CREATE_LINK);
       
        rule.getActions().add(a1);
       
        assertTrue(ruleValidator.validateRule(project, rule));
        a1.setSourceElement("42");
        assertFalse(ruleValidator.validateRule(project, rule));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.