Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [xPand]template doesn't recognise metamodel data
[xPand]template doesn't recognise metamodel data [message #376867] Thu, 19 April 2007 06:52 Go to next message
Chetan Kumar is currently offline Chetan Kumar
Messages: 70
Registered: July 2009
Member
Dear all,

I have a problem in writing xPand template. The situation is as follows:
1. i have a model (emf meta model) in a plugin.
2. i have an oAW plugin which has the workflow and templates
3. model plugin is added as a dependancy to the oAW plugin.

Now when I try to write template based on my emf meta model, xPand editor
shows the following errors: "Couldn't find Company", "unknown enumeration
literal or ... ". the template looks like so:
«IMPORT com::project::company»

«DEFINE Root FOR Company»
«EXPAND expandProject FOR project»
«ENDDEFINE»

«DEFINE expandEcu FOR Project»
«EXPAND expandEmp FOREACH employee»
«ENDDEFINE».....

i tried to ignore the errors and ran the workflow, then i got the
following exceptions:
workflow-description on line 1 'EXPAND template::Root::Root FOR model'
org.openarchitectureware.expression.EvaluationException: No Definition
'template::Root::Root for com.project.company::Company' found! in
(ExpandStatement.java:170)

in properties of the oAW plugin, EMF Meta model is checked. I tried
reloading the workbench, but still problem persists. Can anyone help me
out on this.

Thanks,
Chetan Kumar and Sandeepthi
Re: [xPand]template doesn't recognise metamodel data [message #376869 is a reply to message #376867] Fri, 20 April 2007 07:48 Go to previous messageGo to next message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
Hi,

I met the same problem a few weeks ago. It seems that the "EMF
Metamodel" property of the oaW plugin only works for Ecore models.
I solved the problem by creating a new extension
"org.openarchitectureware.base.metamodelContributor" that only handle my
own metamodel.

Regards,
Jacques

Chetan Kumar a écrit :
> Dear all,
>
> I have a problem in writing xPand template. The situation is as follows:
> 1. i have a model (emf meta model) in a plugin.
> 2. i have an oAW plugin which has the workflow and templates
> 3. model plugin is added as a dependancy to the oAW plugin.
>
> Now when I try to write template based on my emf meta model, xPand
> editor shows the following errors: "Couldn't find Company", "unknown
> enumeration literal or ... ". the template looks like so:
> «IMPORT com::project::company»
>
> «DEFINE Root FOR Company»
> «EXPAND expandProject FOR project»
> «ENDDEFINE»
>
> «DEFINE expandEcu FOR Project»
> «EXPAND expandEmp FOREACH employee»
> «ENDDEFINE».....
>
> i tried to ignore the errors and ran the workflow, then i got the
> following exceptions:
> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
> org.openarchitectureware.expression.EvaluationException: No Definition
> 'template::Root::Root for com.project.company::Company' found! in
> (ExpandStatement.java:170)
>
> in properties of the oAW plugin, EMF Meta model is checked. I tried
> reloading the workbench, but still problem persists. Can anyone help me
> out on this.
>
> Thanks,
> Chetan Kumar and Sandeepthi
>
Re: [xPand]template doesn't recognise metamodel data [message #376870 is a reply to message #376867] Sun, 22 April 2007 20:35 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1762
Registered: July 2009
Senior Member
Hi Chetan,

the *.ecore file must be in a source folder.

regards,
Sven


Chetan Kumar wrote:
> Dear all,
>
> I have a problem in writing xPand template. The situation is as follows:
> 1. i have a model (emf meta model) in a plugin.
> 2. i have an oAW plugin which has the workflow and templates
> 3. model plugin is added as a dependancy to the oAW plugin.
>
> Now when I try to write template based on my emf meta model, xPand
> editor shows the following errors: "Couldn't find Company", "unknown
> enumeration literal or ... ". the template looks like so:
> «IMPORT com::project::company»
>
> «DEFINE Root FOR Company»
> «EXPAND expandProject FOR project»
> «ENDDEFINE»
>
> «DEFINE expandEcu FOR Project»
> «EXPAND expandEmp FOREACH employee»
> «ENDDEFINE».....
>
> i tried to ignore the errors and ran the workflow, then i got the
> following exceptions:
> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
> org.openarchitectureware.expression.EvaluationException: No Definition
> 'template::Root::Root for com.project.company::Company' found! in
> (ExpandStatement.java:170)
>
> in properties of the oAW plugin, EMF Meta model is checked. I tried
> reloading the workbench, but still problem persists. Can anyone help me
> out on this.
>
> Thanks,
> Chetan Kumar and Sandeepthi
>


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [xPand]template doesn't recognise metamodel data [message #376874 is a reply to message #376869] Tue, 24 April 2007 08:36 Go to previous messageGo to next message
Sylvain is currently offline Sylvain
Messages: 40
Registered: July 2009
Member
Hi Jacques,

