Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Lazy Rule Filter Not Working
[ATL] Lazy Rule Filter Not Working [message #93452] Tue, 28 October 2008 15:08 Go to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Hi,
I have a problem with lazy rules. I am calling a lazy rule on a collection
of UML2!Class that i selected in a collection of packageableElements
(package.packagedElement collection). In the lazy rule i defined a filter
that will limit the application of the rule to the abstract classes that
are public. I wrote the following code:

...--in the managed rule i call myPublicAbstractClasses this way:
publicAbstractClasses <- s.packagedElement->select(h |
h.oclIsTypeOf(UML2!Class)) ->collect(e |
thisModule.myPublicAbstractClasses(e))

--the lazy rule:
lazy rule myPublicAbstractClasses {
from s : UML2!Class (s.isAbstract=true and s.visibility=#public)
to t : MM!PublicAbstractClass (
name <- s.name
)}

The problem is that the filter is not working, i get all the classes
inside the target property 'publicAbstractClasses'. Did i do something
wrong?!!
Re: [ATL] Lazy Rule Filter Not Working [message #93468 is a reply to message #93452] Tue, 28 October 2008 15:54 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090309080109060301060307
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

Could you open a Bugzilla entry to report this problem
(https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2M)?
Thanks in advance.

Regards,
Freddy.

Skander a
Re: [ATL] Lazy Rule Filter Not Working [message #93482 is a reply to message #93452] Tue, 28 October 2008 16:02 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
I found this solution, but what i would like to do is to have a lazy rule
that accepts parameters otherwise i will have hundreds of lines of
filtering in my manages rule:

--manages rule:
publicAbstractClasses <- s.packagedElement->select(h |
h.oclIsTypeOf(UML2!Class))
->select(z | z.isAbstract=true and z.visibility=#public )
->collect(e | thisModule.myClasses(e))

--lazy rule:
lazy rule myClasses {
from s : UML2!Class
to t : MM!Class (
name <- s.name
)}


I would like to write something like:

publicAbstractClasses <- s.packagedElement->collect(e |
thisModule.LazyRuleCall(params)) --params can be ('abstract','public') or
('abstract','private') and so on

Is there a solution?

Skander wrote:

> Hi,
> I have a problem with lazy rules. I am calling a lazy rule on a collection
> of UML2!Class that i selected in a collection of packageableElements
> (package.packagedElement collection). In the lazy rule i defined a filter
> that will limit the application of the rule to the abstract classes that
> are public. I wrote the following code:

> ...--in the managed rule i call myPublicAbstractClasses this way:
> publicAbstractClasses <- s.packagedElement->select(h |
> h.oclIsTypeOf(UML2!Class)) ->collect(e |
> thisModule.myPublicAbstractClasses(e))

> --the lazy rule:
> lazy rule myPublicAbstractClasses {
> from s : UML2!Class (s.isAbstract=true and s.visibility=#public)
> to t : MM!PublicAbstractClass (
> name <- s.name
> )}

> The problem is that the filter is not working, i get all the classes
> inside the target property 'publicAbstractClasses'. Did i do something
> wrong?!!
Re: [ATL] Lazy Rule Filter Not Working [message #93495 is a reply to message #93468] Tue, 28 October 2008 16:17 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Freddy Allilaire wrote:

> Hi,

> Could you open a Bugzilla entry to report this problem
> (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2M)?
> Thanks in advance.

> Regards,
> Freddy.

hi freddy,
i added the bug entry under this reference: Bug 252414
Re: [ATL] Lazy Rule Filter Not Working [message #93509 is a reply to message #93495] Tue, 28 October 2008 16:20 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000204000604070603040109
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Skander a
Re: [ATL] Lazy Rule Filter Not Working [message #493786 is a reply to message #93509] Wed, 28 October 2009 01:11 Go to previous message
Nuno Correia is currently offline Nuno CorreiaFriend
Messages: 2
Registered: October 2009
Junior Member
I would like to know if this bug has had any development, since I'm getting the same behavior with ATL 3 in the latest Eclipse version.

BR,
Nuno
Previous Topic:Transforming a transformation script
Next Topic:[ATL] ArrayStoreException when ->collect()ing the result of a lazy rule returning several element
Goto Forum:
  


Current Time: Fri Apr 26 21:21:17 GMT 2024

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

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

Back to the top