[JET] Unable to retrieve stereotype list of a UML element in an XPath function [message #759083] |
Sat, 26 November 2011 02:05 |
Pavan V Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Hello there,
I've written a JET template that needs to iterate over certain UML elements (with specific stereotypes). For the stereotype check, I've added an XPath function with the body -
public Object evaluate(List args) {
NodeSet nodeSet = (NodeSet)args.get(0);
Namespace source = (Namespace)nodeSet.iterator().next();
String stereotypeName = (String)args.get(1);
List<Action> actions = new ArrayList<Action>();
Iterator<NamedElement> iter = source.getOwnedMembers().iterator();
while(iter.hasNext()){
NamedElement child = iter.next();
if(child instanceof Action && (namedEle.getAppliedStereotype(stereotypeName) != null)){
actions.add((Action) child);
}
}
return actions;
}
Although I see that my input model has the profiles and the stereotypes in place, the call namedEle.getAppliedStereotypes() always returns an empty list
Any pointers on what I may be doing wrong here ?
|
|
|
Powered by
FUDForum. Page generated in 0.01407 seconds