Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET] OCL/Profiles(JET and OCL - JET and profiles)
[JET] OCL/Profiles [message #490895] Mon, 12 October 2009 09:55 Go to next message
Siegfried Nolte is currently offline Siegfried NolteFriend
Messages: 40
Registered: August 2009
Member
(1) Is it possible to combine JET with OCL, means to do some OCL actions in a JET-template?
(2) Is it possible to retrieve UML profile information in a JET-template?

Thanks for answer,
Siegfried
Re: [JET] OCL/Profiles [message #491146 is a reply to message #490895] Tue, 13 October 2009 13:18 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Siegfried:

Out-of-the-box, JET includes not support for OCL. But, there is nothing preventing you from creating a custom tag or two (equivalent to c:get, c:iterate and c:if, for example) that use OCL instead of XPath. It has been done - unfortunately, the individual who did it was unable to contribute it back to the project Sad

As for accessing UML profiles with the XPath engine, this is possible. The Galileo release (M2T JET 1.0.0) includes uml2.stereotype function:

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .jet.doc/references/xpathFunctions/uml2.stereotypeFunction.h tml

It lets you test for and access a UML2 stereotype for any UML element. The function is roughly equivalent to calling this UML2 API:

http://help.eclipse.org/galileo/topic/org.eclipse.uml2.doc/r eferences/javadoc/org/eclipse/uml2/uml/Element.html#getStere otypeApplication(org.eclipse.uml2.uml.Stereotype)

Since the API returns an EObject, you can use XPath expressions to access its attributes. E.g.

uml2.stereotype(/Model,'Foo::Bar')/@someProperty

or

//Package[uml2.stereotype('Ultimate::Question')/@answer = 42]

Paul
Previous Topic:Patch for <jet.compile> (<jet.compile2) gives null pointer exceptions
Next Topic:Re: Code generation in a Standalone Java Application
Goto Forum:
  


Current Time: Fri Dec 19 10:50:25 GMT 2014

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

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