Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » different condition levels in filter of the rule
different condition levels in filter of the rule [message #1759001] Wed, 05 April 2017 07:35 Go to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 251
Registered: July 2016
Senior Member
Hi,

How can I select if an element oclIsTypeOf(...)? when I use asSequence(),... it has an error.
To Clarify, In the below code I want to transform "AssignmentStatement" which its lhs.oclIsTypeOf(MM_ETL!PropertyCallExpression) and then set another conditions that is related to "lhs.oclIsTypeOf(MM_ETL!PropertyCallExpression)", How can I do that?

from 
		b : MM_ETL!AssignmentStatement
		  ( OUT_MM!EClass.allInstancesFrom('IN3') -> ...  ->select(t|t.name.name=[color=red]b.lhs.target.name[/color])->....


if I don't put the condition that I explain above, the selected code has an error.
Re: different condition levels in filter of the rule [message #1759131 is a reply to message #1759001] Thu, 06 April 2017 17:41 Go to previous messageGo to next message
louis andia. is currently offline louis andia.Friend
Messages: 45
Registered: November 2016
Member
Hi,

Maybe you should check before if lhs is defined nor is type of what you want?

from 
		b : MM_ETL!AssignmentStatement
		  (  if b.lhs.oclIsTypeOf(MM_ETL!PropertyCallExpression) 
then OUT_MM!EClass.allInstancesFrom('IN3') -> ...  ->select(t|t.name.name=[color=red]b.lhs.target.name[/color])->....
else false endif


or if the problem is in your ocl expression, add some select (like ->select(t|t.oclIsTypeOf(MM_ETL!PropertyCallExpression)) ) before your select where you have a truble.
Re: different condition levels in filter of the rule [message #1759138 is a reply to message #1759131] Thu, 06 April 2017 19:56 Go to previous message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 251
Registered: July 2016
Senior Member
Many thanks for your kind help
Previous Topic:code optimization
Next Topic:customized output file
Goto Forum:
  


Current Time: Tue Sep 26 20:13:21 GMT 2017

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

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