Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3] hasStereotype(acceleo 2 --> acceleo3)
[Acceleo 3] hasStereotype [message #554345] Sun, 22 August 2010 00:44 Go to next message
s2o  is currently offline s2o Friend
Messages: 4
Registered: August 2010
Junior Member
Hi,

I want to create a new module with acceleo3. And well, I did something with acceleo2, I know that with acceleo2 I can control the creation of files with something like:

<%script type="Class" name="fullFilePath"%>
<%if ( isService ){%><%pathToMainJava%>/<%serviceImplPackage.toPath()%>/<%name% >Impl.java<%}%>

<%script type="Classifier" name="isService"%>
<%hasStereotype(getProperty("Service"))%>

where hasStereotype is a java service...

How can I do something like this with acceleo3?
And, is there any module in acceleo 3 (not a simple module!)?

thank you very much!
s2o

[Updated on: Sun, 22 August 2010 00:47]

Report message to a moderator

Re: [Acceleo 3] hasStereotype [message #554384 is a reply to message #554345] Sun, 22 August 2010 18:22 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 8
Registered: August 2010
Junior Member
Hello s2o

I have writen the following query to check if an Element has an applied Stereotype

[query public hasStereotype(e : Element, stereo : String) : Boolean = (self.getAppliedStereotype(stereo) <> null)/]

the parameter stereo is the the qualifiedName of the Stereotype
hope this helps



Re: [Acceleo 3] hasStereotype [message #554395 is a reply to message #554384] Sun, 22 August 2010 19:43 Go to previous messageGo to next message
s2o  is currently offline s2o Friend
Messages: 4
Registered: August 2010
Junior Member
yes!!
at the same time I got the answer Smile
Another trick is that the string stereotype must have all the path:
ie, with Acceleo.Business.profile.uml for Service stereotype
the parameter of getAppliedStereotype must be:
'Acceleo::Business::Service'

anyway, thank you very much!!!
Re: [Acceleo 3] hasStereotype [message #554396 is a reply to message #554395] Sun, 22 August 2010 19:45 Go to previous message
s2o  is currently offline s2o Friend
Messages: 4
Registered: August 2010
Junior Member
oh yeah! the qualifiedName Wink
Previous Topic:[JET] Output not placed under src
Next Topic:[Xpand] Running Xpand from Java can't find Xtend generator extension file
Goto Forum:
  


Current Time: Fri Oct 04 15:06:51 GMT 2024

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

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

Back to the top