Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Filter Classes(Filter classes)
Filter Classes [message #637359] Fri, 05 November 2010 08:35 Go to next message
olafo987  is currently offline olafo987 Friend
Messages: 13
Registered: November 2010
Junior Member
Sorry for my poor English.

Hi, I'm newbie with acceleo/ ocl and I need your help.
I have one model with several class, and with cross references, and I'm tried cross it.

I need to find only relations where the actual class is the init of relation no duplicates With the following code I had painted this relations:
[I][for (a : Association | c.getAssociations())] => []
[for (p : Property | a.memberEnd->asSet())]
[if not (]

And I get the following:
1er for : Contract => ContractCostumer
Costumer => MainteinanceContractRequestBeanContract
MainteinanceContractRequestBean => ContractContractedService
ContractedService => ModifyContractRequestBeanContract
ModifyContractRequestBean => MainteinanceContratServiceResultBeanContract
MainteinanceContratServiceResultBean => ContractCostumer

And basing on this I tried the following

[I][for (a : Association | c.getAssociations()->collect(a : Association |]
dentro del 2do for
[for (p : Property | a.memberEnd->asSet())]
[if not (]

but never paint "dentro del 2do for".

Re: Filter Classes [message #637584 is a reply to message #637359] Sun, 07 November 2010 11:19 Go to previous messageGo to next message
Sergio  is currently offline Sergio Friend
Messages: 21
Registered: August 2010
Location: Cardedeu
Junior Member
Hi olafo,

Maybe this could help you...

this is what I do to cross references in a class:

[for (a : Association | c.getAssociations() )] 
[if( not (>last().name)))]

what I'm trying to do here is:
1- get the all the associations of a class
2- filter the associations where my class is not the 'destination' class.
3- After that, I can do different things based on the type of the association

With this code it's possible to have repeated class name's, but only if the uml is not right.

Well, maybe there's another way to do that, but in my tests this was right. Smile

See you,

Sergio Sacristán
Re: Filter Classes [message #637650 is a reply to message #637359] Mon, 08 November 2010 08:42 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Olafo,

I must admit I don't really understand what you're trying to achieve. If Sergio's answer doesn't help, could you elaborate on what you have, what is the result you expect and what kind of information you have as a source for this particular need (part of your model)?

Laurent Goubet
Previous Topic:[Acceleo] UML 2 Java - Non basic types + Magicdraw
Next Topic:[acceleo] How do I Delete Obsolete Metamodels?
Goto Forum:

Current Time: Wed Feb 28 17:21:23 GMT 2024

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

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

Back to the top