Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Regarding XPand template file
Regarding XPand template file [message #431149] Tue, 30 June 2009 10:00 Go to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello All

I'm tryin 2 use XPand.I need 2 define an XPand template for a rule that
pertains to an external metamodel type.The metamodel file hierarchy is
somewhat like this:

platform:/resource/eu.q-impress.samm/model/samm.ecore(~ This is the
metamodel file).

The nsURI for the EClass is:

http://q-impress.eu/samm/staticstructure/PrimitiveComponent

where PrimitiveComponent is the EClass for which the rule is defined.

Now I have a concrete model for this PrimitiveComponent.
And the XPand template file is:
------------------------------------------------------------ ---------
«IMPORT edifice_proxy»;
«DEFINE def_1 FOR samm::staticstructure::PrimitiveComponent»
«FILE "pr_comp_temp.Ed_proxy" »
PrimitiveComponent «attribute.id»: «attribute.name»{
doc: «attribute.documentation»;
}

«ENDFILE»
«ENDDEFINE»
------------------------------------------------------------ ---------
Regarding XPand template file(contd..) [message #431150 is a reply to message #431149] Tue, 30 June 2009 10:04 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
And the generator.mwe file is:

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

<component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="src-gen"/>

<component class="org.eclipse.xtext.MweReader"
uri="classpath:/model/MyModel.Ed_proxy">
<!-- this class will be generated by the xtext generator -->
<register class="org.xtext.samm.Edifice_proxyStandaloneSetup"/>
</component>

<component class="org.eclipse.xpand2.Generator">
<metaModel
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<expand value="templates::PrimitiveComp_template::def_1 FOR
samm::staticstructure::PrimitiveComponent"/>
<genPath value="src-gen"/>
</component>

</workflow>
------------------------------------------------------------ --------------

the generator shows the following error:
0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.0, Build v200906091110
60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
C:/Users/Durga/workspace_TMF/org.xtext.samm.Edifice_proxy.ge nerator/src/workflow/Edifice_proxyGenerator.mwe
61 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
935 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri 'C:\Users\Durga\workspace_TMF'
2536 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory 'src-gen'
2537 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm.Edifice_proxy.ge nerator\src-gen
2538 [main] INFO e.core.container.CompositeComponent - MweReader:
loading file from classpath:/model/MyModel.Ed_proxy
3634 [main] INFO e.core.container.CompositeComponent - Generator:
generating 'templates::PrimitiveComp_template::def_1 FOR
samm::staticstructure::PrimitiveComponent' => []
3709 [main] ERROR org.eclipse.xpand2.Generator - Error in
Component of type org.eclipse.xpand2.Generator:
EvaluationException : Couldn't find enum literal or type
'samm::staticstructure::PrimitiveComponent'
[75,41] on line 1 'samm::staticstructure::PrimitiveComponent'

3709 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
interrupted. Reason: Couldn't find enum literal or type
'samm::staticstructure::PrimitiveComponent'
3710 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find enum literal or type
'samm::staticstructure::PrimitiveComponent'(Element:
samm::staticstructure::PrimitiveComponent; Reported by: Generator:
generating 'templates::PrimitiveComp_template::def_1 FOR
samm::staticstructure::PrimitiveComponent' => [])
3710 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find enum literal or type
'samm::staticstructure::PrimitiveComponent'(Element: EXPAND
templates::PrimitiveComp_template::def_1 FOR
samm::staticstructure::PrimitiveComponent; Reported by: Generator:
generating 'templates::PrimitiveComp_template::def_1 FOR
samm::staticstructure::PrimitiveComponent' => [])
------------------------------------------------------------ ------------

Can anybody pls tell where I'm goin wrong?

I'm confused why it can't find any reference to the metamodel EClass!!

Thanks

Durga
Re: Regarding XPand template file(contd..) [message #431155 is a reply to message #431150] Tue, 30 June 2009 10:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Dugra,

All the template languages are serviced by the M2T newsgroup, which I've
added to the "to" list of the reply.


Durga Prasana Sahoo wrote:
> And the generator.mwe file is:
>
> <workflow>
> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"
> platformUri=".."/>
>
> <component class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
> directory="src-gen"/>
>
> <component class="org.eclipse.xtext.MweReader"
> uri="classpath:/model/MyModel.Ed_proxy">
> <!-- this class will be generated by the xtext generator -->
> <register class="org.xtext.samm.Edifice_proxyStandaloneSetup"/>
> </component>
>
> <component class="org.eclipse.xpand2.Generator">
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <expand value="templates::PrimitiveComp_template::def_1 FOR
> samm::staticstructure::PrimitiveComponent"/>
> <genPath value="src-gen"/>
> </component>
>
> </workflow>
> ------------------------------------------------------------ --------------
>
>
> the generator shows the following error:
> 0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
> Workflow Engine 0.7.0, Build v200906091110
> 60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
> openarchitectureware.org and contributors
> 60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 60 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
> workflow:
> C:/Users/Durga/workspace_TMF/org.xtext.samm.Edifice_proxy.ge nerator/src/workflow/Edifice_proxyGenerator.mwe
>
> 61 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - 935 [main]
> INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri
> 'C:\Users\Durga\workspace_TMF'
> 2536 [main] INFO e.core.container.CompositeComponent -
> DirectoryCleaner: cleaning directory 'src-gen'
> 2537 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.samm.Edifice_proxy.ge nerator\src-gen
>
> 2538 [main] INFO e.core.container.CompositeComponent - MweReader:
> loading file from classpath:/model/MyModel.Ed_proxy
> 3634 [main] INFO e.core.container.CompositeComponent - Generator:
> generating 'templates::PrimitiveComp_template::def_1 FOR
> samm::staticstructure::PrimitiveComponent' => []
> 3709 [main] ERROR org.eclipse.xpand2.Generator - Error in
> Component of type org.eclipse.xpand2.Generator:
> EvaluationException : Couldn't find enum literal or type
> 'samm::staticstructure::PrimitiveComponent'
> [75,41] on line 1 'samm::staticstructure::PrimitiveComponent'
>
> 3709 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
> interrupted. Reason: Couldn't find enum literal or type
> 'samm::staticstructure::PrimitiveComponent'
> 3710 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find enum literal or type
> 'samm::staticstructure::PrimitiveComponent'(Element:
> samm::staticstructure::PrimitiveComponent; Reported by: Generator:
> generating 'templates::PrimitiveComp_template::def_1 FOR
> samm::staticstructure::PrimitiveComponent' => [])
> 3710 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
> Couldn't find enum literal or type
> 'samm::staticstructure::PrimitiveComponent'(Element: EXPAND
> templates::PrimitiveComp_template::def_1 FOR
> samm::staticstructure::PrimitiveComponent; Reported by: Generator:
> generating 'templates::PrimitiveComp_template::def_1 FOR
> samm::staticstructure::PrimitiveComponent' => [])
> ------------------------------------------------------------ ------------
>
> Can anybody pls tell where I'm goin wrong?
>
> I'm confused why it can't find any reference to the metamodel EClass!!
>
> Thanks
>
> Durga
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How is EDataType modeled to relate to its instances EString, EInt and so on
Next Topic:EReference on a default ID
Goto Forum:
  


Current Time: Fri Apr 26 02:31:10 GMT 2024

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

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

Back to the top