Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [Xtext] Did you forget to configure the corresponding metamodel?
[Xtext] Did you forget to configure the corresponding metamodel? [message #61907] Tue, 21 July 2009 10:58 Go to next message
Eclipse UserFriend
Hi,

I have a Checks.chk ffile with constraionts om my model. In this file I
use two metamodels. The one is the metamodel of the editor that is
open. The other is an external metamodel.

Whenever the Checks file is trifggered in the exitor I get the
following message:

Couldn't resolve type for 'crossx::ReferenceSymbolProperty'.
Did you forget to configure the corresponding metamodel?

The external metamodel I refer to is "crossx", so the xtext editor does
not know this metamodel. When this is run through a nworkflow file I
know how to registerv the metamodel, but how and where to do this when
triggered from the editor?

All references to the crossx project seem to be ok.

Jos
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #61987 is a reply to message #61907] Tue, 21 July 2009 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jos,

please double check that your crossx metamodel is registered in a
plugin.xml and that this plugin is part of your runtime environment.
Furthermore you have to overwrite your DslCheckValidator#getEPackages
and add the crossx package to the result list. Otherwise the validation
will not be triggered for eObject from the crossx package.

Hope that helps,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 21.07.2009 16:58 Uhr, schrieb Jos Warmer:
> Hi,
>
> I have a Checks.chk ffile with constraionts om my model. In this file I
> use two metamodels. The one is the metamodel of the editor that is open.
> The other is an external metamodel.
>
> Whenever the Checks file is trifggered in the exitor I get the following
> message:
>
> Couldn't resolve type for 'crossx::ReferenceSymbolProperty'.
> Did you forget to configure the corresponding metamodel?
>
> The external metamodel I refer to is "crossx", so the xtext editor does
> not know this metamodel. When this is run through a nworkflow file I
> know how to registerv the metamodel, but how and where to do this when
> triggered from the editor?
>
> All references to the crossx project seem to be ok.
>
> Jos
>
>
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62034 is a reply to message #61987] Tue, 21 July 2009 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Sebastian,

The metamodel is registered in its own project:

<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.mod4j.org/mod4j.crossx"
class = "org.mod4j.crossx.mm.crossx.CrossxPackage"
genModel = "model/crossx.genmodel" />
</extension>
</plugin>

It is used in some of the other plugins in the runtime environment. I even
have an Eclipse viewer opened on the crossx model.

I did overwrite getPackages(), but this didn't make any difference. It
shouldn't because all constraints are triggered from the other metamodel
(the one from the editor's model) . The crossx models are only used for
querying and finding information.

It seems that only when the constraints are triggered from the editor /
parser it cannot find the crossx metamodel. I am really puzzled by this
behavior.

Jos

Sebastian Zarnekow wrote:

> Hi Jos,

> please double check that your crossx metamodel is registered in a
> plugin.xml and that this plugin is part of your runtime environment.
> Furthermore you have to overwrite your DslCheckValidator#getEPackages
> and add the crossx package to the result list. Otherwise the validation
> will not be triggered for eObject from the crossx package.

> Hope that helps,
> Sebastian

Sebas
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62057 is a reply to message #62034] Tue, 21 July 2009 13:41 Go to previous messageGo to next message
Eclipse UserFriend
Sebastian,

I have used the following workaround. In the CheckValidator I explicitly
register the crossx metamodel (see registerCrossx()) when it is configured.

public class MyDataContractCheckValidator extends
DataContractCheckValidator {

protected void configure() {
registerCrossx();
CheckEValidatorAdapter val = new
CheckEValidatorAdapter(DataContractDslPackage.eINSTANCE);
val.addCheckFile(new CheckFileWithContext("DatacontractChecks"));
val.addCheckFile(new CheckFileWithContext("CrossxChecks1"));

EValidator.Registry.INSTANCE.put(DataContractDslPackage.eINS TANCE,val);
}

protected void registerCrossx() {
EPackage.Registry.INSTANCE.put(CrossxPackage.eNS_URI,
CrossxPackage.eINSTANCE);
}

}

This works fine. I do not really like this woraround, but until I find
another solution I'll stick with this.

Jos
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62080 is a reply to message #62057] Tue, 21 July 2009 13:52 Go to previous messageGo to next message
Eclipse UserFriend
OOps,

Itb did work :-) ! For five minutes .. and then suddenly I got the same
error messages again.

I am lost again :-(

Jos
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62109 is a reply to message #62080] Tue, 21 July 2009 14:12 Go to previous messageGo to next message
Eclipse UserFriend
Jos,

what's the name of your DataContractDslPackage? It's not crossx, is it?

Regards,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 21.07.2009 19:52 Uhr, schrieb Jos Warmer:
> OOps,
>
> Itb did work :-) ! For five minutes .. and then suddenly I got the same
> error messages again.
>
> I am lost again :-(
>
> Jos
>
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62133 is a reply to message #62109] Tue, 21 July 2009 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Sevbastian,

No it isn't :-). Names of the two do not look remotely similar.

Jos

Sebastian Zarnekow wrote:

> Jos,

> what's the name of your DataContractDslPackage? It's not crossx, is it?

> Regards,
> Sebastian
Re: [Xtext] Did you forget to configure the corresponding metamodel? [message #62158 is a reply to message #62133] Tue, 21 July 2009 16:42 Go to previous message
Eclipse UserFriend
Hi Jos,

the only thing that comes into my mind is a second EPackage with the
name "crossx" in your registry, but with another nsURI.
Maybe you want to iterate the registry's content and double check the
known metamodels?

Is your project open source or is there some way to peek at the sources?

Regards,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 21.07.2009 20:18 Uhr, schrieb Jos Warmer:
> Sevbastian,
>
> No it isn't :-). Names of the two do not look remotely similar.
>
> Jos
>
> Sebastian Zarnekow wrote:
>
>> Jos,
>
>> what's the name of your DataContractDslPackage? It's not crossx, is it?
>
>> Regards,
>> Sebastian
>
>
>
>
>
Previous Topic:OAW to TMF migration: ext allElements migration
Next Topic:Setting stereotype of an UML element
Goto Forum:
  


Current Time: Sat May 10 20:32:42 EDT 2025

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

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

Back to the top