Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross-references to external EMF models (revisited)
Cross-references to external EMF models (revisited) [message #550914] Wed, 04 August 2010 11:49 Go to next message
Joern is currently offline Joern
Messages: 22
Registered: March 2010
Junior Member
I try to reference elements given in external EMF models as Andreas in http://www.eclipse.org/forums/index.php?t=msg&th=170756& amp;start=0&S=81127b7c17990f3eddb47e01037a6405.

Therefore I adapted the solution given in org.eclipse.xtext.ecore and org.eclipse.xtext.ui.ecore for "my" language (here: bpmn2 from the corresponding Eclipse project). Nevertheless if I „import" the (process) model in my DSL I cannot reference the elements (e.g. the auto completion does not show the elements given in the model). Referencing elements from plain Ecore models does work.

Debugging the DSL editor I found that the "resource" member in BpmnResourceDescription (cf. EcoreResourceDescription) does not contain elements and reports two errors: PackageNotFoundException and ClassNotFoundException for the imported (process) model and it's URI.

Do I have to register the metamodel somewhere within xText, e.g. in the MWE2 workflow (editing process models within the generated Ecore editor works)? Or something else?

Thank you in advance.
Re: Cross-references to external EMF models (revisited) [message #551084 is a reply to message #550914] Thu, 05 August 2010 03:26 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1759
Registered: July 2009
Senior Member
You don't need to register the EPackage with Xtext. Xtext relies on
EMF's registry.

Make sure, the bundle containing the EPackage has a valid plugin.xml and
is activated successfully. (i.e. can you use the EPackage directly?)

Sven

Am 8/4/10 5:49 PM, schrieb Joern:
> I try to reference elements given in external EMF models as Andreas in
> http://www.eclipse.org/forums/index.php?t=msg&th=170756& amp;start=0&S=81127b7c17990f3eddb47e01037a6405
>
>
> Therefore I adapted the solution given in org.eclipse.xtext.ecore and
> org.eclipse.xtext.ui.ecore for "my" language (here: bpmn2 from the
> corresponding Eclipse project). Nevertheless if I „import" the (process)
> model in my DSL I cannot reference the elements (e.g. the auto
> completion does not show the elements given in the model). Referencing
> elements from plain Ecore models does work.
> Debugging the DSL editor I found that the "resource" member in
> BpmnResourceDescription (cf. EcoreResourceDescription) does not contain
> elements and reports two errors: PackageNotFoundException and
> ClassNotFoundException for the imported (process) model and it's URI.
>
> Do I have to register the metamodel somewhere within xText, e.g. in the
> MWE2 workflow (editing process models within the generated Ecore editor
> works)? Or something else?
>
> Thank you in advance.
>


--
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Cross-references to external EMF models (revisited) [message #551699 is a reply to message #551084] Mon, 09 August 2010 04:45 Go to previous message
Joern is currently offline Joern
Messages: 22
Registered: March 2010
Junior Member
Thanks, that helped: BPMN2 does only export the XMI-related namespace, not the one for the XSD serialization in the plugin.xml. I will add a comment in the corresponding forum.

Cheers,

Joern
Previous Topic:[MWE2] Accessing the current workspace from a workflow component
Next Topic:Combining two DSLs
Goto Forum:
  


Current Time: Mon Jul 28 02:16:56 EDT 2014

Powered by FUDForum. Page generated in 0.02840 seconds