Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax
Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax [message #1707111] Wed, 02 September 2015 12:25 Go to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Hello,

Objective: in a STANDALONE environment, load the abstract syntax of an OCL Pivot model, then browse a "Variable" reference "type".
Problem: reference target object is undefined (null::null). It should be the target metamodel class. It works fine in an eclipse environment with OCL plugins loaded.

Attached is a small test project.

Some more context:
Constraint applies on a custom metamodel loaded in a complete OCL document through the import statement. Abstract syntax is serialized using OCL editor save as context menu. I'm not using the parser in this tests, I directly load the serialized abstract syntax.

OCL standalone initialization :

PivotStandaloneSetup.doSetup();
org.eclipse.ocl.pivot.model.OCLstdlib.install();
org.eclipse.ocl.pivot.utilities.OCL.newInstance(OCL.CLASS_PATH);


I have tried registering the target metamodel, initializing OCL and loading model in a dedicated resource set, different types of OCL initializations, importing the target metamodel in the OCL file by ns URI instead of its ecore filename ... code for these tries can be found in the project.

This is my debugging output ( first line is the "Variable" object, second is its "type" target object) :

org.eclipse.emf.ecore.impl.EClassImpl@36206638 (name: Variable) (instanceClassName: null) (abstract: false, interface: false) - self : null::null[1]
null::null


My guess is that I am missing something that prevents the generation / loading of the target metamodel "oclas" version referenced in OCL's abstract syntax.

Any help will be appreciated.
Regards,
MK


Re: Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax [message #1707120 is a reply to message #1707111] Wed, 02 September 2015 13:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6037
Registered: July 2009
Senior Member
Hi

Another one that didn't make it to NNTP.

Add

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
ASResource.FILE_EXTENSION, OCLASResourceFactory.getInstance());

and it works a lot better.

I'll have to investigate why PivotStandaloneSetup.doSetup() doesn't do this.

Regards

Ed Willink
Re: Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax [message #1707124 is a reply to message #1707120] Wed, 02 September 2015 13:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6037
Registered: July 2009
Senior Member
On 02/09/2015 14:01, Ed Willink wrote:
> I'll have to investigate why PivotStandaloneSetup.doSetup() doesn't do
> this.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=476438
Re: Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax [message #1707157 is a reply to message #1707124] Wed, 02 September 2015 16:45 Go to previous message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
So simple ... I did try at one point registering "oclas" via extension to some factory, but probably in a wrong way.

This has been blocking me for 2 months, thank you !

MK
Previous Topic:OCLinEclipse Discarding Tuple Type Information on Operations
Next Topic:Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation
Goto Forum:
  


Current Time: Thu Sep 20 18:00:09 GMT 2018

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

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

Back to the top