Can you precise how you did that ? did you extends EmfMetaModel with
your own MM ?

> Hi,
>
> I met the same problem a few weeks ago. It seems that the "EMF
> Metamodel" property of the oaW plugin only works for Ecore models.
> I solved the problem by creating a new extension
> "org.openarchitectureware.base.metamodelContributor" that only handle my
> own metamodel.
>
> Regards,
> Jacques
>
> Chetan Kumar a écrit :
>> Dear all,
>>
>> I have a problem in writing xPand template. The situation is as follows:
>> 1. i have a model (emf meta model) in a plugin.
>> 2. i have an oAW plugin which has the workflow and templates
>> 3. model plugin is added as a dependancy to the oAW plugin.
>>
>> Now when I try to write template based on my emf meta model, xPand
>> editor shows the following errors: "Couldn't find Company", "unknown
>> enumeration literal or ... ". the template looks like so:
>> «IMPORT com::project::company»
>>
>> «DEFINE Root FOR Company»
>> «EXPAND expandProject FOR project»
>> «ENDDEFINE»
>>
>> «DEFINE expandEcu FOR Project»
>> «EXPAND expandEmp FOREACH employee»
>> «ENDDEFINE».....
>>
>> i tried to ignore the errors and ran the workflow, then i got the
>> following exceptions:
>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>> org.openarchitectureware.expression.EvaluationException: No Definition
>> 'template::Root::Root for com.project.company::Company' found! in
>> (ExpandStatement.java:170)
>>
>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>> reloading the workbench, but still problem persists. Can anyone help me
>> out on this.
>>
>> Thanks,
>> Chetan Kumar and Sandeepthi
>>

--
Sylvain
Re: [xPand]template doesn't recognise metamodel data [message #376875 is a reply to message #376874] Tue, 24 April 2007 11:43 Go to previous messageGo to next message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
Yes, here are the two classes I made to contribute my own metamodel :

/**
* This class is then referenced by the
"org.openarchitectureware.base.metamodelContributor" extension
*/
public class DocBookMetamodelContributor implements MetamodelContributor
{
private DocBookMetaModel docbook = new DocBookMetaModel();

public MetaModel[] getMetamodels(final IJavaProject project, final
TypeSystem builtin)
{
return new MetaModel[] {docbook};
}

}


public class DocBookMetaModel extends EmfMetaModel
{
public DocBookMetaModel()
{
super(DocbookPackage.eINSTANCE);
}
}


But, as suggested Sven, the solution would be to include the ecore file
in a source folder. But I did not get this working, so I implemented
this solution.

Regards,
Jacques


Sylvain a écrit :
> Hi Jacques,
>
> Can you precise how you did that ? did you extends EmfMetaModel with
> your own MM ?
>
>> Hi,
>>
>> I met the same problem a few weeks ago. It seems that the "EMF
>> Metamodel" property of the oaW plugin only works for Ecore models.
>> I solved the problem by creating a new extension
>> "org.openarchitectureware.base.metamodelContributor" that only handle my
>> own metamodel.
>>
>> Regards,
>> Jacques
>>
>> Chetan Kumar a écrit :
>>> Dear all,
>>>
>>> I have a problem in writing xPand template. The situation is as
>>> follows:
>>> 1. i have a model (emf meta model) in a plugin.
>>> 2. i have an oAW plugin which has the workflow and templates
>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>
>>> Now when I try to write template based on my emf meta model, xPand
>>> editor shows the following errors: "Couldn't find Company", "unknown
>>> enumeration literal or ... ". the template looks like so:
>>> «IMPORT com::project::company»
>>>
>>> «DEFINE Root FOR Company»
>>> «EXPAND expandProject FOR project»
>>> «ENDDEFINE»
>>>
>>> «DEFINE expandEcu FOR Project»
>>> «EXPAND expandEmp FOREACH employee»
>>> «ENDDEFINE».....
>>>
>>> i tried to ignore the errors and ran the workflow, then i got the
>>> following exceptions:
>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>> 'template::Root::Root for com.project.company::Company' found! in
>>> (ExpandStatement.java:170)
>>>
>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>> reloading the workbench, but still problem persists. Can anyone help me
>>> out on this.
>>>
>>> Thanks,
>>> Chetan Kumar and Sandeepthi
>>>
>
Re: [xPand]template doesn't recognise metamodel data [message #376876 is a reply to message #376875] Tue, 24 April 2007 12:28 Go to previous messageGo to next message
Sylvain is currently offline Sylvain
Messages: 40
Registered: July 2009
Member
Thanks for the tips. Currently I have copied my MM in the source
folder..

