Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Text Representation to UML2
Text Representation to UML2 [message #21041] Sat, 28 April 2007 20:23 Go to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Hi,

An OCL expression is text based. For example the beneath expression
"o.name" and "o.visibility". How exactly does OCL map these text-based
representations into UML datatypes? Could someone point me to where in
the code this mapping takes place, as I'd like to do a text->uml2 data
type mapping myself.

"->select(o : Operation | o.name = 'MyOp' and o.visibility =
VisibilityKind::public)"

Thanks,
Andrew.
Re: Text Representation to UML2 [message #21057 is a reply to message #21041] Sun, 29 April 2007 17:35 Go to previous messageGo to next message
Andrew Carton is currently offline Andrew CartonFriend
Messages: 104
Registered: July 2009
Senior Member
Nevermind, I figured it is done through the ECORE reflection. :)

Andrew.

Ar 28/04/2007 21:23, Scríobh Andrew Carton:
> Hi,
>
> An OCL expression is text based. For example the beneath expression
> "o.name" and "o.visibility". How exactly does OCL map these text-based
> representations into UML datatypes? Could someone point me to where in
> the code this mapping takes place, as I'd like to do a text->uml2 data
> type mapping myself.
>
> "->select(o : Operation | o.name = 'MyOp' and o.visibility =
> VisibilityKind::public)"
>
> Thanks,
> Andrew.
Re: Text Representation to UML2 [message #21088 is a reply to message #21057] Mon, 30 April 2007 16:20 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Andrew,

Yes and no. :-)

In the case that you are using the Ecore metamodel binding for OCL, then
yes, the type of 'o' is determined by EMF's reflection API:
EObject.eClass().

However, in the case of the UML metamodel binding -- which is used with EMF
models that are specified with UML, not Ecore, and are generated by MDT
UML2 (as UML2 is, itself) -- the metaclass of your element o is the
Operation class from the UML.metamodel.uml model, not the Operation EClass
from the UML.ecore model. Have a look at
OCLUMLUtil.getClassifier(EClassifier) for how this works.

Cheers,

Christian


Andrew Carton wrote:

> Nevermind, I figured it is done through the ECORE reflection. :)
>
> Andrew.
>
> Ar 28/04/2007 21:23, Scríobh Andrew Carton:
>> Hi,
>>
>> An OCL expression is text based. For example the beneath expression
>> "o.name" and "o.visibility". How exactly does OCL map these text-based
>> representations into UML datatypes? Could someone point me to where in
>> the code this mapping takes place, as I'd like to do a text->uml2 data
>> type mapping myself.
>>
>> "->select(o : Operation | o.name = 'MyOp' and o.visibility =
>> VisibilityKind::public)"
>>
>> Thanks,
>> Andrew.
Previous Topic:[Announce] MDT OCL 1.1.0 I200704251854 is available
Next Topic:Variable definitions
Goto Forum:
  


Current Time: Fri Apr 26 12:56:35 GMT 2024

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

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

Back to the top