Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » No one knows how to solve this problem ?(The reference of stereotype)
No one knows how to solve this problem ? [message #1041548] Mon, 15 April 2013 08:34 Go to next message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
> My input file:
> <node xmi:type="uml:OpaqueAction"
> xmi:id="_sJ_lkJxyEeKu4N70BKjerA"name="AA"
> outgoing="_uWOzoJxyEeKu4N70BKjerA"incoming="_tSjwIJxyEeKu4N70BKjerA"/>
> <packagedElement xmi:type="uml:Node" xmi:id="_DP_dMJ3mEeK20YqidfLEyA"
> name="RR"/>
> ......
> <PAM:PaStep
> xmi:id="_v8eYsJxyEeKu4N70BKjerA"base_NamedElement="_sJ_lkJxyEeKu4N70BKjerA"
> base_Action="_sJ_lkJxyEeKu4N70BKjerA" host="_GU7N0J3mEeK20YqidfLEyA">
> <hostDemand>(exp(2),s)</hostDemand>
> </PAM:PaStep>
> ......
> <GQAM:GaExecHost xmi:id="_GU7N0J3mEeK20YqidfLEyA" resMult="2"
> base_Classifier="_DP_dMJ3mEeK20YqidfLEyA" schedPolicy="FIFO"/>
> ......
> when I use expression for uml:OpaqueAction like:s.getAppliedStereotypes().
>first().debug('ss'), I get the result : ss:<unknown>!PaStep
> when I use
> expression:s.getAppliedStereotypes().first().host.debug('xx')
> and s.getAppliedStereotypes().first().host.base_Classifier.debug('YY'),some
> error occurs in console.
> I want to get xx:GaExecHost and YY:RR.
> How can I do ?
> Look forward to your reply!
>

[Updated on: Mon, 15 April 2013 14:26]

Report message to a moderator

Re: No one knows how to solve this problem ? [message #1042441 is a reply to message #1041548] Tue, 16 April 2013 12:46 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
Registered: July 2009
Senior Member
Hello,

Looking to the XMI, it is very often difficult to see exactly where errors are coming from.
A good advice when developing transformations or more generally working with models: you should rather open your models into regular model editors such as the MoDisco Model Browser.

Concerning UML profiles/stereotypes and ATL, you can find good complementary information from this page.

I hope this helps.

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: No one knows how to solve this problem ? [message #1042493 is a reply to message #1042441] Tue, 16 April 2013 13:54 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
s.getAppliedStereotypes().first().debug('xx');
the result is: <unknown>!PaStep.
host is ereference of PaStep in marte metamodel and I can know that the host connect to another stereotype GQAM:GaExecHost ,but the expression that s.getAppliedStereotypes().first().host.debug('YY');is error.
the error is :Feature host does not exist on Stereotype.
Why?
Re: No one knows how to solve this problem ? [message #1042503 is a reply to message #1042441] Tue, 16 April 2013 14:06 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
I just want to know that how to get another stereotype or element by the reference of a stereotype of a element ?
"Feature xx does not exist on Stereotype" appears in console.
I've spent three days to solve this problem, but still did not solve this problem.
Thank you vey much !
Re: No one knows how to solve this problem ? [message #1042548 is a reply to message #1042503] Tue, 16 April 2013 15:03 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
Dear Hugo Bruneliere,
I hope you can heip me solve this problem .
Look forward to your reply !
Thank you !
Re: No one knows how to solve this problem ? [message #1043302 is a reply to message #1042548] Wed, 17 April 2013 14:34 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 607
Registered: July 2009
Senior Member
Hello,

I guess your problem is not coming from ATL but from the current knowledge you have of the UML2 metamodel.

Whe doing s.getAppliedStereotypes()->first() (by the way, you have to use the "->" operator because the called method is returning a sequence and not a single element) you get a model element of type UML2::Stereotype.
You should take a look to the UML2 metamodel so see the actual features of this type of element, but "host" is probably not one of them. Normally, a stereotype rather provides a set of tagged values that you can access by knowing the corresponding tags.
I hope this helps.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: No one knows how to solve this problem ? [message #1043364 is a reply to message #1043302] Wed, 17 April 2013 16:00 Go to previous messageGo to next message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
Dear Hugo Bruneliere,
In my project ,I apply MARTe profile to UML model."host" is not a feature of UML2::Stereotype in UML2 metamodel,but "host" is a feature of PAM::PaStep in MARTE metamodel . The relationship of two model elements was achieved by their corresponding stereotypes.In ATL rule ,I need to get the relationship of two model elements to generate reference.
How can I do ?
Re: No one knows how to solve this problem ? [message #1043378 is a reply to message #1043302] Wed, 17 April 2013 16:18 Go to previous message
yesheng chai is currently offline yesheng chai
Messages: 64
Registered: March 2013
Member
In Papyrus ,I bulid a deployment diagram and activity diagram .The action of activity diagram was deployed to a server device of deployment diagram .
Action has a "PAM::Pastep" and the value of "Host" is the name of corresponding server device.In ATL rules ,I need to get the reference of them to generate reference for my target model element .
Can you give me some suggestion?
Thank you !
Previous Topic:EMFTVM: Problem using EDataType objects as parameter of lazy rules
Next Topic:How can I retrieve tagged references from stereotyped UML model elements?
Goto Forum:
  


Current Time: Sat Oct 25 20:42:54 GMT 2014

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

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