> Yes, here are the two classes I made to contribute my own metamodel :
>
> /**
> * This class is then referenced by the
> "org.openarchitectureware.base.metamodelContributor" extension
> */
> public class DocBookMetamodelContributor implements MetamodelContributor
> {
> private DocBookMetaModel docbook = new DocBookMetaModel();
>
> public MetaModel[] getMetamodels(final IJavaProject project, final
> TypeSystem builtin)
> {
> return new MetaModel[] {docbook};
> }
>
> }
>
>
> public class DocBookMetaModel extends EmfMetaModel
> {
> public DocBookMetaModel()
> {
> super(DocbookPackage.eINSTANCE);
> }
> }
>
>
> But, as suggested Sven, the solution would be to include the ecore file
> in a source folder. But I did not get this working, so I implemented
> this solution.
>
> Regards,
> Jacques
>
>
> Sylvain a écrit :
>> Hi Jacques,
>>
>> Can you precise how you did that ? did you extends EmfMetaModel with
>> your own MM ?
>>
>>> Hi,
>>>
>>> I met the same problem a few weeks ago. It seems that the "EMF
>>> Metamodel" property of the oaW plugin only works for Ecore models.
>>> I solved the problem by creating a new extension
>>> "org.openarchitectureware.base.metamodelContributor" that only handle my
>>> own metamodel.
>>>
>>> Regards,
>>> Jacques
>>>
>>> Chetan Kumar a écrit :
>>>> Dear all,
>>>>
>>>> I have a problem in writing xPand template. The situation is as
>>>> follows:
>>>> 1. i have a model (emf meta model) in a plugin.
>>>> 2. i have an oAW plugin which has the workflow and templates
>>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>>
>>>> Now when I try to write template based on my emf meta model, xPand
>>>> editor shows the following errors: "Couldn't find Company", "unknown
>>>> enumeration literal or ... ". the template looks like so:
>>>> «IMPORT com::project::company»
>>>>
>>>> «DEFINE Root FOR Company»
>>>> «EXPAND expandProject FOR project»
>>>> «ENDDEFINE»
>>>>
>>>> «DEFINE expandEcu FOR Project»
>>>> «EXPAND expandEmp FOREACH employee»
>>>> «ENDDEFINE».....
>>>>
>>>> i tried to ignore the errors and ran the workflow, then i got the
>>>> following exceptions:
>>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>>> 'template::Root::Root for com.project.company::Company' found! in
>>>> (ExpandStatement.java:170)
>>>>
>>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>>> reloading the workbench, but still problem persists. Can anyone help me
>>>> out on this.
>>>>
>>>> Thanks,
>>>> Chetan Kumar and Sandeepthi
>>>>
>>

--
Sylvain
Re: [xPand]template doesn't recognise metamodel data [message #376878 is a reply to message #376876] Wed, 25 April 2007 06:53 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
In fact I forgot to add a dependency to my metamodel project. Now that
works fine without the code below. :-)

