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 during a M2M transformation
Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706653] Fri, 28 August 2015 12:35 Go to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Hello,

I have developped an ATL transformation using the OCL pivot abstract syntax metamodel as input.
I believe my problem (below) is related to OCL's standalone initialization, though it might be also related to some ATL mechanics.

The transformation runs without troubles when running the transformation directly inside Eclipse Modelling (using ATL's launch configuration for instance).
It also works when invoking programmatically the ATL transformation inside an Eclipse environment with the OCL/ATL plugins loaded.
However when I try to run the transformation standalone, the references "type" of OCL variables seems to be only partially defined (at least for ATL).

Concretely, a rule like the following one (the target object, here an ecore eclass, is only for the example and is not relevant to my problem, only the ATL debug messages on the input model matter) :

rule Variable2Debug {
	
	from
		s : OCL!Variable
	to
		t : ECORE!EClass (
		
			name <- s.debug('Variable: ').type.debug('Variable type: ' + s.type.oclType()).name.debug('Variable type name: ')
			
		)
}


will output the following when run directly (aka with OCL plugins loaded), which is OK :

Variable: : IN!self
Variable type: org.eclipse.emf.ecore.impl.EClassImpl@2753fdcc (name: Class) (instanceClassName: null) (abstract: false, interface: false): <unknown>!A
Variable type name: : 'A'


and will output this when trying to run it standalone :

Variable: : IN!self
Variable type: org.eclipse.emf.ecore.impl.EClassImpl@75487cd2 (name: Type) (instanceClassName: null) (abstract: false, interface: false): <unknown>!<unnamed>
Variable type name: : OclUndefined


In short, in this configuration I cannot access the name of the variable's type, which comes from the merged metamodel on which the constraints apply. The OCL reference target object is also different for some reason: "Class" / "Type".

I have created 2 small test projects, which I attach to this post, for reproducing the problem. One project is the ATL transformation plugin (and a saved ATL launch config), the other one is the standalone java application with the example OCL model (and a short README).

I believe I am missing something in the OCL standalone initialization, and there's probably more involved in the OCL/ATL mechanics that I don't understand. I have read all the OCL pivot documentation but still don't see where the problems lies.

Any help or hints on the problem and what to try would be appreciated. I can of course provide more input or clarifications if needed.

I am using Eclipse Luna, and the according latest versions of OCL and ATL.

Thank you,
MK







[Updated on: Mon, 31 August 2015 11:55]

Report message to a moderator

Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706835 is a reply to message #1706653] Mon, 31 August 2015 12:43 Go to previous messageGo to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Just an update to say I have tried with Eclipse Mars and according latest versions of OCL/ATL and obtained the same results. I do not attach the projects as they are very similar.

MK

Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706851 is a reply to message #1706835] Mon, 31 August 2015 13:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

I have no idea what you are updating. I see no preceding message on this
thread.

Regards

Ed Willink


On 31/08/2015 13:43, Mathias K wrote:
> Just an update to say I have tried with Eclipse Mars and according
> latest versions of OCL/ATL and obtained the same results. I do not
> attach the projects as they are very similar.
>
> MK
>
>
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706860 is a reply to message #1706851] Mon, 31 August 2015 13:44 Go to previous messageGo to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Hi,

This is weird, the topic / first post is message #1706653, which I can see (obviously). Maybe it is hidden to others because of attachment / embedded code ?

Just in case, I also posted in the ATL forum (with some minor OCL specifics removed) : https://www.eclipse.org/forums/index.php/m/1706844/#msg_1706844

Regards,
MK
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706862 is a reply to message #1706860] Mon, 31 August 2015 14:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

Not that wierd.

In principle the Web forum and the NNTP newsgroup are interchangeable.
In practice the interchange is irreparably buggy and we're all waiting
for the great day when we move to a new technology such as that used by
StackOverflow.

Most Eclipse committers monitor only the NNTP newsgroup.

-------------------------------

If you are running standalone you should look at the standalone section
in the OCL documentation. Unfortunately I forgot to refresh it for Mars,
so you need to download the Neon M1 / Mars.1 RC1 release for the
refresh. For the most part calling PivotStandaloneSetup.doSetup() is now
sufficient for just the AS models. Call XXXStandaloneSetup.doSetup() to
get one of the XXX CS models and associated Xtext parser.

Regards

Ed Willink




On 31/08/2015 14:44, Mathias K wrote:
> Hi,
>
> This is weird, the topic / first post is message #1706653, which I
> can see (obviously). Maybe it is hidden to others because of
> attachment / embedded code ?
>
> Just in case, I also posted in the ATL forum (with some minor OCL
> specifics removed) :
> https://www.eclipse.org/forums/index.php/m/1706844/#msg_1706844
>
> Regards,
> MK
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706901 is a reply to message #1706862] Mon, 31 August 2015 17:23 Go to previous messageGo to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Hi,

Thank you for the quick answer and taking time to look into the issue.

I have indeed tried with Mars, following the doc (modifying where needed for parts where doc is not in sync with libraries).
I just tried using the PivotStandaloneSetup for the same result as before.
Though I only need the AS for this test, I did try with the xtext setups as well just to be sure, doesn't change the outcome.

I don't know what else I could try. I can send the updated mars projects if you want, but it just the same as the luna ones except for the OCL init being updated.

Regards,
MK
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1706957 is a reply to message #1706901] Tue, 01 September 2015 07:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

I'm afraid that I cannot really help further. I'm not an ATL user.

I wouldn't really expect it to work at all, since ATL has its own
distinct proprietary OCL variant internally and such duplicates often
cause confusion. But since it works within Eclipse, ATL appears to have
successfully isolated tooling and user metamodels.

The org.eclipse.emf.ecore.impl.EClassImpl@2753fdcc in your original
message suggests that Pivot.ecore rather than
http://www.eclipse.org/ocl/2015/Pivot is in use.

You almost certainly have a problem populating the package registries.
Use the debugger to discover why the 'wrong' Resource is loaded. In
similar scenarios I often add a println to the Resource constructor.

Regards

Ed Willink





On 31/08/2015 18:23, Mathias K wrote:
> Hi,
>
> Thank you for the quick answer and taking time to look into the issue.
>
> I have indeed tried with Mars, following the doc (modifying where
> needed for parts where doc is not in sync with libraries).
> I just tried using the PivotStandaloneSetup for the same result as
> before.
> Though I only need the AS for this test, I did try with the xtext
> setups as well just to be sure, doesn't change the outcome.
>
> I don't know what else I could try. I can send the updated mars
> projects if you want, but it just the same as the luna ones except for
> the OCL init being updated.
>
> Regards,
> MK
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1707112 is a reply to message #1706957] Wed, 02 September 2015 12:25 Go to previous messageGo to next message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Thanks for your answer.

I have made some further tests based on your input.
This led me in two directions. The second one will probably interest you more.

1) Concerning your hint on package registrations. I've only used ns URIs all along and didn't see any path to any ecore file in all debugging messages, but I have checked a couple things anyway .

