Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtext+Xpand] Problem with MWE code generator workflow
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497729 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497732 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497735 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497766 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497771 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497785 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497790 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497796 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497803 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497808 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497812 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497814 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497817 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497818 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497828 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497837 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497840 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497845 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497848 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497863 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497877 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497879 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497883 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497896 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497897 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497919 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497927 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497932 is a reply to message #497260] Fri, 13 November 2009 07:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hi Steven,

you don't need to tell Xpand about the imported ecore files.
Xpand only needs to know about the types of any model elements.
As you're working on ecore models you have to register ecore.

You could either post the rest of your workflow file so we can help
identifying the problem or just switch over to the JavaBeans-mode, which
means that Xpand will work against Java types and not EClasses.
The EMF-mode is only needed (and recommended) if you need to work
against dynamic EMF. But in your case you have generated Java classes
for all your model elements (which is your DSL's ecore model and ecore
itself - not the imported ecore files!).

To do so register the corresponding metaModel in the workflow like in
the following :

<component class="....Generator"/>
<metaModel
class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>

....
</component>

Note that you'll have to switch from the simple namespaces to the java
ones :

<<IMPORT mypack>>

becomes

<<IMPORT org::my::javapackage>>

But that's basically all you'll have to do.

Cheers,
Sven

Steven Derrien schrieb:
> Hi again,
>
> Sebastian Zarnekow a écrit :
>> Hi Steven,
>>
>> I guess you are mixing things up. Why do you need to import the ecore
>> files in your grammar file _and_ in your workflow.
>
> Maybe my example was not very clear ...
>
> I don't import the ecore models in my DSL grammar, I import them in my
> DSL instances (I want a DSL to manipulate meta-models).
>
>> If the import mechanism works fine, there should be no need to import
>> them in your workflow explicitly.
>
> The import mecanism works fine since I can import ecore files in the
> generated editor, and I can use content assist to cross-link to Eclass
> objects defined in these imported ecore files.
>
> As mentioned in the first mail, the problem arise when I want to use the
> code generation MWE flow.
>
> Xpand complains that it cannot find the EClasses that I cross link from
> my DSL instance.
>
> Hope my explanations are not too messy :/
>
>> The consequence might by, that you end up with to instances of the
>> same EPackage which may lead to different EClasses for the same name.
>
> Thanks,
>
> Steven
>> Did you try to omit the import in the workflow file?
>>
>> Regards,
>> Sebastian


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497933 is a reply to message #497932] Fri, 13 November 2009 10:45 Go to previous messageGo to next message
Steven Derrien is currently offline Steven DerrienFriend
Messages: 50
Registered: July 2009
Member
Hi Sven and Sebastian,

Thank you very much for your support, I really appreciate It.

After reading twice your posts, I am still not sure wether we understand
each other. I packaged a complete example that reproduce the problem I
am facing. It it here

http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip

Basically I want to write a DSL that is used to retarget code written
for a meta-model to anotherone by defining a mapping between Eclass
objects of these two meta-models.

Here is a summary the key elements :

**** The Xtext DSL grammar : mydsl.xtext *******

grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/MyDsl"

import 'http://www.eclipse.org/emf/2002/Ecore' as ecore

TopLevel :
'mapping' name=ID '{'
(imports+=Import ';')*
(mappings+=Mapping)+
'}';

Mapping:
'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
Import :
'import' importURI=STRING;


**** An (correct) test file for this new DSL : model.mydsl ******

mapping test {
import
" platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
import
" platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";

from ASrcClass to BDstClass;
from BSrcClass to ADstClass;
}

**** EMFatic code for the metal models used in the example ****

@namespace(uri="http://source", prefix="source")
package source;

class ASrcClass {
attr String name ;
}

class BSrcClass {
attr String name ;
attr int value;
}


@namespace(uri="http://target", prefix="target")
package target;

class ADstClass {
attr String name ;
}

class BDstClass {
attr String name ;
attr int value;
}


**** An Xpand Template using the model build from model.mydsl ****


<<IMPORT myDsl>>;

<<EXTENSION templates::Extensions>>

<<DEFINE main FOR TopLevel->>
<<FILE "output.txt"->>

