Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL debug, how to use debug/output to print special var values
ATL debug, how to use debug/output to print special var values [message #535262] Fri, 21 May 2010 18:41 Go to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hello

I tried debug but usually it seems to be complex and many values appear while it is not important

I want to print the specified value to the console, how can I do this with ATL

[Updated on: Wed, 26 May 2010 21:24]

Report message to a moderator

Re: ATL debug, how to use println() to print special var values [message #536073 is a reply to message #535262] Wed, 26 May 2010 21:23 Go to previous messageGo to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hello every body

can some one tell us how to use the output and debug operation in ATL as the tutorial describe

Quote:


# output(s : String) writes the string s to the Eclipse console. Since the operation has no return value, it shall only be used in ATL imperative blocks;
# debug(s : String) returns the self value and writes the "s : self_value" string to the eclipse console;




please I need some verification and printing

wafaa
Re: ATL debug, how to use println() to print special var values [message #537193 is a reply to message #536073] Tue, 01 June 2010 15:08 Go to previous messageGo to next message
wafaa is currently offline wafaaFriend
Messages: 163
Registered: January 2010
Location: Egypt
Senior Member
hi all
i have seen this example and when tried similar did not work
any comment

rule Entity {
from s : UML2!Class(
s.isStereotypeApplied( 'qme::pim::persistence::Entity' ))
to t : UML2!Class (
ownedAttribute <- s.ownedAttribute )
do{
t.applyStereotype( t.getApplicableStereotype( 'EJB3::Entity' ) );
t.setValue( t.getAppliedStereotype( 'EJB3::Entity' ) ,
'tableName', thisModule.ejbConf(t).table );
s.name.println('Entityname: ');
for(field in s.ownedAttribute) {
field.name.debug(' Fieldname: ');
field.type.debug(' Fieldtype: ');
}
}
}
Re: ATL debug, how to use println() to print special var values [message #537204 is a reply to message #537193] Tue, 01 June 2010 15:17 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
wafaa wrote on Tue, 01 June 2010 11:08
hi all
i have seen this example and when tried similar did not work
any comment

rule Entity {
from s : UML2!Class(
s.isStereotypeApplied( 'qme::pim::persistence::Entity' ))
to t : UML2!Class (
ownedAttribute <- s.ownedAttribute )
do{
t.applyStereotype( t.getApplicableStereotype( 'EJB3::Entity' ) );
t.setValue( t.getAppliedStereotype( 'EJB3::Entity' ) ,
'tableName', thisModule.ejbConf(t).table );
s.name.println('Entityname: ');
for(field in s.ownedAttribute) {
field.name.debug(' Fieldname: ');
field.type.debug(' Fieldtype: ');
}
}
}

There might be a bug with the pile. In order to "consume" the debug elements, you can declare a fake consumer in the using section :
using{
fakeConsumer : OclAny = OclUndefined;
}

and then use it in the do section :
fakeConsumer <- field.name.debug('Fieldname: ');
Previous Topic:[QVTO] load metamodel programmatically
Next Topic:[ATL] setting __xmiID__ values doesn't work?
Goto Forum:
  


Current Time: Thu Apr 22 15:22:01 GMT 2021

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

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

Back to the top