Skip to main content



      Home
Home » Modeling » OCL » EMF reflection in completeOCL (Pivot)(Cannot iterate over an object's references )
EMF reflection in completeOCL (Pivot) [message #1780017] Tue, 16 January 2018 09:58 Go to next message
Eclipse UserFriend
I am using CompleteOCL scripts to add constraints to an EMF data model and I need to iterate over the set of features/references.
This is provided in the EMF API by EObject::eCrossReferences() but I cannot cast to EObject in the OCL

context MyDataClass
def: crossRefs() : Integer = self.oclAsType(ecore::EObject).eCrossReferences()->size()
inv HasCrossRefs : self.crossRefs() > 0


For each item of MyDataClass I get the error
'Incompatible source type: 'MyDataClass' for oclAsType(ecore::EObject)

From the OCL FAQ https://wiki.eclipse.org/OCL/FAQ I understand that for the Classic OCL the Parsing option implicitRootClass can be set to EObject to solve this, but in the Pivot OCL this is deprecated and only oclContainer() and oclContents() EMF functions are available (which work fine).

How can I discover an object's references (from a supertype context) using CompleteOCL and the Pivot OCL?
Re: EMF reflection in completeOCL (Pivot) [message #1780020 is a reply to message #1780017] Tue, 16 January 2018 10:03 Go to previous message
Eclipse UserFriend
Sorry, this is a duplicate, Please can you delete it?
Previous Topic:OCLinEcore editor broken after update
Next Topic:EMF reflection in completeOCL (Pivot)
Goto Forum:
  


Current Time: Fri Jun 13 23:16:15 EDT 2025

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

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

Back to the top