1 28 29 package org.objectweb.openccm.uml.transformation.ast; 30 31 import ispuml.mdaTransformation.RuleContext; 32 import ispuml.mdaTransformation.TransformationException; 33 import ispuml.mdaTransformation.ActionBase; 34 import ispuml.mdaTransformation.rules.xml.CompositeXmlAction; 35 36 37 42 public class PrimaryKeyInheritance extends CompositeXmlAction { 43 44 47 public PrimaryKeyInheritance() { 48 isSrcPropertyRequired = false; 51 isDstPropertyRequired = false; 52 action = new TransformAction(); 53 } 54 55 58 class TransformAction extends ActionBase { 59 64 public Object execute(Object bean, RuleContext request) throws TransformationException { 65 CCMASTModelContext context; 66 context = (CCMASTModelContext) request.engineContext.getModel("ccm-ast"); 67 org.objectweb.openccm.ast.api.ValueDecl value = (org.objectweb.openccm.ast.api.ValueDecl) request.getAttribute("declaration"); 68 String pkBaseId = "IDL:omg.org/Components/PrimaryKeyBase:1.0"; 69 org.objectweb.openccm.ast.api.ValueDecl pkBase = (org.objectweb.openccm.ast.api.ValueDecl) CCMASTModelCreateUtils.getAst().lookupId(pkBaseId); 70 value.getAbstractValueList().add(pkBase); 71 72 return null; 73 } 74 75 76 77 } } 79 | Popular Tags |