Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [CompleteOCL] Accessing the metamodel
[CompleteOCL] Accessing the metamodel [message #726044] Fri, 16 September 2011 09:17 Go to previous message
Ambros Morscher is currently offline Ambros Morscher
Messages: 24
Registered: June 2010
Junior Member
Hi all,

I am using CompleteOCL documents to enrich my UML model with OCL constraints. This works quite fine.

Now i want to have access to the OCL constraints packages and contexts in the CompleteOCL document. Therefore I instanceiated a CompleteOCL xtext resource and navigated through the content tree of the resource. I found all elements needed in the resource.
What i didn't manage was to access elements from my UML model. For example i want to get the name or element of my OCL context. I found no way to get it from the ClassifierContextDeclCS instance of the xText resource. Here an example of my ocl file

package packa::subpack
context ElementA
	inv checkName :
	let name :String = self.name in
	 	name.size()<=12 

endpackage


How can I retrieve the context "ElementA" from the CompleteOCL file. Has this something to do with the pivot model?
Can anyone please give me some hints how to retrieve this information ?

Thanks Ambros
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:OCL for InstanceSpecifications on M1
Next Topic:Ecore2OCLinEcore
Goto Forum:
  


Current Time: Fri May 24 10:37:49 EDT 2013

Powered by FUDForum. Page generated in 0.03528 seconds