Sylvain a écrit :
> Thanks for the tips. Currently I have copied my MM in the source folder..
>
>> Yes, here are the two classes I made to contribute my own metamodel :
>>
>> /**
>> * This class is then referenced by the
>> "org.openarchitectureware.base.metamodelContributor" extension
>> */
>> public class DocBookMetamodelContributor implements MetamodelContributor
>> {
>> private DocBookMetaModel docbook = new DocBookMetaModel();
>>
>> public MetaModel[] getMetamodels(final IJavaProject project, final
>> TypeSystem builtin)
>> {
>> return new MetaModel[] {docbook};
>> }
>>
>> }
>>
>>
>> public class DocBookMetaModel extends EmfMetaModel
>> {
>> public DocBookMetaModel()
>> {
>> super(DocbookPackage.eINSTANCE);
>> }
>> }
>>
>>
>> But, as suggested Sven, the solution would be to include the ecore file
>> in a source folder. But I did not get this working, so I implemented
>> this solution.
>>
>> Regards,
>> Jacques
>>
>>
>> Sylvain a écrit :
>>> Hi Jacques,
>>>
>>> Can you precise how you did that ? did you extends EmfMetaModel with
>>> your own MM ?
>>>
>>>> Hi,
>>>>
>>>> I met the same problem a few weeks ago. It seems that the "EMF
>>>> Metamodel" property of the oaW plugin only works for Ecore models.
>>>> I solved the problem by creating a new extension
>>>> "org.openarchitectureware.base.metamodelContributor" that only
>>>> handle my
>>>> own metamodel.
>>>>
>>>> Regards,
>>>> Jacques
>>>>
>>>> Chetan Kumar a écrit :
>>>>> Dear all,
>>>>>
>>>>> I have a problem in writing xPand template. The situation is as
>>>>> follows:
>>>>> 1. i have a model (emf meta model) in a plugin.
>>>>> 2. i have an oAW plugin which has the workflow and templates
>>>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>>>
>>>>> Now when I try to write template based on my emf meta model, xPand
>>>>> editor shows the following errors: "Couldn't find Company", "unknown
>>>>> enumeration literal or ... ". the template looks like so:
>>>>> «IMPORT com::project::company»
>>>>>
>>>>> «DEFINE Root FOR Company»
>>>>> «EXPAND expandProject FOR project»
>>>>> «ENDDEFINE»
>>>>>
>>>>> «DEFINE expandEcu FOR Project»
>>>>> «EXPAND expandEmp FOREACH employee»
>>>>> «ENDDEFINE».....
>>>>>
>>>>> i tried to ignore the errors and ran the workflow, then i got the
>>>>> following exceptions:
>>>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>>>> 'template::Root::Root for com.project.company::Company' found! in
>>>>> (ExpandStatement.java:170)
>>>>>
>>>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>>>> reloading the workbench, but still problem persists. Can anyone
>>>>> help me
>>>>> out on this.
>>>>>
>>>>> Thanks,
>>>>> Chetan Kumar and Sandeepthi
>>>>>
>>>
>
Re: [xPand]template doesn't recognise metamodel data [message #580346 is a reply to message #376867] Fri, 20 April 2007 07:48 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
Hi,

I met the same problem a few weeks ago. It seems that the "EMF
Metamodel" property of the oaW plugin only works for Ecore models.
I solved the problem by creating a new extension
"org.openarchitectureware.base.metamodelContributor" that only handle my
own metamodel.

Regards,
Jacques

Chetan Kumar a écrit :
> Dear all,
>
> I have a problem in writing xPand template. The situation is as follows:
> 1. i have a model (emf meta model) in a plugin.
> 2. i have an oAW plugin which has the workflow and templates
> 3. model plugin is added as a dependancy to the oAW plugin.
>
> Now when I try to write template based on my emf meta model, xPand
> editor shows the following errors: "Couldn't find Company", "unknown
> enumeration literal or ... ". the template looks like so:
> «IMPORT com::project::company»
>
> «DEFINE Root FOR Company»
> «EXPAND expandProject FOR project»
> «ENDDEFINE»
>
> «DEFINE expandEcu FOR Project»
> «EXPAND expandEmp FOREACH employee»
> «ENDDEFINE».....
>
> i tried to ignore the errors and ran the workflow, then i got the
> following exceptions:
> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
> org.openarchitectureware.expression.EvaluationException: No Definition
> 'template::Root::Root for com.project.company::Company' found! in
> (ExpandStatement.java:170)
>
> in properties of the oAW plugin, EMF Meta model is checked. I tried
> reloading the workbench, but still problem persists. Can anyone help me
> out on this.
>
> Thanks,
> Chetan Kumar and Sandeepthi
>
Re: [xPand]template doesn't recognise metamodel data [message #580368 is a reply to message #376867] Sun, 22 April 2007 20:35 Go to previous message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1762
Registered: July 2009
Senior Member
Hi Chetan,

