Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Problem with transformation UML to text with Atl query
Problem with transformation UML to text with Atl query [message #545863] Fri, 09 July 2010 13:21 Go to next message
No real name is currently offline No real nameFriend
Messages: 4
Registered: April 2010
Junior Member
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|e.name = 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=
self.name;

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.
Re: Problem with transformation UML to text with Atl query [message #545873 is a reply to message #545863] Fri, 09 July 2010 13:43 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050300070004060903020404
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

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

osvaldos88@yahoo.it 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|e.name = 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=
> self.name;
>
> 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.


--------------050300070004060903020404
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------050300070004060903020404--
Previous Topic:Xtend java extensions with primitive type parameters
Next Topic:[Xtend] Criterion for element equality in Xtend sets?
Goto Forum:
  


Current Time: Tue Apr 16 04:42:43 GMT 2024

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

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

Back to the top