Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Set stereotype tagged value
[ATL] Set stereotype tagged value [message #85473] Tue, 01 July 2008 08:19 Go to next message
Eclipse UserFriend
Originally posted by: amivi.fagbegnon.gmail.com

Hello,

I have problems to set tagged value of a stereotype. The stereotype is set
in a do action just before de setValue instruction like this:
do{
out.applyStereotype(ster);
out.setValue(ster,'tagged value name',p.name);
}
out is an property.
I do a test to know if the stereotype is applied by displaying stereotypes
applied with the method getAppliedSterotypes() and I get an empty
Sequence.

If anyone had the same problem and solved it, it will be kind to explain
me how to proceed.

Thanks
Re: [ATL] Set stereotype tagged value [message #85518 is a reply to message #85473] Tue, 01 July 2008 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hi Amivi,

Amivi FAGBEGNON a écrit :
> Hello,
>
> I have problems to set tagged value of a stereotype. The stereotype is
> set in a do action just before de setValue instruction like this:
> do{
> out.applyStereotype(ster);
> out.setValue(ster,'tagged value name',p.name);
> }
> out is an property.
> I do a test to know if the stereotype is applied by displaying
> stereotypes applied with the method getAppliedSterotypes() and I get an
> empty Sequence.
>
> If anyone had the same problem and solved it, it will be kind to explain
> me how to proceed.

You can find from
http://www.eclipse.org/gmt/modisco/useCases/PerformanceAnnot atedUmlStateCharts/
a complete example on how to apply stereotypes on a UML model with ATL.

Look more particularly at the
"UMLStateChart2PerformanceAnnotatedUMLStateChart.atl" transformation.

Best regards,

Hugo

>
> Thanks
>


--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] Set stereotype tagged value [message #85533 is a reply to message #85518] Tue, 01 July 2008 11:49 Go to previous messageGo to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
There are many questions about
* how to apply stereotypes and profiles
* how to get to know if a certain stereotype is applied
* how to access/set tagged values
on this newsgroup. Maybe someone should write a tutorial on how to work
with UML-profiles in ATL and put it in the wiki, or at least add a link to
a page with an overview over the relevant API-functions.

Greetings,
Max
Re: [ATL] Set stereotype tagged value [message #85630 is a reply to message #85518] Wed, 02 July 2008 07:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amivi.fagbegnon.gmail.com

Hi,

Thanks for your help Hugo.
I have seen your example but this doesn't help me a lot. I proceed like in
UMLStateChart2PerformanceAnnotatedUMLStateChart.atl but I still have
errors.I don't understand why. I check the profile and the stereotype
extends Property and has the tagged value that I want to set...

You can find below the errors I get.

Best regards,

Amivi

Saving model CAmodelCouche
[am3.saveModel] GRAVE: ****** BEGIN Stack Trace
[am3.saveModel] GRAVE: message: ERROR: exception during invocation of
operation setValue on UML2!Property (java method: public void
org.eclipse.uml2.uml.internal.impl.ElementImpl.setValue(org. eclipse.uml2.uml.Stereotype,java.lang.String,java.lang.Objec t))
[am3.saveModel] GRAVE: exception:
[am3.saveModel] GRAVE: dateSuspension
[am3.saveModel] java.lang.IllegalArgumentException: dateSuspension
[am3.saveModel] at
org.eclipse.uml2.uml.internal.operations.ElementOperations.s etValue(ElementOperations.java:754)
[am3.saveModel] at
org.eclipse.uml2.uml.internal.impl.ElementImpl.setValue(Elem entImpl.java:306)
[am3.saveModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.saveModel] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[am3.saveModel] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[am3.saveModel] at java.lang.reflect.Method.invoke(Method.java:585)
[am3.saveModel] at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:630)
[am3.saveModel] at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel.applyDelaye dInvocations(ASMUMLModel.java:568)
[am3.saveModel] at
org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:61)
[am3.saveModel] at
org.eclipse.m2m.atl.drivers.uml24atl.AtlUML2ModelHandler.sav eModel(AtlUML2ModelHandler.java:49)
[am3.saveModel] at
org.eclipse.gmt.am3.tools.ant.tasks.SaveModelTask.execute(Sa veModelTask.java:47)
[am3.saveModel] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
[am3.saveModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.saveModel] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[am3.saveModel] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[am3.saveModel] at java.lang.reflect.Method.invoke(Method.java:585)
[am3.saveModel] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
[am3.saveModel] at org.apache.tools.ant.Task.perform(Task.java:348)
[am3.saveModel] at org.apache.tools.ant.Target.execute(Target.java:357)
[am3.saveModel] at
org.apache.tools.ant.Target.performTasks(Target.java:385)
[am3.saveModel] at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
[am3.saveModel] at
org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
[am3.saveModel] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
[am3.saveModel] at
org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
[am3.saveModel] at
org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
[am3.saveModel] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:623)
[am3.saveModel] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:456)
[am3.saveModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.saveModel] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
[am3.saveModel] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
[am3.saveModel] at java.lang.reflect.Method.invoke(Method.java:585)
[am3.saveModel] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:377)
[am3.saveModel] at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
[am3.saveModel] at java.lang.Thread.run(Thread.java:595)
[am3.saveModel] GRAVE: ****** END Stack Trace
[am3.saveModel] INFO: Execution terminated due to error (see launch
configuration to allow continuation after errors).
Re: [ATL] Set stereotype tagged value [message #85655 is a reply to message #85630] Wed, 02 July 2008 08:34 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
Have you applied the profile ?

greetings, urs.
Re: [ATL] Set stereotype tagged value [message #85670 is a reply to message #85533] Wed, 02 July 2008 08:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hi Max,

Max Bureck a écrit :
> There are many questions about
> * how to apply stereotypes and profiles
> * how to get to know if a certain stereotype is applied
> * how to access/set tagged values
> on this newsgroup. Maybe someone should write a tutorial on how to work
> with UML-profiles in ATL and put it in the wiki, or at least add a link
> to a page with an overview over the relevant API-functions.
>

You're right Max, this is really something that should be done.
This may be integrated within a future extended ATL user documentation
(through the Wiki for instance).

Best regards,

Hugo

> Greetings,
> Max
>


--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] Set stereotype tagged value [message #85726 is a reply to message #85655] Wed, 02 July 2008 09:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amivi.fagbegnon.gmail.com

Yes I apply the profile to the model. I've already used the profile
somewhere else.
The application of the stereotype works it is the setValue the problem.
It's seems that I can't access the tagged value of the stereotype just
after its applying...
Re: [ATL] Set stereotype tagged value [message #85741 is a reply to message #85726] Wed, 02 July 2008 09:42 Go to previous messageGo to next message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
Amivi FAGBEGNON schrieb:
> Yes I apply the profile to the model. I've already used the profile
> somewhere else.
> The application of the stereotype works it is the setValue the problem.
> It's seems that I can't access the tagged value of the stereotype just
> after its applying...
>
No you can't, the UML Handler will apply the stereotypes
afterwards(after the transformation is complete done). So you will never
see any of the current applied stereotypes.
But applying and setting should be no problem.

..
..
..
from invar : UML2!"uml::Property" (thisModule.PropertyGuard(invar))
to Propertyvar : UML2!Property
..
..
..
do {

Propertyvar.applyStereotype(thisModule.columnStereotype);

Propertyvar.setValue(thisModule.columnStereotype,'type',
thisModule.toColumnType(invar.type) );
Propertyvar.setValue(thisModule.columnStereotype,'name',
Propertyvar.name.toLower() );
Propertyvar.setValue(thisModule.columnStereotype,'notNull', true );
}




greetings, urs.
Re: [ATL] Set stereotype tagged value [message #85816 is a reply to message #85741] Thu, 03 July 2008 08:09 Go to previous message
Eclipse UserFriend
Originally posted by: amivi.fagbegnon.gmail.com

I resolve my problem...
It was'nt ATL the problem but TopCased my UML modeler. The synchronisation
of the UML model and the ecore generated don't work well.
I have changed manually the ecore and now it works!

Thanks for your help!

Best regards,

Amivi
Previous Topic:UML2OWL - UML 2.0 sample file
Next Topic:[ATL] ResourceFactory
Goto Forum:
  


Current Time: Fri Apr 19 17:11:41 GMT 2024

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

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

Back to the top