Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [XPAND] XPand and Partitioning Ecore is possible ?(With a multiple ecore file metamodel, non-root class are not found)
icon5.gif  [XPAND] XPand and Partitioning Ecore is possible ? [message #513530] Wed, 10 February 2010 13:59 Go to next message
Florine Boudin is currently offline Florine BoudinFriend
Messages: 3
Registered: July 2009
Location: Grenoble, France
Junior Member

Hi everyone,

I have a problem to generate files with XPand when my metamodel is a multiple ecore files.

To have a clear metamodel for my EMF editor, i made a 'partitioned' one.
A problem appears when i try to generate files with Xpand. It doesn't find the Class which are not in the root Ecore file, and i can't define the functions...

But, if i call them by hierarchy (and make an horrible single DEFINE function it works...) everything is OK he finds all the classes i call.

I checked the dependencies in the MANIFEST.MF and everything is OK.

The problem seems to come from my definition but i have no idea to do it in an other way.
Or maybe it is impossible to associate Xpand with a multiple file metamodel ?

If anybody already had this problem, or if you know the possibility (or impossibility Sad ) to do this, it will be really helpfull...

Thanks !

Florine


Simple Example:
The root Ecore file has the Procedure Class.
An other Ecore file has the RobotTask Class.
The Class Procedure has EReference to a List of RobotTask.

.xpt file code :
«IMPORT procedure »
«IMPORT robot »

«DEFINE RobotDef FOR RobotTask»
	Bla bla...
«ENDDEFINE»

«DEFINE Root FOR Procedure»
		«EXPAND RobotDef FOREACH hasTaskRobot»
«ENDDEFINE»


Error detected :
SEVERE: Error in Component generator of type org.openarchitectureware.xpand2.Generator: 
	EvaluationException : No Definition 'RobotDef for robot::RobotTask' found!
	templates::Root.xpt[206,36] on line 15 'EXPAND RobotDef FOREACH hasTaskRobot'
	[23,38] on line 1 'EXPAND templates::Root::Root FOR model'     
 

[Updated on: Wed, 10 February 2010 14:02]

Report message to a moderator

Re: [XPAND] XPand and Partitioning Ecore is possible ? [message #513539 is a reply to message #513530] Wed, 10 February 2010 14:22 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Splitting models or metamodels is no problem. Make sure that you always use platform resource URIs. Make sure that you declare every metamodel package in the StandaloneSetup.

HTH,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [XPAND] XPand and Partitioning Ecore is possible [message #513582 is a reply to message #513530] Wed, 10 February 2010 10:54 Go to previous messageGo to next message
ekkehard gentz is currently offline ekkehard gentzFriend
Messages: 118
Registered: July 2009
Location: rosenheim, Germany, bavar...
Senior Member

This is a multi-part message in MIME format.
--------------050606010808040007000704
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

florine,

this should work. redview (http://redview.org) uses always some ecore files

register them all:

<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value=".." />
<registerEcoreFile value="${redview.mm.dir.uri}binding.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}datatypes.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}elements.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}layout.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}styles.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}validation.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}converter.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}visibility.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}dnd.ecore"/>
<registerEcoreFile value="${redview.mm.dir.uri}events.ecore"/>

<registerEcoreFile value="${redview.mm.ext.riena.dir.uri}validators.ecore"/>
<registerEcoreFile value="${redview.mm.ext.riena.dir.uri}converters.ecore"/>
</bean>

as karsten said - use URIs - not Pathes

ekke

Am 10.02.10 14:59, schrieb Florine Boudin:
> Hi everyone,
>
> I have a problem to generate files with XPand when my metamodel is a
> multiple ecore files.
>
> To have a clear metamodel for my EMF editor, i made a 'partitioned' one.
> A problem appears when i try to generate files with Xpand. It doesn't
> find the Class which are not in the root Ecore file, and i can't
> define the functions...
>
> But, if i call them by hierarchy (and make an horrible single DEFINE
> function it works...) everything is OK he finds all the classes i call.
>
> I checked the dependencies in the MANIFEST.MF and everything is OK.
>
> The problem seems to come from my definition but i have no idea to do
> it in an other way.
> Or maybe it is impossible to associate Xpand with a multiple file
> metamodel ?
>
> If anybody already had this problem, or if you know the possibility
> (or impossibility :( ) to do this, it will be really helpfull...
>
> Thanks !
>
> Florine
>
>
> Simple Example:
> The root Ecore file has the Procedure Class.
> An other Ecore file has the RobotTask Class.
> The Class Procedure has EReference to a List of RobotTask.
> xpt file code :
>
> «IMPORT procedure »
> «IMPORT robot »
>
> «DEFINE RobotDef FOR RobotTask»
> Bla bla...
> «ENDDEFINE»
>
> «DEFINE Root FOR Procedure»
> «EXPAND RobotDef FOREACH hasTaskRobot»
> «ENDDEFINE»
>
>
> Error detected :
>
> SEVERE: Error in Component generator of type
> org.openarchitectureware.xpand2.Generator: EvaluationException :
> No Definition 'RobotDef for robot::RobotTask' found!
> templates::Root.xpt[206,36] on line 15 'EXPAND RobotDef FOREACH
> hasTaskRobot'
> [23,38] on line 1 'EXPAND templates::Root::Root FOR model'


--

ekke (ekkehard gentz)
independent software-architect
senior erp-consultant
eclipse | osgi | equinox | mdsd | oaw | emf | uml
max-josefs-platz 30, D-83022 rosenheim, germany
mailto:ekke@ekkes-corner.org
homepage (de): http://gentz-software.de
blog (en): http://ekkes-corner.org
twitter: @ekkescorner
skype: ekkes-corner
Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID: DE189929490


--------------050606010808040007000704
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
florine,<br>
<br>
this should work. redview (<a class="moz-txt-link-freetext" href="http://redview.org">http://redview.org</a>) uses always some ecore
files<br>
<br>
register them all:<br>
<br>
    &lt;bean class="org.eclipse.emf.mwe.utils.StandaloneSetup"&gt;<br >
        &lt;platformUri value=".." /&gt;   <br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}binding.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}datatypes.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}elements.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}layout.ecore"/&gt;    <br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}styles.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}validation.ecore"/&gt;<br >
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}converter.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}visibility.ecore"/&gt;<br >
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}dnd.ecore"/&gt;<br>
        &lt;registerEcoreFile