the *.ecore file must be in a source folder.

regards,
Sven


Chetan Kumar wrote:
> Dear all,
>
> I have a problem in writing xPand template. The situation is as follows:
> 1. i have a model (emf meta model) in a plugin.
> 2. i have an oAW plugin which has the workflow and templates
> 3. model plugin is added as a dependancy to the oAW plugin.
>
> Now when I try to write template based on my emf meta model, xPand
> editor shows the following errors: "Couldn't find Company", "unknown
> enumeration literal or ... ". the template looks like so:
> «IMPORT com::project::company»
>
> «DEFINE Root FOR Company»
> «EXPAND expandProject FOR project»
> «ENDDEFINE»
>
> «DEFINE expandEcu FOR Project»
> «EXPAND expandEmp FOREACH employee»
> «ENDDEFINE».....
>
> i tried to ignore the errors and ran the workflow, then i got the
> following exceptions:
> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
> org.openarchitectureware.expression.EvaluationException: No Definition
> 'template::Root::Root for com.project.company::Company' found! in
> (ExpandStatement.java:170)
>
> in properties of the oAW plugin, EMF Meta model is checked. I tried
> reloading the workbench, but still problem persists. Can anyone help me
> out on this.
>
> Thanks,
> Chetan Kumar and Sandeepthi
>


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [xPand]template doesn't recognise metamodel data [message #580531 is a reply to message #376869] Tue, 24 April 2007 08:36 Go to previous message
Sylvain is currently offline Sylvain
Messages: 40
Registered: July 2009
Member
Hi Jacques,

Can you precise how you did that ? did you extends EmfMetaModel with
your own MM ?

> Hi,
>
> I met the same problem a few weeks ago. It seems that the "EMF
> Metamodel" property of the oaW plugin only works for Ecore models.
> I solved the problem by creating a new extension
> "org.openarchitectureware.base.metamodelContributor" that only handle my
> own metamodel.
>
> Regards,
> Jacques
>
> Chetan Kumar a écrit :
>> Dear all,
>>
>> I have a problem in writing xPand template. The situation is as follows:
>> 1. i have a model (emf meta model) in a plugin.
>> 2. i have an oAW plugin which has the workflow and templates
>> 3. model plugin is added as a dependancy to the oAW plugin.
>>
>> Now when I try to write template based on my emf meta model, xPand
>> editor shows the following errors: "Couldn't find Company", "unknown
>> enumeration literal or ... ". the template looks like so:
>> «IMPORT com::project::company»
>>
>> «DEFINE Root FOR Company»
>> «EXPAND expandProject FOR project»
>> «ENDDEFINE»
>>
>> «DEFINE expandEcu FOR Project»
>> «EXPAND expandEmp FOREACH employee»
>> «ENDDEFINE».....
>>
>> i tried to ignore the errors and ran the workflow, then i got the
>> following exceptions:
>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>> org.openarchitectureware.expression.EvaluationException: No Definition
>> 'template::Root::Root for com.project.company::Company' found! in
>> (ExpandStatement.java:170)
>>
>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>> reloading the workbench, but still problem persists. Can anyone help me
>> out on this.
>>
>> Thanks,
>> Chetan Kumar and Sandeepthi
>>

--
Sylvain
Re: [xPand]template doesn't recognise metamodel data [message #580578 is a reply to message #376874] Tue, 24 April 2007 11:43 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
Yes, here are the two classes I made to contribute my own metamodel :

/**
* This class is then referenced by the
"org.openarchitectureware.base.metamodelContributor" extension
*/
public class DocBookMetamodelContributor implements MetamodelContributor
{
private DocBookMetaModel docbook = new DocBookMetaModel();

public MetaModel[] getMetamodels(final IJavaProject project, final
TypeSystem builtin)
{
return new MetaModel[] {docbook};
}

}


public class DocBookMetaModel extends EmfMetaModel
{
public DocBookMetaModel()
{
super(DocbookPackage.eINSTANCE);
}
}


But, as suggested Sven, the solution would be to include the ecore file
in a source folder. But I did not get this working, so I implemented
this solution.

Regards,
Jacques


