Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Re: Problem with transformation UML to text with Atl query
Re: Problem with transformation UML to text with Atl query [message #545872] Fri, 09 July 2010 13:43
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit


Some disambiguation is in order here ...
ATL is an m2m (model to model) technology, not m2t (model to text).
This is the m2t newsgroup, yet your whole post consist of ATL code. What
exactly do you intend on doing?

If you really wish to generate text from models, you should use Acceleo,
XPand, JET, or any other dedicated tool (Acceleo uses OCL too as its
navigation language if its OCL that drew you to ATL). Twisting m2m tools
for this use is somewhat difficult to understand :).

If you need for some reason to use ATL, please use the m2m newsgroup
when asking questions (I've added it to the cc: list of this answer)

Laurent Goubet
Obeo wrote:
> This is the query I'm running:
> query UML2TEXT =
> let filename: String = 'VirtualboxUML.txt' in
> let network: Sequence(UML!Class) =
> UML!Class.allInstances()->asSequence() in
> let filtrati: Sequence(UML!Class) =
> network->select(x|x.hasStereotype('Network')) in
> let Local: Sequence(UML!Class) = filtrati>select(x|not
> x.hasStereotype('Internet')) in
> (
> filtrati->collect(x | x.print())->sum()
> ).writeTo(filename);
> uses UML2TXTLib;
> and this is the library:
> library UML2TXTLib;
> helper context UML!Class def: hasStereotype(stereotype : String) :
> Boolean =
> self.getAppliedStereotypes()->exists(e| = stereotype);
> helper context UML!Class def: getTagValue(stereotype : String, tag :
> String) : String=
> self.getValue(self.getAppliedStereotype(stereotype),tag);
> helper context UML!Class def: print() : String=
> When I start the execution of the transformation it gives me this error:
> org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found:
> OclUndefined.writeTo(java.lang.String)
> at main(UML2TEXT.atl[6:2-8:21])
> local variables: self=thisModule, filename='VirtualboxUML.txt',
> network=Sequence {IN!Terminal A:UML!Class, IN!Local 1:UML!Class,
> IN!Router 1:UML!Class, IN!Internet:UML!Class, IN!Router 2:UML!Class,
> IN!Local 2:UML!Class, IN!Terminal B:UML!Class, IN!Terminal C:UML!Class},
> filtrati=Sequence {}, Local=Sequence {}
> I don't really know what's wrong. The UML Model is correct, so I
> realized that the problem is in the query.

Content-Type: text/x-vcard; charset=utf-8;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
Previous Topic: [ATL] Run ATL
Next Topic:[ATL] Some general questions
Goto Forum:

Current Time: Tue Apr 20 11:40:36 GMT 2021

Powered by FUDForum. Page generated in 0.02089 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top