Skip to main content



      Home
Home » Modeling » OCL » Getting invalid for the evaluation of OCL on XMI
Getting invalid for the evaluation of OCL on XMI [message #1848606] Thu, 09 December 2021 10:18 Go to next message
Eclipse UserFriend
Hello,

I am trying to evaluate an OCL expression "self.contains" supposed to return the class contained in self, but I am getting 'invalid' as a response. Would please explain to me why I am getting that ?

Here my code :


Resource resource = OCLManager.getResourceFromEcoreFile("resources/model.ecore");
Resource XMIRes = OCLManager.getResourceFromXMIFile("resources/instance.xmi", resource);
String contraintString = "self.contains";		
OCLExpression<EClassifier> parsedConstraints = OCLManager.getQuery(contraintString, "resources/model.ecore" );
Object eval = OCLManager.getOcl().evaluate(XMIRes.getContents().get(0),parsedConstraints);

[Updated on: Thu, 09 December 2021 10:19] by Moderator

Re: Getting invalid for the evaluation of OCL on XMI [message #1848617 is a reply to message #1848606] Thu, 09 December 2021 13:42 Go to previous message
Eclipse UserFriend
Hi

You only provide a snippet of your code. Looking at it I see an OCLManager class that seems rather important. It is not part of Eclipse OCL, so without anything resembling a repro, I cannot copy further.

The only OCLManager hits on Google are for OpenCL not OCL, so I must assume that OCLManager is your own code and is probably the source of your problems.

Regards

Ed Willink
Previous Topic:Calling an EMF Java function from OCL constraint
Next Topic:Can not gen emf-gen from ecore file based on generator (.mwe) of OCL open source
Goto Forum:
  


Current Time: Tue Jul 15 21:32:52 EDT 2025

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

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

Back to the top