<<FOREACH this.mappings AS mapping>>
source is <<mapping.src.name>> .
destination is <<mapping.dst.name>> .
<<ENDFOREACH>>

<<ENDFILE->>
<<ENDDEFINE>>


**** The generator workflow ****

<workflow>
<property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
<property name="targetDir" value="src-gen"/>

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>

<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="${targetDir}"/>

<component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
<register class="org.xtext.example.MyDslStandaloneSetup"/>
</component>

<component class="org.eclipse.xpand2.Generator">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<fileEncoding value="UTF-8"/>
<expand value="templates::Template::main FOR model"/>
<genPath value="${targetDir}"/>
</component>
</workflow>


**** The workflow execution log file ****

1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.2, Build v200908120417
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
workflow:
/home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri '/home/sderrien/workspace'
1343 [main] INFO e.core.container.CompositeComponent -
DirectoryCleaner: cleaning directory 'src-gen'
1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
/home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
1346 [main] INFO e.core.container.CompositeComponent - MweReader:
loading file from classpath:/model/MyModel.mydsl
1767 [main] INFO e.core.container.CompositeComponent - Generator:
generating 'templates::Template::main FOR model' => []
2091 [main] INFO org.eclipse.xpand2.Generator - Written 1 files
to outlet [default](src-gen/)
2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
completed in 750ms!
2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Diagnosis of
org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
test; Reported by: MweReader: loading file from
classpath:/model/MyModel.mydsl)
2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Imported resource could not be found.(Element:
org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Imported resource could not be found.(Element:
org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)

Thanks in advance and Regards,

Steven

Sven Efftinge a écrit :
> Hi Steven,
>
> you don't need to tell Xpand about the imported ecore files.
> Xpand only needs to know about the types of any model elements.
> As you're working on ecore models you have to register ecore.
>
> You could either post the rest of your workflow file so we can help
> identifying the problem or just switch over to the JavaBeans-mode, which
> means that Xpand will work against Java types and not EClasses.
> The EMF-mode is only needed (and recommended) if you need to work
> against dynamic EMF. But in your case you have generated Java classes
> for all your model elements (which is your DSL's ecore model and ecore
> itself - not the imported ecore files!).
>
> To do so register the corresponding metaModel in the workflow like in
> the following :
>
> <component class="....Generator"/>
> <metaModel
> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>
> ....
> </component>
>
> Note that you'll have to switch from the simple namespaces to the java
> ones :
>
> <<IMPORT mypack>>
>
> becomes
>
> <<IMPORT org::my::javapackage>>
>
> But that's basically all you'll have to do.
>
> Cheers,
> Sven
>
> Steven Derrien schrieb:
>> Hi again,
>>
>> Sebastian Zarnekow a écrit :
>>> Hi Steven,
>>>
>>> I guess you are mixing things up. Why do you need to import the ecore
>>> files in your grammar file _and_ in your workflow.
>>
>> Maybe my example was not very clear ...
>>
>> I don't import the ecore models in my DSL grammar, I import them in my
>> DSL instances (I want a DSL to manipulate meta-models).
>>
>>> If the import mechanism works fine, there should be no need to import
>>> them in your workflow explicitly.
>>
>> The import mecanism works fine since I can import ecore files in the
>> generated editor, and I can use content assist to cross-link to Eclass
>> objects defined in these imported ecore files.
>>
>> As mentioned in the first mail, the problem arise when I want to use
>> the code generation MWE flow.
>>
>> Xpand complains that it cannot find the EClasses that I cross link
>> from my DSL instance.
>>
>> Hope my explanations are not too messy :/
>>
>>> The consequence might by, that you end up with to instances of the
>>> same EPackage which may lead to different EClasses for the same name.
>>
>> Thanks,
>>
>> Steven
>>> Did you try to omit the import in the workflow file?
>>>
>>> Regards,
>>> Sebastian
>
>
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497934 is a reply to message #497933] Fri, 13 November 2009 12:16 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Mmmhh looks ok.
There's a superfluos '/' in the platform:/resource URI.
I can imagine that the URI can not be resolved, because the underlying
URI map contains the entries with only one '/'.
I.e. try:

mapping test {
import
" platform:/resource/org.xtext.example.mydsl.generator/src/mod el/source.ecore ";


import
" platform:/resource/org.xtext.example.mydsl.generator/src/mod el/target.ecore ";


from ASrcClass to BDstClass;
from BSrcClass to ADstClass;
}


Steven Derrien schrieb:
> Hi Sven and Sebastian,
>
> Thank you very much for your support, I really appreciate It.
>
> After reading twice your posts, I am still not sure wether we understand
> each other. I packaged a complete example that reproduce the problem I
> am facing. It it here
>
> http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip
>
> Basically I want to write a DSL that is used to retarget code written
> for a meta-model to anotherone by defining a mapping between Eclass
> objects of these two meta-models.
>
> Here is a summary the key elements :
>
> **** The Xtext DSL grammar : mydsl.xtext *******
>
> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>
> generate myDsl "http://www.xtext.org/example/MyDsl"
>
> import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
>
> TopLevel :
> 'mapping' name=ID '{'
> (imports+=Import ';')*
> (mappings+=Mapping)+
> '}';
>
> Mapping:
> 'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
> Import :
> 'import' importURI=STRING;
>
>
> **** An (correct) test file for this new DSL : model.mydsl ******
>
> mapping test {
> import
> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
>
> import
> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";
>
>
> from ASrcClass to BDstClass;
> from BSrcClass to ADstClass;
> }
>
> **** EMFatic code for the metal models used in the example ****
>
> @namespace(uri="http://source", prefix="source")
> package source;
>
> class ASrcClass {
> attr String name ;
> }
>
> class BSrcClass {
> attr String name ;
> attr int value;
> }
>
>
> @namespace(uri="http://target", prefix="target")
> package target;
>
> class ADstClass {
> attr String name ;
> }
>
> class BDstClass {
> attr String name ;
> attr int value;
> }
>
>
> **** An Xpand Template using the model build from model.mydsl ****
>
>
> <<IMPORT myDsl>>;
>
> <<EXTENSION templates::Extensions>>
>
> <<DEFINE main FOR TopLevel->>
> <<FILE "output.txt"->>
>
> <<FOREACH this.mappings AS mapping>>
> source is <<mapping.src.name>> .
> destination is <<mapping.dst.name>> .
> <<ENDFOREACH>>
>
> <<ENDFILE->>
> <<ENDDEFINE>>
>
>
> **** The generator workflow ****
>
> <workflow>
> <property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
> <property name="targetDir" value="src-gen"/>
>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>
>
> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
> directory="${targetDir}"/>
>
> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
> <register class="org.xtext.example.MyDslStandaloneSetup"/>
> </component>
>
> <component class="org.eclipse.xpand2.Generator">
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <fileEncoding value="UTF-8"/>
> <expand value="templates::Template::main FOR model"/>
> <genPath value="${targetDir}"/>
> </component>
> </workflow>
>
>
> **** The workflow execution log file ****
>
> 1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
> Workflow Engine 0.7.2, Build v200908120417
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
> openarchitectureware.org and contributors
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
> workflow:
> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
>
> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> 540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
> platform uri '/home/sderrien/workspace'
> 1343 [main] INFO e.core.container.CompositeComponent -
> DirectoryCleaner: cleaning directory 'src-gen'
> 1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
> 1346 [main] INFO e.core.container.CompositeComponent - MweReader:
> loading file from classpath:/model/MyModel.mydsl
> 1767 [main] INFO e.core.container.CompositeComponent - Generator:
> generating 'templates::Template::main FOR model' => []
> 2091 [main] INFO org.eclipse.xpand2.Generator - Written 1 files
> to outlet [default](src-gen/)
> 2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
> completed in 750ms!
> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
> Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
> Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
> Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
> Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Diagnosis of
> org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
> test; Reported by: MweReader: loading file from
> classpath:/model/MyModel.mydsl)
> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Imported resource could not be found.(Element:
> org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
> 2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Imported resource could not be found.(Element:
> org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>
> Thanks in advance and Regards,
>
> Steven
>
> Sven Efftinge a écrit :
>> Hi Steven,
>>
>> you don't need to tell Xpand about the imported ecore files.
>> Xpand only needs to know about the types of any model elements.
>> As you're working on ecore models you have to register ecore.
>>
>> You could either post the rest of your workflow file so we can help
>> identifying the problem or just switch over to the JavaBeans-mode,
>> which means that Xpand will work against Java types and not EClasses.
>> The EMF-mode is only needed (and recommended) if you need to work
>> against dynamic EMF. But in your case you have generated Java classes
>> for all your model elements (which is your DSL's ecore model and ecore
>> itself - not the imported ecore files!).
>>
>> To do so register the corresponding metaModel in the workflow like in
>> the following :
>>
>> <component class="....Generator"/>
>> <metaModel
>> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>>
>> ....
>> </component>
>>
>> Note that you'll have to switch from the simple namespaces to the java
>> ones :
>>
>> <<IMPORT mypack>>
>>
>> becomes
>>
>> <<IMPORT org::my::javapackage>>
>>
>> But that's basically all you'll have to do.
>>
>> Cheers,
>> Sven
>>
>> Steven Derrien schrieb:
>>> Hi again,
>>>
>>> Sebastian Zarnekow a écrit :
>>>> Hi Steven,
>>>>
>>>> I guess you are mixing things up. Why do you need to import the
>>>> ecore files in your grammar file _and_ in your workflow.
>>>
>>> Maybe my example was not very clear ...
>>>
>>> I don't import the ecore models in my DSL grammar, I import them in
>>> my DSL instances (I want a DSL to manipulate meta-models).
>>>
>>>> If the import mechanism works fine, there should be no need to
>>>> import them in your workflow explicitly.
>>>
>>> The import mecanism works fine since I can import ecore files in the
>>> generated editor, and I can use content assist to cross-link to
>>> Eclass objects defined in these imported ecore files.
>>>
>>> As mentioned in the first mail, the problem arise when I want to use
>>> the code generation MWE flow.
>>>
>>> Xpand complains that it cannot find the EClasses that I cross link
>>> from my DSL instance.
>>>
>>> Hope my explanations are not too messy :/
>>>
>>>> The consequence might by, that you end up with to instances of the
>>>> same EPackage which may lead to different EClasses for the same name.
>>>
>>> Thanks,
>>>
>>> Steven
>>>> Did you try to omit the import in the workflow file?
>>>>
>>>> Regards,
>>>> Sebastian
>>
>>


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #497935 is a reply to message #497934] Fri, 13 November 2009 13:24 Go to previous messageGo to next message
Steven Derrien is currently offline Steven DerrienFriend
Messages: 50
Registered: July 2009
Member
Hi,

Sven Efftinge a écrit :

> Mmmhh looks ok.
> There's a superfluos '/' in the platform:/resource URI.
> I can imagine that the URI can not be resolved, because the underlying
> URI map contains the entries with only one '/'.

It works !

I didn't expected the problem to be a path issue, since the xtext
generated editor was happy with the import path I gave it.

Again, thanks you a lot for you help (also and for your great software)

Steven

> I.e. try:
>
> mapping test {
> import
> " platform:/resource/org.xtext.example.mydsl.generator/src/mod el/source.ecore ";
>
>
> import
> " platform:/resource/org.xtext.example.mydsl.generator/src/mod el/target.ecore ";
>
>
> from ASrcClass to BDstClass;
> from BSrcClass to ADstClass;
> }
>
>
> Steven Derrien schrieb:
>> Hi Sven and Sebastian,
>>
>> Thank you very much for your support, I really appreciate It.
>>
>> After reading twice your posts, I am still not sure wether we
>> understand each other. I packaged a complete example that reproduce
>> the problem I am facing. It it here
>>
>> http://www.irisa.fr/cosi/HOMEPAGE/Derrien/example_xtext.zip
>>
>> Basically I want to write a DSL that is used to retarget code written
>> for a meta-model to anotherone by defining a mapping between Eclass
>> objects of these two meta-models.
>>
>> Here is a summary the key elements :
>>
>> **** The Xtext DSL grammar : mydsl.xtext *******
>>
>> grammar org.xtext.example.MyDsl with org.eclipse.xtext.common.Terminals
>>
>> generate myDsl "http://www.xtext.org/example/MyDsl"
>>
>> import 'http://www.eclipse.org/emf/2002/Ecore' as ecore
>>
>> TopLevel :
>> 'mapping' name=ID '{'
>> (imports+=Import ';')*
>> (mappings+=Mapping)+
>> '}';
>>
>> Mapping:
>> 'from' src=[ecore::EClass] 'to' dst=[ecore::EClass] ';';
>> Import :
>> 'import' importURI=STRING;
>>
>>
>> **** An (correct) test file for this new DSL : model.mydsl ******
>>
>> mapping test {
>> import
>> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore ";
>>
>> import
>> " platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore ";
>>
>>
>> from ASrcClass to BDstClass;
>> from BSrcClass to ADstClass;
>> }
>>
>> **** EMFatic code for the metal models used in the example ****
>>
>> @namespace(uri="http://source", prefix="source")
>> package source;
>>
>> class ASrcClass {
>> attr String name ;
>> }
>>
>> class BSrcClass {
>> attr String name ;
>> attr int value;
>> }
>>
>>
>> @namespace(uri="http://target", prefix="target")
>> package target;
>>
>> class ADstClass {
>> attr String name ;
>> }
>>
>> class BDstClass {
>> attr String name ;
>> attr int value;
>> }
>>
>>
>> **** An Xpand Template using the model build from model.mydsl ****
>>
>>
>> <<IMPORT myDsl>>;
>>
>> <<EXTENSION templates::Extensions>>
>>
>> <<DEFINE main FOR TopLevel->>
>> <<FILE "output.txt"->>
>>
>> <<FOREACH this.mappings AS mapping>>
>> source is <<mapping.src.name>> .
>> destination is <<mapping.dst.name>> .
>> <<ENDFOREACH>>
>>
>> <<ENDFILE->>
>> <<ENDDEFINE>>
>>
>>
>> **** The generator workflow ****
>>
>> <workflow>
>> <property name="modelFile" value="classpath:/model/MyModel.mydsl"/>
>> <property name="targetDir" value="src-gen"/>
>>
>> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
>> platformUri=".."/>
>> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
>> directory="${targetDir}"/>
>> <component class="org.eclipse.xtext.MweReader" uri="${modelFile}">
>> <register class="org.xtext.example.MyDslStandaloneSetup"/>
>> </component>
>> <component class="org.eclipse.xpand2.Generator">
>> <metaModel
>> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
>> <fileEncoding value="UTF-8"/>
>> <expand value="templates::Template::main FOR model"/>
>> <genPath value="${targetDir}"/>
>> </component>
>> </workflow>
>>
>>
>> **** The workflow execution log file ****
>>
>> 1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> ------------------------------------------------------------ --------------------------
>>
>> 24 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
>> Workflow Engine 0.7.2, Build v200908120417
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
>> openarchitectureware.org and contributors
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> ------------------------------------------------------------ --------------------------
>>
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
>> workflow:
>> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc/workflow/MyDslGenerator.mwe
>>
>> 25 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
>> 540 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
>> platform uri '/home/sderrien/workspace'
>> 1343 [main] INFO e.core.container.CompositeComponent -
>> DirectoryCleaner: cleaning directory 'src-gen'
>> 1344 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
>> /home/sderrien/workspace/org.xtext.example.mydsl.generator/s rc-gen
>> 1346 [main] INFO e.core.container.CompositeComponent - MweReader:
>> loading file from classpath:/model/MyModel.mydsl
>> 1767 [main] INFO e.core.container.CompositeComponent - Generator:
>> generating 'templates::Template::main FOR model' => []
>> 2091 [main] INFO org.eclipse.xpand2.Generator - Written 1
>> files to outlet [default](src-gen/)
>> 2092 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - workflow
>> completed in 750ms!
>> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
>> Couldn't resolve reference to EClass ASrcClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2092 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(5):
>> Couldn't resolve reference to EClass BDstClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
>> Couldn't resolve reference to EClass BSrcClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> file:/home/sderrien/workspace/org.xtext.example.mydsl.genera tor/bin/model/MyModel.mydsl(6):
>> Couldn't resolve reference to EClass ADstClass(Element: -UNKNOWN-;
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Diagnosis of
>> org.xtext.example.myDsl.impl.TopLevelImpl@12aea3e {file:/home/sderrien/workspace/org.xtext.example.mydsl.gener ator/bin/model/MyModel.mydsl#/}(Element:
>> test; Reported by: MweReader: loading file from
>> classpath:/model/MyModel.mydsl)
>> 2093 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Imported resource could not be found.(Element:
>> org.xtext.example.myDsl.impl.ImportImpl@78bc3b (importURI:
>> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/source.ecore);
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>> 2094 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
>> Imported resource could not be found.(Element:
>> org.xtext.example.myDsl.impl.ImportImpl@17a1767 (importURI:
>> platform:/resource//org.xtext.example.mydsl.generator/src/mo del/target.ecore);
>> Reported by: MweReader: loading file from classpath:/model/MyModel.mydsl)
>>
>> Thanks in advance and Regards,
>>
>> Steven
>>
>> Sven Efftinge a écrit :
>>> Hi Steven,
>>>
>>> you don't need to tell Xpand about the imported ecore files.
>>> Xpand only needs to know about the types of any model elements.
>>> As you're working on ecore models you have to register ecore.
>>>
>>> You could either post the rest of your workflow file so we can help
>>> identifying the problem or just switch over to the JavaBeans-mode,
>>> which means that Xpand will work against Java types and not EClasses.
>>> The EMF-mode is only needed (and recommended) if you need to work
>>> against dynamic EMF. But in your case you have generated Java classes
>>> for all your model elements (which is your DSL's ecore model and
>>> ecore itself - not the imported ecore files!).
>>>
>>> To do so register the corresponding metaModel in the workflow like in
>>> the following :
>>>
>>> <component class="....Generator"/>
>>> <metaModel
>>> class=" org.eclipse.internal.xtend.type.impl.java.JavaBeansMetaModel "/>
>>>
>>> ....
>>> </component>
>>>
>>> Note that you'll have to switch from the simple namespaces to the
>>> java ones :
>>>
>>> <<IMPORT mypack>>
>>>
>>> becomes
>>>
>>> <<IMPORT org::my::javapackage>>
>>>
>>> But that's basically all you'll have to do.
>>>
>>> Cheers,
>>> Sven
>>>
>>> Steven Derrien schrieb:
>>>> Hi again,
>>>>
>>>> Sebastian Zarnekow a écrit :
>>>>> Hi Steven,
>>>>>
>>>>> I guess you are mixing things up. Why do you need to import the
>>>>> ecore files in your grammar file _and_ in your workflow.
>>>>
>>>> Maybe my example was not very clear ...
>>>>
>>>> I don't import the ecore models in my DSL grammar, I import them in
>>>> my DSL instances (I want a DSL to manipulate meta-models).
>>>>
>>>>> If the import mechanism works fine, there should be no need to
>>>>> import them in your workflow explicitly.
>>>>
>>>> The import mecanism works fine since I can import ecore files in the
>>>> generated editor, and I can use content assist to cross-link to
>>>> Eclass objects defined in these imported ecore files.
>>>>
>>>> As mentioned in the first mail, the problem arise when I want to use
>>>> the code generation MWE flow.
>>>>
>>>> Xpand complains that it cannot find the EClasses that I cross link
>>>> from my DSL instance.
>>>>
>>>> Hope my explanations are not too messy :/
>>>>
>>>>> The consequence might by, that you end up with to instances of the
>>>>> same EPackage which may lead to different EClasses for the same name.
>>>>
>>>> Thanks,
>>>>
>>>> Steven
>>>>> Did you try to omit the import in the workflow file?
>>>>>
>>>>> Regards,
>>>>> Sebastian
>>>
>>>
>
>
Re: [Xtext+Xpand] Problem with MWE code generator workflow [message #498249 is a reply to message #497175] Mon, 16 November 2009 08:33 Go to previous message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Steven,

would it be possible for you to use static EMF for your referenced EMF models? If yes, here is a blog where UML is used as referenced metamodel. Your case would be similar then:
http://chilifreak.wordpress.com/2009/11/06/xtext-using-uml-m odels/

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Previous Topic:XPAND and XSD adapter: root not found
Next Topic:Does Acceleo work with EMF?
Goto Forum:
  


Current Time: Fri Apr 26 23:16:13 GMT 2024

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

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

Back to the top