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?
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.
>
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.