Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Pivot missing metamodel reference
Pivot missing metamodel reference [message #1791445] Fri, 29 June 2018 12:57 Go to next message
Flora Ferreira is currently offline Flora FerreiraFriend
Messages: 1
Registered: June 2018
Junior Member
Hi,

I am using ocl pivot but I have problems with reference to my metamodel :

I have defined this simple metamodel :

import ecore : '.....uriEcore' ;

package testsTypes : testsTypes = '....uriTestsType....'
{
	class Diagram
	{
		property Objects : Object[*|1];
	}
	class Object
	{
		attribute Name : String[?];
	}
	class Link
	{
		attribute Name : String[?];
	}
}


Then I have defined this ocl file :

import '...uriTestsType....'
import '...uriEcore'
import '...uriOclPivot'
import '...uriOclLibrary'

package testsTypes

context Object
def: nomNull : String = ''

context Diagram 

-- number = 'a' for all objects
inv TypeDefini('acces to a property user defined') : self.Objects -> collect(obj|obj.oclAsType(Object)) ->  forAll(obj | obj.Name = obj.nomNull)
inv TypeDefini2('lool') : self.Objects -> collect(obj | obj.oclAsType(Object)) -> forAll(true)
inv TypeLibrary('acces to a property user defined') : self.Objects -> collect(obj|obj.oclAsType(Collection)) ->  forAll(true)
inv TypePivot('acces to a property user defined') : self.Objects -> collect(obj|obj.oclAsType(OclVoid)) ->  forAll(true)
inv TypeLink('acces to a property user defined') : self.Objects -> collect(obj|obj.oclAsType(Link)) ->  forAll(true)

endpackage


(The properties aren't really relevant, I wrote it only to show my problem)

Then I save this file as an Abstract Syntax and it gives me Tests.ocl.oclass.

I open it with MoDisco view. The problem is while an object is of type of one class from the metamodel, for instance 'Object', the reference is crossed and impossible to recover any information such as the name of the class.
However, no problem for types defined in the Library such as Collection or OclVoid

I attached the project and screenshot of references to Object and Collection in MoDisco view.

I am also using Eclipse Oxygen.

I have search on the web and on these forum an explanation but I didn't find it. I hope you can help me.

Regards,

Flora
Re: Pivot missing metamodel reference [message #1791481 is a reply to message #1791445] Sat, 30 June 2018 10:06 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The Pivot *.oclas/*.qvtras/*.qvtcas format is primarily an internal normalization of an external file and so it is not normally saved, although it should work. I have a few unit tests for its persistence. There are at least three bugs in this area that have been fixed in Photon. When I look at your Tests.ocl.oclas in my workspace using the Sample (Reflective) Ecore Model Editor everything appears fine. (The Sample Ecore Model Editor is a standard EMF tool and so acts as an invaluable mediator to identify bad EMF model creating applications and bad EMF model consuming applications.)

You should be able to install Eclipse OCL 6.4.0 (for Photon) on Oxygen.

If you can tell me what to do to make something untoward happen in the Sample Ecore Editor, I can investigate.

Regards

Ed Willink

Previous Topic:Welcome to the eclipse.modeling.mdt.ocl group!
Next Topic:Announce OCL 6.4.0
Goto Forum:
  


Current Time: Wed Apr 24 16:32:23 GMT 2024

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

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

Back to the top