Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » EmbeddedXtextEditor and context for expression
EmbeddedXtextEditor and context for expression [message #986713] Wed, 21 November 2012 07:29 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
Hi,

I am using EmbeddedXtextEditor for writing OCL expressions. It works fine in case of writing derivation statement of an attribute but when i want to write an OCL expression for operation's body and if operation has parameters then it does not recognize parameters. But if operation has no arguments/parameters then it works fine.

void org.eclipse.ocl.examples.xtext.essentialocl.ui.model.BaseDocument.setContext(EClassifier ecoreContext, Map<String, EClassifier> ecoreParameters)

In case of attribute derivation statement, i am passing null as ecoreParameters but incase of operation i am setting ecoreParameters arugument as map of eparameter's name and eparameterType of specific function. But doing so i am getting Exception as


at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
at org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)

any idea?

Cheers and thanks in advance
Re: EmbeddedXtextEditor and context for expression [message #986722 is a reply to message #986713] Wed, 21 November 2012 07:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4036
Registered: July 2009
Senior Member
Hi

This sounds familiar. I think I've fixed it. What code version are you
using?

Regards

Ed Willink


On 21/11/2012 12:29, ModelGeek Mising name wrote:
> Hi,
>
> I am using EmbeddedXtextEditor for writing OCL expressions. It works
> fine in case of writing derivation statement of an attribute but when
> i want to write an OCL expression for operation's body and if
> operation has parameters then it does not recognize parameters. But if
> operation has no arguments/parameters then it works fine.
>
> void
> org.eclipse.ocl.examples.xtext.essentialocl.ui.model.BaseDocument.setContext(EClassifier
> ecoreContext, Map<String, EClassifier> ecoreParameters)
>
> In case of attribute derivation statement, i am passing null as
> ecoreParameters but incase of operation i am setting ecoreParameters
> arugument as map of eparameter's name and eparameterType of specific
> function. But doing so i am getting Exception as
>
>
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
>
> any idea?
>
> Cheers and thanks in advance
>
Re: EmbeddedXtextEditor and context for expression [message #986734 is a reply to message #986722] Wed, 21 November 2012 08:41 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member
org.eclipse.emf;bundle-version="2.6.0",
org.eclipse.emf.ecore;bundle-version="2.8.1",
org.eclipse.emf.codegen;bundle-version="2.8.0",
org.eclipse.emf.codegen.ecore;bundle-version="2.8.1",
org.eclipse.ocl;bundle-version="3.3.0",
org.eclipse.ocl.ecore;bundle-version="3.2.100",
org.eclipse.ocl.examples.pivot;bundle-version="3.3.0",
org.eclipse.ocl.examples.xtext.base;bundle-version="3.3.0",
org.eclipse.ocl.examples.xtext.console;bundle-version="3.3.0",
org.eclipse.ocl.examples.xtext.essentialocl;bundle-version="3.3.0",
org.eclipse.ocl.examples.xtext.oclstdlib;bundle-version="3.3.0",
org.eclipse.ocl.examples.xtext.oclstdlib.ui;bundle-version="3.3.0"

thanks for assistance
Re: EmbeddedXtextEditor and context for expression [message #986752 is a reply to message #986734] Wed, 21 November 2012 09:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4036
Registered: July 2009
Senior Member
Hi

On 21/11/2012 13:41, ModelGeek Mising name wrote:
> org.eclipse.ocl.examples.xtext.essentialocl;bundle-version="3.3.0",

3.3.0 is the Kepler release which stops changing in June 2013. Until
then you need to specify the qualifier as well to clarify what is involved.

A version of setContext is now deprecated. There is now an
EInvocationContext that should be initialized with your parameters. You
can check whether it is to see whether you have my recent fixes, and to
distinguish whether the problem is a failure to pass the parameters or a
failure to look them up.

Regards

Ed Willink
Re: EmbeddedXtextEditor and context for expression [message #986763 is a reply to message #986752] Wed, 21 November 2012 10:00 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 501
Registered: June 2011
Senior Member

org.eclipse.ocl.examples.pivot;bundle-version="3.3.0.v20121102-1800",
org.eclipse.ocl.examples.xtext.base;bundle-version="3.3.0.v20121102-1658",
org.eclipse.ocl.examples.xtext.console;bundle-version="3.3.0.v20121102-1658",
org.eclipse.ocl.examples.xtext.essentialocl;bundle-version="3.3.0.v20121102-1658",
org.eclipse.ocl.examples.xtext.oclstdlib;bundle-version="3.3.0.v20121102-1658",
org.eclipse.ocl.examples.xtext.oclstdlib.ui;bundle-version="3.3.0.v20121102-1658"

I have tried to debug and it seems

@Deprecated
public @Nullable Object setContext(@NonNull EssentialOCLCSResource resource, @Nullable EClassifier ecoreContext, @Nullable Map<String, EClassifier> ecoreParameters) {
CS2PivotResourceAdapter csAdapter = CS2PivotResourceAdapter.getAdapter(resource, null);
MetaModelManager metaModelManager = csAdapter.getMetaModelManager();
resource.setParserContext(new EInvocationContext(metaModelManager, resource.getURI(), ecoreContext, ecoreParameters));
return null;
}
is being used with parameter map is passed properly.

[Updated on: Wed, 21 November 2012 10:07]

Report message to a moderator

Re: EmbeddedXtextEditor and context for expression [message #986792 is a reply to message #986763] Wed, 21 November 2012 11:13 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4036
Registered: July 2009
Senior Member
Hi

I'm puzzled.
> org.eclipse.ocl.examples.pivot;bundle-version="3.3.0.v20121102-1800",
is an N-build a few weeks before M3, but all relevant changes should be
in that code.
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
> at
> org.eclipse.ocl.examples.pivot.attributes.DataTypeAttribution.computeLookup(DataTypeAttribution.java:42)
should be line 43 in the current code.

(The extra line to support lookup of templated data type parameters such
as EList<T> was added just before Juno.)

I can see a mechanism for a loop for an interesting DataType declaration.

Please raise a Bugzilla and attach a zipped project.

Regards

Ed Willink
Previous Topic:Modifying SRC
Next Topic:Custom OCL error messages
Goto Forum:
  


Current Time: Mon Sep 01 14:39:52 EDT 2014

Powered by FUDForum. Page generated in 0.01780 seconds