This is the package in the global EMF registry for the OCL Pivot metamodel from its NSURI (http://www.eclipse.org/ocl/2015/Pivot) :

org.eclipse.ocl.pivot.internal.PivotPackageImpl@1b86d76f (name: pivot) (nsURI: http://www.eclipse.org/ocl/2015/Pivot, nsPrefix: pivot)


And this is the (same) one registered in ATL's dedicated resource set after all models are loaded :

org.eclipse.ocl.pivot.internal.PivotPackageImpl@1b86d76f (name: pivot) (nsURI: http://www.eclipse.org/ocl/2015/Pivot, nsPrefix: pivot)


I have checked that the metamodel in ATL has the right ns URI, that the model (the abstract syntax) is loaded using the right metamodel, etc.
If anyone is interested, the corresponding ATL code for loading (meta)models is here :
http://git.eclipse.org/c/mmt/org.eclipse.atl.git/tree/plugins/org.eclipse.m2m.atl.core.emf/src/org/eclipse/m2m/atl/core/emf/EMFInjector.java
In short, it is a simple getResource(nsURI) on its dedicated resource set.

I have tried with initializing OCL standalone in the global registry, in ATLs resource set, and in both.

In all cases, the ATL output when debugging is still :

Variable: : IN!self
Variable type: org.eclipse.emf.ecore.impl.EClassImpl@75165e3e (name: Class) (instanceClassName: null) (abstract: false, interface: false): <unknown>!<unnamed>
Variable type name: : OclUndefined


2) since I couldn't seem to narrow the problem anymore, I tried to get rid of ATL. I've hence loaded the OCL abstract syntax resource similarly to how ATL does it and browsed it manually to get a variable "type" reference. The reference target is indeed undefined again so I must be doing something wrong. I have created a separate topic for these tests with the project attached and some additional info :
https://www.eclipse.org/forums/index.php?t=msg&th=1069939&goto=1707111&#msg_1707111

At this point, I'm waiting to solve this problem before I come back trying with ATL as it clearly seems related. Please recall that all of this is in standalone mode, running in an eclipse environment with OCL plugins works fine with or without ATL.

Regards,
MK
Re: Unable to resolve OCL pivot variable types in standalone mode during a M2M transformation [message #1707158 is a reply to message #1707112] Wed, 02 September 2015 16:47 Go to previous message
Mathias K is currently offline Mathias KFriend
Messages: 16
Registered: March 2014
Junior Member
Solved by https://www.eclipse.org/forums/index.php?t=msg&th=1069939&goto=1707111&#msg_1707111
Previous Topic:Unable to resolve OCL pivot variable types in standalone mode when browsing abstract syntax
Next Topic:Exception on custom error message with complete OCL
Goto Forum:
  


Current Time: Thu Nov 15 21:49:19 GMT 2018

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

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

Back to the top