Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:58 Go to next message
Steve Pearson is currently offline Steve PearsonFriend
Messages: 10
Registered: May 2014
Junior Member
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 15:03 Go to previous message
Steve Pearson is currently offline Steve PearsonFriend
Messages: 10
Registered: May 2014
Junior Member
Sorry, this is a duplicate, Please can you delete it?
Previous Topic:Standalone compiled OCL
Next Topic:EMF reflection in completeOCL (Pivot)
Goto Forum:
  


Current Time: Tue Feb 20 21:56:37 GMT 2018

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

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