Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » common understand, let blocks([ACCELEO 3] wheres the difference? help please)
common understand, let blocks [message #689674] Tue, 28 June 2011 06:53 Go to next message
Norman  is currently offline Norman Friend
Messages: 17
Registered: June 2011
Junior Member
Hi,

I switched to Acceleo 3.

Why that doesn't work?

[template public next (node : ActivityNode) post (trim())]
[let TargetString : String = node.outgoing.target][TargetString/][/let]

But this does:

[template public next (node : ActivityNode) post (trim())]
[let TargetString : String = node][TargetString/][/let]

I don't understand this, the Node has a following Node.

Thanks and bb
Re: common understand, let blocks [message #689881 is a reply to message #689674] Tue, 28 June 2011 14:36 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

In Acceleo, the "let x : Type = something" block is strickly equals to "if (something instanceof Type) {Type x = (Type)something;". SO in your case, "node.outgoing.target" is not an instance of TargetString. I believe that outgoint or target is null. You can test it with something like this:

[template public next (node : ActivityNode) post (trim())]
node.outgoing = null: [node.oclIsUndefined()/]
node.outgoing = null: [node.outgoing.oclIsUndefined()/]
node.outgoing.target = null: [node.outgoing.targetoclIsUndefined()/]
[/template]


You could also use the Acceleo debugger with a well placed breakpoint to examine the state of the variables.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: common understand, let blocks [message #690261 is a reply to message #689881] Wed, 29 June 2011 09:39 Go to previous message
Norman  is currently offline Norman Friend
Messages: 17
Registered: June 2011
Junior Member
Thanks i understand
Previous Topic:[JET2] Indigo Release
Next Topic:[ACCELEO 3] Protected Areas lost
Goto Forum:
  


Current Time: Thu Apr 25 18:14:48 GMT 2024

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

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

Back to the top