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 40 public class CategoryKind extends CompositeXmlAction { 41 42 45 public CategoryKind() { 46 isSrcPropertyRequired = false; 49 isDstPropertyRequired = false; 50 action = new TransformAction(); 51 } 52 53 56 class TransformAction extends ActionBase { 57 62 public Object execute(Object bean, RuleContext request) throws TransformationException { 63 CCMASTModelContext context; 64 context = (CCMASTModelContext) request.engineContext.getModel("ccm-ast"); 65 Object obj = request.getAttribute("declaration"); 66 org.objectweb.openccm.ast.api.CompositionDecl composition; 67 composition = (org.objectweb.openccm.ast.api.CompositionDecl) obj; 68 String category = (String )bean; 69 if (category.equalsIgnoreCase("entity")) 70 composition.setCategoryKind(org.objectweb.openccm.ast.api.CategoryKind.ck_entity); 71 else if (category.equalsIgnoreCase("process")) 72 composition.setCategoryKind(org.objectweb.openccm.ast.api.CategoryKind.ck_process); 73 else if (category.equalsIgnoreCase("service")) 74 composition.setCategoryKind(org.objectweb.openccm.ast.api.CategoryKind.ck_service); 75 else 76 composition.setCategoryKind(org.objectweb.openccm.ast.api.CategoryKind.ck_session); 77 return composition; 79 } 80 81 } } 83 | Popular Tags |