Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Stereotype attribute using ATL(Picking (deriving) Stereotype attribute using ATL in Eclipse Luna)
Stereotype attribute using ATL [message #1707183] Wed, 02 September 2015 21:03
Karishma Karishma is currently offline Karishma KarishmaFriend
Messages: 4
Registered: September 2015
Junior Member
Hey,

Could someone help me with the code for deriving the Stereotype Attributes name and properties. I have a message which is related to a lifeline. The lifeline is linked to a schedulable resource which is further allocated a hardware processor.
I am using Eclipse Luna and UML 5.0
In the code i am trying to pick the schedulableResource linked to the lifeline and the then the hardware processor allocated to it. But i am not able to do it....

Any help would be appreciated....

Code:

helper context UML!Element def: hasStereotype(stereotype : String) : Boolean =
self.getAppliedStereotypes() -> collect(st | st.name) -> includes(stereotype);

helper context UML!Lifeline def: getLifelineHost (): String =
if (self.hasStereotype('PaRunTInstance'))
then
self.getValue(self.getAppliedStereotype('PaRunTInstance'),'host')
else
''
endif;

rule MessageToConnector
{
from
m: UML!Message
using
{
mosr:UML!MessageOccurrenceSpecification = m.receiveEvent;
llr: UML!Lifeline = mosr.covered.first();
}
to
c : QNModel!Connector
(
name<- llr.getLifelineHost()
)
do
{
'ruleMessageToConnectorStarts'.println();
'receiver lifeline'.println();
llr.name.println();
}
}


It gives me the following error:

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: IN!User.getValue(org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined,java.lang.String)
at getLifelineHost#11(UML2QN.atl[20:7-20:72])
local variables: self=IN!User
at __applyMessageToConnector#20(UML2QN.atl[94:11-94:32])
local variables: self=UML2QN : ASMModule, link=TransientLink {rule = MessageToConnector, sourceElements = {m = org.eclipse.uml2.uml.internal.impl.MessageImpl@4eee2a3c (name: think time, visibility: <unset>) (messageSort: asynchCall)}, targetElements = {c = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@109a492c (eClass: org.eclipse.emf.ecore.impl.EClassImpl@d060492 (name: Connector) (instanceClassName: null) (abstract: false, interface: false))}, variables = {mosr = org.eclipse.uml2.uml.internal.impl.MessageOccurrenceSpecificationImpl@25da6960 (name: MessageRecv, visibility: <unset>), llr = org.eclipse.uml2.uml.internal.impl.LifelineImpl@688a9461 (name: User, visibility: <unset>)}}, m=IN!think time, c=OUT!<unnamed>, mosr=IN!MessageRecv, llr=IN!User
at __exec__#38(UML2QN.atl)
local variables: self=UML2QN : ASMModule, e=TransientLink {rule = MessageToConnector, sourceElements = {m = org.eclipse.uml2.uml.internal.impl.MessageImpl@4eee2a3c (name: think time, visibility: <unset>) (messageSort: asynchCall)}, targetElements = {c = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@109a492c (eClass: org.eclipse.emf.ecore.impl.EClassImpl@d060492 (name: Connector) (instanceClassName: null) (abstract: false, interface: false))}, variables = {mosr = org.eclipse.uml2.uml.internal.impl.MessageOccurrenceSpecificationImpl@25da6960 (name: MessageRecv, visibility: <unset>), llr = org.eclipse.uml2.uml.internal.impl.LifelineImpl@688a9461 (name: User, visibility: <unset>)}}
at main#24(UML2QN.atl)
local variables: self=UML2QN : ASMModule
Previous Topic:profile uml
Next Topic:View UML diagram on Eclipse
Goto Forum:
  


Current Time: Thu Apr 25 14:29:13 GMT 2024

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

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

Back to the top