value="${redview.mm.dir.uri}events.ecore"/&gt;<br>
        <br>
        &lt;registerEcoreFile
value="${redview.mm.ext.riena.dir.uri}validators.ecore"/&gt; <br>
        &lt;registerEcoreFile
value="${redview.mm.ext.riena.dir.uri}converters.ecore"/&gt; <br>
    &lt;/bean&gt;<br>
<br>
as karsten said - use URIs - not Pathes<br>
<br>
ekke<br>
<br>
Am 10.02.10 14:59, schrieb Florine Boudin:
<blockquote cite="mid:hkue46$2gr$1@build.eclipse.org" type="cite">Hi
everyone,
<br>
<br>
I have a problem to generate files with XPand when my metamodel is a
multiple ecore files.
<br>
<br>
To have a clear metamodel for my EMF editor, i made a 'partitioned'
one.
<br>
A problem appears when i try to generate files with Xpand. It doesn't
find the Class which are not in the root Ecore file, and i can't define
the functions...
<br>
<br>
But, if i call them by hierarchy (and make an horrible single DEFINE
function it works...) everything is OK he finds all the classes i call.
<br>
<br>
I checked the dependencies in the MANIFEST.MF and everything is OK.
<br>
<br>
The problem seems to come from my definition but i have no idea to do
it in an other way.
<br>
Or maybe it is impossible to associate Xpand with a multiple file
metamodel ?
<br>
<br>
If anybody  already had this problem, or if you know the possibility
(or impossibility  :(  ) to  do this, it will be really helpfull...
<br>
<br>
Thanks !
<br>
<br>
Florine
<br>
<br>
<br>
Simple Example:
<br>
The root Ecore file has the Procedure Class.
<br>
An other Ecore file has the RobotTask Class.
<br>
The Class Procedure has EReference to a List of RobotTask. <br>
xpt file code :
<br>
<br>
«IMPORT procedure »
<br>
«IMPORT robot »
<br>
<br>
«DEFINE RobotDef FOR RobotTask»
<br>
    Bla bla...
<br>
«ENDDEFINE»
<br>
<br>
«DEFINE Root FOR Procedure»
<br>
        «EXPAND RobotDef FOREACH hasTaskRobot»
<br>
«ENDDEFINE»
<br>
<br>
<br>
Error detected :
<br>
<br>
SEVERE: Error in Component generator of type
org.openarchitectureware.xpand2.Generator:     EvaluationException : No
Definition 'RobotDef for robot::RobotTask' found!
<br>
    templates::Root.xpt[206,36] on line 15 'EXPAND RobotDef FOREACH
hasTaskRobot'
<br>
    [23,38] on line 1 'EXPAND templates::Root::Root FOR model'     <br>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<p style="margin-bottom: 0cm;"> <font ,="" color="#808080"
face="Verdana, sans-serif"> <font size="4">ekke (ekkehard gentz)<br>
</font> <font size="3"> independent software-architect<br>
senior erp-consultant<br>
</font> <font size="2">eclipse | osgi | equinox | mdsd | oaw | emf |
uml<br>
max-josefs-platz 30, D-83022 rosenheim, germany<br>
<a class="moz-txt-link-freetext" href="mailto:ekke@ekkes-corner.org">mailto:ekke@ekkes-corner.org</a><br>
homepage (de): <a class="moz-txt-link-freetext" href="http://gentz-software.de">http://gentz-software.de</a><br>
blog (en): <a class="moz-txt-link-freetext" href="http://ekkes-corner.org">http://ekkes-corner.org</a><br>
twitter: @ekkescorner<br>
skype: ekkes-corner<br>
</font> <font size="1"> Steuer-Nr: 156/220/30931 FA Rosenheim, UST-ID:
DE189929490<br>
</font> </font> </p>
</div>
</body>
</html>

--------------050606010808040007000704--


ekke
independent software architect

blog: http://ekkes-corner.org
twitter: @ekkescorner
icon3.gif  Re: [XPAND] XPand and Partitioning Ecore is possible [message #513613 is a reply to message #513582] Wed, 10 February 2010 17:10 Go to previous messageGo to next message
Florine Boudin is currently offline Florine BoudinFriend
Messages: 3
Registered: July 2009
Location: Grenoble, France
Junior Member

Thank you ekke and Karsten !

You reassured me about the feasibility of it.
Right now it doesn't work. But i think i need to understand all the step of the workflow to make it work, for the moment new errors appeared...

I will post my solution. I hope as soon as possible Rolling Eyes .
Maybe i will ask other questions.

Thanks again !

Florine
Re: [XPAND] XPand and Partitioning Ecore is possible [message #531314 is a reply to message #513613] Tue, 04 May 2010 14:28 Go to previous message
Florine Boudin is currently offline Florine BoudinFriend
Messages: 3
Registered: July 2009
Location: Grenoble, France
Junior Member

Hi everyone,

I managed few days after my last message and i think it's a good idea to share my solution with you.

With a partitioning ecore, when i use XPand, i modified the worflow.oaw file.

The ecore file 'procedure' uses classes of the 'task.ecore' file, which uses classes of the 'module.ecore' file.

In the Generator defined in the oaw file, I call all each one of them in a metamodel :

<component id="generator"
    class="org.openarchitectureware.xpand2.Generator">
  
     <metaModel id="mm"
      class="org.openarchitectureware.type.emf.EmfMetaModel">
       <metaModelPackage value="procedure.ProcedurePackage"/>
    </metaModel>
  
     <metaModel id="mm2"
      class="org.openarchitectureware.type.emf.EmfMetaModel">
       <metaModelPackage value="task.TaskPackage"/>
    </metaModel>
  
    <metaModel id="mm3"
      class="org.openarchitectureware.type.emf.EmfMetaModel">
       <metaModelPackage value="module.ModulePackage"/>
    </metaModel>

</component>


Now, in the xpt file, the imports are recognized ! ! No more errors Smile

«IMPORT procedure »
«IMPORT tache »
«IMPORT module »



Thanks again for your help !
Florine
Previous Topic:[XPand dev] Tracing model access
Next Topic:EMF, oAW and "Code Composer Studio 4" (CCS4)
Goto Forum:
  


Current Time: Thu Mar 28 11:19:35 GMT 2024

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

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

Back to the top