Sylvain a écrit :
> Hi Jacques,
>
> Can you precise how you did that ? did you extends EmfMetaModel with
> your own MM ?
>
>> Hi,
>>
>> I met the same problem a few weeks ago. It seems that the "EMF
>> Metamodel" property of the oaW plugin only works for Ecore models.
>> I solved the problem by creating a new extension
>> "org.openarchitectureware.base.metamodelContributor" that only handle my
>> own metamodel.
>>
>> Regards,
>> Jacques
>>
>> Chetan Kumar a écrit :
>>> Dear all,
>>>
>>> I have a problem in writing xPand template. The situation is as
>>> follows:
>>> 1. i have a model (emf meta model) in a plugin.
>>> 2. i have an oAW plugin which has the workflow and templates
>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>
>>> Now when I try to write template based on my emf meta model, xPand
>>> editor shows the following errors: "Couldn't find Company", "unknown
>>> enumeration literal or ... ". the template looks like so:
>>> «IMPORT com::project::company»
>>>
>>> «DEFINE Root FOR Company»
>>> «EXPAND expandProject FOR project»
>>> «ENDDEFINE»
>>>
>>> «DEFINE expandEcu FOR Project»
>>> «EXPAND expandEmp FOREACH employee»
>>> «ENDDEFINE».....
>>>
>>> i tried to ignore the errors and ran the workflow, then i got the
>>> following exceptions:
>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>> 'template::Root::Root for com.project.company::Company' found! in
>>> (ExpandStatement.java:170)
>>>
>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>> reloading the workbench, but still problem persists. Can anyone help me
>>> out on this.
>>>
>>> Thanks,
>>> Chetan Kumar and Sandeepthi
>>>
>
Re: [xPand]template doesn't recognise metamodel data [message #580599 is a reply to message #376875] Tue, 24 April 2007 12:28 Go to previous message
Sylvain is currently offline Sylvain
Messages: 40
Registered: July 2009
Member
Thanks for the tips. Currently I have copied my MM in the source
folder..

> Yes, here are the two classes I made to contribute my own metamodel :
>
> /**
> * This class is then referenced by the
> "org.openarchitectureware.base.metamodelContributor" extension
> */
> public class DocBookMetamodelContributor implements MetamodelContributor
> {
> private DocBookMetaModel docbook = new DocBookMetaModel();
>
> public MetaModel[] getMetamodels(final IJavaProject project, final
> TypeSystem builtin)
> {
> return new MetaModel[] {docbook};
> }
>
> }
>
>
> public class DocBookMetaModel extends EmfMetaModel
> {
> public DocBookMetaModel()
> {
> super(DocbookPackage.eINSTANCE);
> }
> }
>
>
> But, as suggested Sven, the solution would be to include the ecore file
> in a source folder. But I did not get this working, so I implemented
> this solution.
>
> Regards,
> Jacques
>
>
> Sylvain a écrit :
>> Hi Jacques,
>>
>> Can you precise how you did that ? did you extends EmfMetaModel with
>> your own MM ?
>>
>>> Hi,
>>>
>>> I met the same problem a few weeks ago. It seems that the "EMF
>>> Metamodel" property of the oaW plugin only works for Ecore models.
>>> I solved the problem by creating a new extension
>>> "org.openarchitectureware.base.metamodelContributor" that only handle my
>>> own metamodel.
>>>
>>> Regards,
>>> Jacques
>>>
>>> Chetan Kumar a écrit :
>>>> Dear all,
>>>>
>>>> I have a problem in writing xPand template. The situation is as
>>>> follows:
>>>> 1. i have a model (emf meta model) in a plugin.
>>>> 2. i have an oAW plugin which has the workflow and templates
>>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>>
>>>> Now when I try to write template based on my emf meta model, xPand
>>>> editor shows the following errors: "Couldn't find Company", "unknown
>>>> enumeration literal or ... ". the template looks like so:
>>>> «IMPORT com::project::company»
>>>>
>>>> «DEFINE Root FOR Company»
>>>> «EXPAND expandProject FOR project»
>>>> «ENDDEFINE»
>>>>
>>>> «DEFINE expandEcu FOR Project»
>>>> «EXPAND expandEmp FOREACH employee»
>>>> «ENDDEFINE».....
>>>>
>>>> i tried to ignore the errors and ran the workflow, then i got the
>>>> following exceptions:
>>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>>> 'template::Root::Root for com.project.company::Company' found! in
>>>> (ExpandStatement.java:170)
>>>>
>>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>>> reloading the workbench, but still problem persists. Can anyone help me
>>>> out on this.
>>>>
>>>> Thanks,
>>>> Chetan Kumar and Sandeepthi
>>>>
>>

