Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » XPand workflow problem
XPand workflow problem [message #63354] Tue, 30 June 2009 13:52 Go to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hi everyone,

I want to define an XPand template for a rule which is defined as follows
in XText:
----------------------------------------------------------
import "http://q-impress.eu/samm/staticstructure" as refn_staticstructure

..
..
Entity returns refn_core::Entity:
(NamedEntity | Connector | EndPoint | HardwareDescriptor)
;

NamedEntity returns refn_core::NamedEntity:
ComponentType | Type
;
..
..

PrimitiveComponent returns refn_staticstructure::PrimitiveComponent:
'PrimitiveComponent' id=STRING ':' name=STRING '{'
//parent attrib(s)
'doc:' documentation=STRING';'
//class specific attributes
'reqd:' (required+=InterfacePort)* ';'
'prov:'(provided+=InterfacePort)* ';'
'operBehv:' (OperationBehaviour+=OperationBehaviour)* ';'
'compTypeBehv:' (componentTypeBehaviour=ComponentTypeBehaviour)? ';'
'sink:' (sink+=EventPort)* ';'
'source:' (source+=EventPort)* ';'
'}'

;
-----------------------------------------------------------
The rule refers to an existing external metamodel EClass.

Now, I've defined a concrete metamodel for this grammar as:
-----------------------------------------------------------
PrimitiveComponent "pr_01":"pr_a"{
doc:"csabcb,am";
reqd:;
prov:;
operBehv:;
compTypeBehv:;
sink:;
source:;
}
-----------------------------------------------------------

I want to run the XPand generator for the above model.
My Xpand template is as follows:

-----------------------------------------------------------
«IMPORT edifice»;

«EXTENSION templates::Extensions»

«DEFINE def_outer FOR NamedEntity»
«EXPAND def_inner FOREACH elems.typeSelect(PrimitiveComponent)»
«ENDDEFINE»

«DEFINE def_inner FOR PrimitiveComponent»
«FILE name+".edifice" »
PrimitiveComponent «id»: «name»{
doc: «documentation»;
}

«ENDFILE»
«ENDDEFINE»
-----------------------------------------------------------

XPand workflow is as follows:

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

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="..">
<registerGeneratedEPackage
value="eu.qimpress.samm.staticstructure.StaticstructurePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.behaviour.BehaviourPackage"/>
<registerGeneratedEPackage
value=" eu.qimpress.samm.deployment.targetenvironment.Targetenvironm entPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.hardware.HardwarePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.allocation.AllocationPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.datatypes.DatatypesPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.annotation.AnnotationPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.usagemodel.UsagemodelPackage"/>
</bean>

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

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

<component class="org.eclipse.xpand2.Generator">
<metaModel
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
<expand value="templates::Template::def_outer FOR NamedEntity"/>
<genPath value="src-gen"/>
</component>

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

But the workflow shows the following error when I run it:

1 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
10 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.0, Build v200906091110
10 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
10 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
10 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
C:/Users/Durga/workspace_TMF/org.xtext.samm.Edifice.generato r/src/workflow/EdificeGenerator.mwe
10 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
676 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri 'C:\Users\Durga\workspace_TMF'
872 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
873 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
875 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage
'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
876 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
877 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
878 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
888 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
889 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
2009 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory 'src-gen'
2010 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm.Edifice.generato r\src-gen
2011 [main] INFO e.core.container.CompositeComponent - MweReader:
loading file from classpath:/model/MyModel.edifice
4103 [main] INFO e.core.container.CompositeComponent - Generator:
generating 'templates::Template::def_outer FOR refn_core::NamedEntity' =>
[]
4181 [main] ERROR org.eclipse.xpand2.Generator - Error in
Component of type org.eclipse.xpand2.Generator:
EvaluationException : Couldn't find enum literal or type
'refn_core::NamedEntity'
[65,22] on line 1 'refn_core::NamedEntity'

4182 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
interrupted. Reason: Couldn't find enum literal or type
'refn_core::NamedEntity'
4182 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]:
Diagnosis of
eu.qimpress.samm.staticstructure.impl.PrimitiveComponentImpl @c7e8a7{classpath:/model/MyModel.edifice#pr_01}(Element:
pr_a; Reported by: MweReader: loading file from
classpath:/model/MyModel.edifice)
4182 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: The
'HasToProvideOrRequireServices' invariant is violated on
'eu.qimpress.samm.staticstructure.impl.PrimitiveComponentImp l @c7e8a7{classpath:/model/MyModel.edifice#pr_01}'(Element:
pr_a; Reported by: MweReader: loading file from
classpath:/model/MyModel.edifice)
4182 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find enum literal or type 'refn_core::NamedEntity'(Element:
refn_core::NamedEntity; Reported by: Generator: generating
'templates::Template::def_outer FOR refn_core::NamedEntity' => [])
4182 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: Couldn't
find enum literal or type 'refn_core::NamedEntity'(Element: EXPAND
templates::Template::def_outer FOR refn_core::NamedEntity; Reported by:
Generator: generating 'templates::Template::def_outer FOR
refn_core::NamedEntity' => [])

------------------------------------------------------------ ----------

I'm surprised why it's unable to determine the rule that tht references!!

Can anyone suggest??

Thanks.

Durga
Re: XPand workflow problem [message #63382 is a reply to message #63354] Tue, 30 June 2009 16:48 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
Hi Durga,

in the workflow file ...

>
> <component class="org.eclipse.xpand2.Generator">
> <metaModel
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
> <expand value="templates::Template::def_outer FOR NamedEntity"/>

.... it must be

<expand value="templates::Template::def_outer FOR model"/>

instead.

Because the MWEReader by default makes the loaded model under that name
('model') available to other components.

The <expand/> element is actually an invocation, so you have to provide
a value to pass in, which is typically a model, which has been parsed
previously.
So the syntax is
<expand value="qualified::name::to::Template FOR someExpression"/>

Hope that helps,
Sven


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: XPand workflow problem [message #63497 is a reply to message #63382] Thu, 02 July 2009 11:13 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hello Sven

As u advised, I made the necessary changes, but that doesn't still help.

My workflow is now:

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

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri="..">
<registerGeneratedEPackage
value="eu.qimpress.samm.staticstructure.StaticstructurePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.behaviour.BehaviourPackage"/>
<registerGeneratedEPackage
value=" eu.qimpress.samm.deployment.targetenvironment.Targetenvironm entPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.hardware.HardwarePackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.deployment.allocation.AllocationPackage "/>
<registerGeneratedEPackage
value="eu.qimpress.samm.datatypes.DatatypesPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.annotation.AnnotationPackage"/>
<registerGeneratedEPackage
value="eu.qimpress.samm.usagemodel.UsagemodelPackage"/>
</bean>

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

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

<component class="org.eclipse.xpand2.Generator">
<!--metaModel
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "-->
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel"/>
<!--metaModelFile
value="platform:/resource/eu.qimpress.samm/model/samm.ecore "/>
</metaModel-->
<expand value="templates::Template::defn_PrimitiveDataType FOR model"/>
<genPath value="src-gen"/>
</component>

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

And my XPand template is:

------------------------------------------------------------ --
«EXTENSION templates::Extensions»

«DEFINE def_outer FOR Type»
«EXPAND def_inner FOREACH this.typeSelect(PrimitiveDataType)»
«ENDDEFINE»

«DEFINE defn_PrimitiveDataType FOR PrimitiveDataType»
«FILE name+".edifice" »
PrimitiveDatatype «id»: «name»{
doc: «documentation»;

«REM»
operBehv: «EXPAND defn_OperationBehaviour FOREACH OperationBehaviour»
compTypeBehv: «EXPAND defn_componentTypeBehaviour FOREACH
ComponentTypeBehaviour»
sink: «EXPAND defn_sink FOREACH EventPort»
source: «EXPAND defn_source FOREACH EventPort»
«ENDREM»
}

«ENDFILE»
«ENDDEFINE»

------------------------------------------------------------ ----------

But the error that I get when I run my workflow is:
0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
Workflow Engine 0.7.0, Build v200906091110
11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
openarchitectureware.org and contributors
11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
------------------------------------------------------------ --------------------------
11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running workflow:
C:/Users/Durga/workspace_TMF/org.xtext.samm.Edifice.generato r/src/workflow/EdificeGenerator.mwe
12 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
758 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering
platform uri 'C:\Users\Durga\workspace_TMF'
915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage
'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
917 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
917 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated
EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
1990 [main] INFO e.core.container.CompositeComponent - DirectoryCleaner:
cleaning directory 'src-gen'
1990 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
C:\Users\Durga\workspace_TMF\org.xtext.samm.Edifice.generato r\src-gen
1992 [main] INFO e.core.container.CompositeComponent - MweReader:
loading file from classpath:/model/MyModel.edifice
2702 [main] INFO e.core.container.CompositeComponent - Generator:
generating 'Template::defn_PrimitiveDataType FOR model' => []
2781 [main] ERROR org.eclipse.xpand2.Generator - Error in
Component of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'Template::defn_PrimitiveDataType for
datatypes::PrimitiveDataType' found!
[23,49] on line 1 'EXPAND Template::defn_PrimitiveDataType FOR model'

2781 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
interrupted. Reason: No Definition 'Template::defn_PrimitiveDataType for
datatypes::PrimitiveDataType' found!
2781 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: No
Definition 'Template::defn_PrimitiveDataType for
datatypes::PrimitiveDataType' found!(Element: EXPAND
Template::defn_PrimitiveDataType FOR model; Reported by: Generator:
generating 'Template::defn_PrimitiveDataType FOR model' => [])
------------------------------------------------------------ --------

It seems it's unable to find the definition in template file !!

Do I need to explicitly import the metamodel inspite of registering them
in the workflow ? I tried importing the metamodel even, but that doesn't
work..

any suggestions..

Thanks.

Durga
Re: XPand workflow problem [message #63720 is a reply to message #63497] Mon, 06 July 2009 11:51 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1771
Registered: July 2009
Senior Member
Hi Durga,

you need to import the namespace of the used types in your Xpand template.
Please add the following as the first line in your Xpand file.

<<IMPORT datatypes>>

Don't you get error markers in the template?

You need to add such an import for each used EPackage. In Xpand we use
the name attribute of an EPackage to compute qualified names of the
contained types.

Hope that helps,
Sven


Durga Prasana Sahoo schrieb:
> ------------------------------------------------------------ --
> «EXTENSION templates::Extensions»
>
> «DEFINE def_outer FOR Type»
> «EXPAND def_inner FOREACH this.typeSelect(PrimitiveDataType)»
> «ENDDEFINE»
>
> «DEFINE defn_PrimitiveDataType FOR PrimitiveDataType»
> «FILE name+".edifice" »
> PrimitiveDatatype «id»: «name»{
> doc: «documentation»;
>
> «REM»
> operBehv: «EXPAND defn_OperationBehaviour FOREACH
> OperationBehaviour»
> compTypeBehv: «EXPAND defn_componentTypeBehaviour FOREACH
> ComponentTypeBehaviour»
> sink: «EXPAND defn_sink FOREACH EventPort»
> source: «EXPAND defn_source FOREACH EventPort»
> «ENDREM»
> }
>
> «ENDFILE»
> «ENDDEFINE»
>
> ------------------------------------------------------------ ----------
>
> But the error that I get when I run my workflow is:
> 0 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - EMF Modeling
> Workflow Engine 0.7.0, Build v200906091110
> 11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - (c) 2005-2009
> openarchitectureware.org and contributors
> 11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner -
> ------------------------------------------------------------ --------------------------
>
> 11 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - running
> workflow:
> C:/Users/Durga/workspace_TMF/org.xtext.samm.Edifice.generato r/src/workflow/EdificeGenerator.mwe
>
> 12 [main] INFO eclipse.emf.mwe.core.WorkflowRunner - 758 [main]
> INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri
> 'C:\Users\Durga\workspace_TMF'
> 915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage
> 'eu.qimpress.samm.staticstructure.StaticstructurePackage'
> 915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage 'eu.qimpress.samm.behaviour.BehaviourPackage'
> 915 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage
> 'eu.qimpress.samm.deployment.targetenvironment.Targetenviron mentPackage'
> 916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage 'eu.qimpress.samm.deployment.hardware.HardwarePackage'
> 916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage
> 'eu.qimpress.samm.deployment.allocation.AllocationPackage'
> 916 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage 'eu.qimpress.samm.datatypes.DatatypesPackage'
> 917 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage 'eu.qimpress.samm.annotation.AnnotationPackage'
> 917 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding
> generated EPackage 'eu.qimpress.samm.usagemodel.UsagemodelPackage'
> 1990 [main] INFO e.core.container.CompositeComponent -
> DirectoryCleaner: cleaning directory 'src-gen'
> 1990 [main] INFO ipse.emf.mwe.utils.DirectoryCleaner - Cleaning
> C:\Users\Durga\workspace_TMF\org.xtext.samm.Edifice.generato r\src-gen
> 1992 [main] INFO e.core.container.CompositeComponent - MweReader:
> loading file from classpath:/model/MyModel.edifice
> 2702 [main] INFO e.core.container.CompositeComponent - Generator:
> generating 'Template::defn_PrimitiveDataType FOR model' => []
> 2781 [main] ERROR org.eclipse.xpand2.Generator - Error in
> Component of type org.eclipse.xpand2.Generator: EvaluationException
> : No Definition 'Template::defn_PrimitiveDataType for
> datatypes::PrimitiveDataType' found!
> [23,49] on line 1 'EXPAND Template::defn_PrimitiveDataType FOR model'
>
> 2781 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - Workflow
> interrupted. Reason: No Definition 'Template::defn_PrimitiveDataType for
> datatypes::PrimitiveDataType' found!
> 2781 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner - [ERROR]: No
> Definition 'Template::defn_PrimitiveDataType for
> datatypes::PrimitiveDataType' found!(Element: EXPAND
> Template::defn_PrimitiveDataType FOR model; Reported by: Generator:
> generating 'Template::defn_PrimitiveDataType FOR model' => [])
> ------------------------------------------------------------ --------
>
> It seems it's unable to find the definition in template file !!
>
> Do I need to explicitly import the metamodel inspite of registering them
> in the workflow ? I tried importing the metamodel even, but that doesn't
> work..
>
> any suggestions..
>
> Thanks.
>
> Durga
>
>
>


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: XPand workflow problem [message #63842 is a reply to message #63354] Tue, 07 July 2009 20:32 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 359
Registered: July 2009
Location: Dortmund
Senior Member

Hi Durga!

You are specifying

<expand value="templates::Template::def_outer FOR NamedEntity"/>

after FOR you name a type name, but Xpand expects an object of that
type. After FOR follows usually the name of the output slot in which a
reader component, here MweReader, writes. By default this is 'model'. So try
<expand value="templates::Template::def_outer FOR model"/>

~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: XPand workflow problem [message #63865 is a reply to message #63497] Wed, 08 July 2009 01:54 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 359
Registered: July 2009
Location: Dortmund
Senior Member

Hi Durga!

On 02.07.09 13:13, Durga Prasana Sahoo wrote:

Your expand value is
<expand value="templates::Template::defn_PrimitiveDataType FOR model"/>
but the error message is
> No Definition 'Template::defn_PrimitiveDataType for datatypes::PrimitiveDataType' found!
Also the log message says
> Generator: generating 'Template::defn_PrimitiveDataType FOR model' => []

This contradicts. I think you did not post the correct workflow. From what I read from the console output the package qualifier 'template::' is
missing in your expand value.
<expand value="templates::Template::defn_PrimitiveDataType FOR model"/>
Is just fine, and console log should print:
Generator: generating 'templates::Template::defn_PrimitiveDataType FOR model' => []

Kind regards,
~Karsten


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: XPand workflow problem [message #64001 is a reply to message #63842] Wed, 08 July 2009 21:33 Go to previous messageGo to next message
Durga Prasana Sahoo is currently offline Durga Prasana SahooFriend
Messages: 20
Registered: July 2009
Junior Member
Hi Karsten

Ya, Actually I was making the mistake of ' FOR somethingelse', which Sven
pointed out & I modified accordingly.

However, it seems really strange that the following workflow doesn't work:
____________________________________________________________ _________
<component class="org.eclipse.xpand2.Generator">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelFile
value="platform:/resource/eu.qimpress.samm/model/samm.ecore "/>
</metaModel>
<expand value="templates::Template::defn_PrimitiveComponent FOR model"/>
..
..
____________________________________________________________ _________

But the following workflow works:
____________________________________________________________ _________

<component class="org.eclipse.xpand2.Generator">
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="eu.qimpress.samm.datatypes.DatatypesPackage" />
</metaModel>
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="eu.qimpress.samm.behaviour.BehaviourPackage" />
</metaModel>
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage
value=" eu.qimpress.samm.deployment.targetenvironment.Targetenvironm entPackage "
/>
</metaModel>
<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage
value="eu.qimpress.samm.deployment.hardware.HardwarePackage " />
</metaModel>
<expand value="templates::Template::defn_PrimitiveComponent FOR model"/>
..
..
____________________________________________________________ __________

That is instead of specifying the entire metamodel file in just one step,
we have to rather specify the Packages in the metamodel file.

So, I'm just continuing using the second approach.It's quite surprising,
Since
the first approach is actually suggested in references.

Thanks a lot, still for all your help.

Durga
Re: XPand workflow problem [message #64116 is a reply to message #64001] Thu, 09 July 2009 21:31 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6485
Registered: July 2009
Senior Member
Hi,

hive used the documented feature with the metaModelFile and this worked
fine for me - what is the exception you get?

Christian
Previous Topic:Problem checking constraints on references with types from ecore meta model
Next Topic:error on context.getVariable
Goto Forum:
  


Current Time: Sun Nov 23 10:01:58 GMT 2014

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

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