Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » how to get xmi:type of UML in atl rule(the type is OclUndefined)
how to get xmi:type of UML in atl rule [message #997227] Fri, 04 January 2013 14:09 Go to next message
Beatus Ding is currently offline Beatus DingFriend
Messages: 18
Registered: November 2012
Junior Member
I'm trying to transform UML Class Diagram to a self-defined model and I want to get the value of xmi:type.But I always get the OclUndefined.Part of my class diagram is as follows:
<ownedAttribute xmi:id="_8j17ADdrEeKttLPFIKJkEA" name="Board" visibility="private" type="_NtQhwDdmEeKttLPFIKJkEA">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_9dNzADdrEeKttLPFIKJkEA" value="1"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_9dPoMDdrEeKttLPFIKJkEA" value="1"/>
        <defaultValue xmi:type="uml:LiteralString" xmi:id="_9dSrgDdrEeKttLPFIKJkEA">
          <value xsi:nil="true"/>
        </defaultValue>
      </ownedAttribute>


and my rule ValueSpec2entity:
rule ValueSpec2entity{
	from s:	UML!ValueSpecification
	to	 t:	UNIFY!Entity(
		id<-s.__xmiID__,
                type<-s.type
	)
	do{
		t;
		s.type.debug('xx');
	}
}

Then the print info in console is always "xx: OclUndefined" and I cannot generate type attribute in the transformed model.How can I resolve this´╝č
By the way,the s.type is also OclUndefined,but s.__xmiID__ works.
Re: how to get xmi:type of UML in atl rule [message #997236 is a reply to message #997227] Fri, 04 January 2013 14:57 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 523
Registered: July 2009
Senior Member
xmi:type is not the "type" feature. Those are totally different things.
xmi:type is used to specify the type of each element for disambiguation when it is necessary. It is a xmi concept not a metamodel one.

You can access the value of this by using element.eClass().name for example (this will return a String).
Re: how to get xmi:type of UML in atl rule [message #997238 is a reply to message #997236] Fri, 04 January 2013 15:16 Go to previous messageGo to next message
Beatus Ding is currently offline Beatus DingFriend
Messages: 18
Registered: November 2012
Junior Member
Much thanks for your reply,it indeed works~
Re: how to get xmi:type of UML in atl rule [message #1020603 is a reply to message #997238] Mon, 18 March 2013 14:54 Go to previous message
yesheng chai is currently offline yesheng chaiFriend
Messages: 64
Registered: March 2013
Member
I have encountered this type of problem.
<edge xmi:type="uml:ControlFlow" xmi:id="_OWuk4I7vEeKNT6AZT70lJg" name="next1" source="_MSfV4I7nEeKNT6AZT70lJg" target="_MNUBUI7vEeKNT6AZT70lJg">
<guard xmi:type="uml:LiteralBoolean" xmi:id="_OWvzAI7vEeKNT6AZT70lJg" value="true"/>
<weight xmi:type="uml:LiteralInteger" xmi:id="_OWvzAY7vEeKNT6AZT70lJg"/>
</edge>
My rule:
type <- s.type,
id <- s.id
But I can't get their values.
How can I do ?
Thank You !
Previous Topic:ATL problems
Next Topic:Ant task problem
Goto Forum:
  


Current Time: Mon Dec 22 07:11:30 GMT 2014

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

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