--
Sylvain
Re: [xPand]template doesn't recognise metamodel data [message #580676 is a reply to message #376876] Wed, 25 April 2007 06:53 Go to previous message
Jacques LESCOT is currently offline Jacques LESCOT
Messages: 247
Registered: July 2009
Senior Member
In fact I forgot to add a dependency to my metamodel project. Now that
works fine without the code below. :-)

Sylvain a écrit :
> Thanks for the tips. Currently I have copied my MM in the source folder..
>
>> Yes, here are the two classes I made to contribute my own metamodel :
>>
>> /**
>> * This class is then referenced by the
>> "org.openarchitectureware.base.metamodelContributor" extension
>> */
>> public class DocBookMetamodelContributor implements MetamodelContributor
>> {
>> private DocBookMetaModel docbook = new DocBookMetaModel();
>>
>> public MetaModel[] getMetamodels(final IJavaProject project, final
>> TypeSystem builtin)
>> {
>> return new MetaModel[] {docbook};
>> }
>>
>> }
>>
>>
>> public class DocBookMetaModel extends EmfMetaModel
>> {
>> public DocBookMetaModel()
>> {
>> super(DocbookPackage.eINSTANCE);
>> }
>> }
>>
>>
>> But, as suggested Sven, the solution would be to include the ecore file
>> in a source folder. But I did not get this working, so I implemented
>> this solution.
>>
>> Regards,
>> Jacques
>>
>>
>> Sylvain a écrit :
>>> Hi Jacques,
>>>
>>> Can you precise how you did that ? did you extends EmfMetaModel with
>>> your own MM ?
>>>
>>>> Hi,
>>>>
>>>> I met the same problem a few weeks ago. It seems that the "EMF
>>>> Metamodel" property of the oaW plugin only works for Ecore models.
>>>> I solved the problem by creating a new extension
>>>> "org.openarchitectureware.base.metamodelContributor" that only
>>>> handle my
>>>> own metamodel.
>>>>
>>>> Regards,
>>>> Jacques
>>>>
>>>> Chetan Kumar a écrit :
>>>>> Dear all,
>>>>>
>>>>> I have a problem in writing xPand template. The situation is as
>>>>> follows:
>>>>> 1. i have a model (emf meta model) in a plugin.
>>>>> 2. i have an oAW plugin which has the workflow and templates
>>>>> 3. model plugin is added as a dependancy to the oAW plugin.
>>>>>
>>>>> Now when I try to write template based on my emf meta model, xPand
>>>>> editor shows the following errors: "Couldn't find Company", "unknown
>>>>> enumeration literal or ... ". the template looks like so:
>>>>> «IMPORT com::project::company»
>>>>>
>>>>> «DEFINE Root FOR Company»
>>>>> «EXPAND expandProject FOR project»
>>>>> «ENDDEFINE»
>>>>>
>>>>> «DEFINE expandEcu FOR Project»
>>>>> «EXPAND expandEmp FOREACH employee»
>>>>> «ENDDEFINE».....
>>>>>
>>>>> i tried to ignore the errors and ran the workflow, then i got the
>>>>> following exceptions:
>>>>> workflow-description on line 1 'EXPAND template::Root::Root FOR model'
>>>>> org.openarchitectureware.expression.EvaluationException: No Definition
>>>>> 'template::Root::Root for com.project.company::Company' found! in
>>>>> (ExpandStatement.java:170)
>>>>>
>>>>> in properties of the oAW plugin, EMF Meta model is checked. I tried
>>>>> reloading the workbench, but still problem persists. Can anyone
>>>>> help me
>>>>> out on this.
>>>>>
>>>>> Thanks,
>>>>> Chetan Kumar and Sandeepthi
>>>>>
>>>
>
Previous Topic:[TCS] About MetaModels used for injection
Next Topic:[MOFScript] Encoding problem
Goto Forum:
  


Current Time: Wed Sep 24 02:42:03 GMT 2014

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

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