Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:18 Go to next message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
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 15:19]

Report message to a moderator

Re: Getting invalid for the evaluation of OCL on XMI [message #1848617 is a reply to message #1848606] Thu, 09 December 2021 18:42 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7663
Registered: July 2009
Senior Member
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: Sun Jul 14 03:08:26 GMT 2024

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

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

Back to the top