|
|
|
Re: Assigning to a xs:any/EFeatureMapEntry with ATL [message #901183 is a reply to message #901013] |
Fri, 10 August 2012 04:45  |
Eclipse User |
|
|
|
Hi,
Ok I fixed this. The problem was that I needed to refer to W3schoolsPackage.Literals.DOCUMENT_ROOT__PERSON and not W3schoolsPackage.Literals.PERSON_TYPE__ANY. The former has type of PersonType while the latter is EFeatureMapEntry. This was causing the cast problems. Thanks for the great pointer Sylvain, this is a nice solution!
It might also be interesting for others to know that you can create another EAttribute off the DocumentRoot with a type of EObject. If I then use this in my EOperation I can assign any object to the any EFeatureMapEntry. For example I can now have a method like this...
public void addAny(EObject any) {
getAny().add(MyPackage.Literals.DOCUMENT_ROOT__ANY, any);
}
The ATL can now add any element by called .addAdd(XYZType.newInstance()) in a do block.
Regards,
Ronan
|
|
|
Powered by
FUDForum. Page generated in 0.03506 seconds