Home » Modeling » Epsilon » Model Elemenet Types: "!" vs. "::"
Model Elemenet Types: "!" vs. "::" [message #494818] |
Mon, 02 November 2009 18:35 |
|
I am totally confused on the real diffrence between the two model element types character separator.
I was doing a simple model to model transformation. I have 2 ecore metamodles, and an epsilon model. I made a simple etl rule to test the transformation and, following the Tree2Graph example, used the ! character to separate elements. I kept getting a "Typed not found error" so I decided to try with the :: separator. So now the elements of the input metamodel where recognized but the ones form the output one not. So I changed the one for the output to ! and it all worked out.
So... when or how to know when to use one or the other? Does it has to do with some property of the metamodel ?
Thanks,
Horacio Hoyos
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
| |
Re: Model Elemenet Types: "!" vs. "::" [message #494865 is a reply to message #494860] |
Tue, 03 November 2009 00:20 |
|
Thanks for your reply Dimitris. and don't worry about the delay .
Ok, I understand the diference between the two.. or at least I think I do. In my test transformation I created a rule to transform one element to another:
rule Pizzas2Menu
transform p : Pizza::NamedPizza
to i : Menu!Item {
i.name = p.name;
}
My input metamodel is PIzza, and my output one is Menu. For the transformation to work I had to, as you can see, identify the input model element with :: and the output one with !. In the tree2graph example ! is used for both input and output ones. And out of curiosity I used the "Epsilon->Generate ETL" menu over an ecore model and the transformation uses ! and the element name inside double qutoes.
What I am trying to figure out is when to use one or the other, not from a "meaning" point of view (as you explained in your answer), but for my workflow to run without erroros, that with such a simple test seems to come from somewhere else than the actual "meaning" of each separator.
Regards,
Horacio Hoyos
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Re: Model Elemenet Types: "!" vs. "::" [message #494866 is a reply to message #494865] |
Tue, 03 November 2009 00:55 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Horacio,
In Epsilon, models are referred to by their names. For example, you can
have two (in general an arbitrary number of) models A and B that conform
to the same metamodel (e.g. the UML 2.x metamodel). In this case,
A!Class.all will return all UML classes in model A and similarly
B!Model.all will return all UML classes in model B.
Therefore, your rule should look like
rule Pizzas2Menu
transform p : Source!NamedPizza
to i : Target!Item {
...
}
where Source and Target (or whatever else you choose them to be in the
"name" field of the model configuration dialogs or in the "name"
attribute of your <epsilon.loadModel ...> ANT tasks) are the names of
your source and target models (not metamodels).
What the rule in its existing form does is that it transforms all
NamedPizzas from the first model of your launch configuration
(regardless of its name) to an Item in your Menu model.
Up to 0.8.7, "" were used to allow you to use reserved words or strings
containing non alphanumeric characters as property/type names (e.g
"transform".allInstances or myObject."my strange property name"). The
Generate ETL utility generates all identifiers within "" to cater for
potential reserved words in your EClasses/EAttributes. From 0.8.8, ``
are used for this reason and "" are used for enclosing literal strings
(to give it a more Java-like flavour).
Cheers,
Dimitris
Horacio wrote:
> Thanks for your reply Dimitris. and don't worry about the delay :d.
>
> Ok, I understand the diference between the two.. or at least I think I
> do. In my test transformation I created a rule to transform one element
> to another:
>
> rule Pizzas2Menu
> transform p : Pizza::NamedPizza
> to i : Menu!Item {
> i.name = p.name;
> }
>
> My input metamodel is PIzza, and my output one is Menu. For the
> transformation to work I had to, as you can see, identify the input
> model element with :: and the output one with !. In the tree2graph
> example ! is used for both input and output ones. And out of curiosity I
> used the "Epsilon->Generate ETL" menu over an ecore model and the
> transformation uses ! and the element name inside double qutoes.
> What I am trying to figure out is when to use one or the other, not from
> a "meaning" point of view (as you explained in your answer), but for my
> workflow to run without erroros, that with such a simple test seems to
> come from somewhere else than the actual "meaning" of each separator.
>
> Regards,
>
>
> Horacio Hoyos
|
|
| | |
Re: Model Elemenet Types: "!" vs. "::" [message #498598 is a reply to message #498038] |
Tue, 17 November 2009 16:05 |
|
Hi Dimitris,
My models have a .xmi extension and reading other posts I thought EMF_M2 was the correct type. Any how I changed it as you suggested and now I get a new error, from the ant processing:
java.lang String index out of range: 0
How can I send you the files as requested?
Regards,
Horacio Hoyos
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
[Updated on: Tue, 17 November 2009 16:07] Report message to a moderator
|
|
| |
Re: Model Elemenet Types: "!" vs. "::" [message #499010 is a reply to message #498603] |
Thu, 19 November 2009 14:37 |
|
Dimitris,
Thanks for your help! I have a final question. On your mail you told me:
Quote: |
2. I changed both
<parameter name="isMetamodelFileBased" value="true"/>
to
<parameter name="isMetamodelFileBased" value="false"/>
|
Why and when to set that property to true, and where can I get detailed information on the attributes of the Epsilon workflow tasks?
Thanks,
Horacio
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
[Updated on: Thu, 19 November 2009 14:50] Report message to a moderator
|
|
| |
Re: Model Elemenet Types: "!" vs. "::" [message #582476 is a reply to message #494860] |
Tue, 03 November 2009 00:20 |
|
Thanks for your reply Dimitris. and don't worry about the delay :d.
Ok, I understand the diference between the two.. or at least I think I do. In my test transformation I created a rule to transform one element to another:
rule Pizzas2Menu
transform p : Pizza::NamedPizza
to i : Menu!Item {
i.name = p.name;
}
My input metamodel is PIzza, and my output one is Menu. For the transformation to work I had to, as you can see, identify the input model element with :: and the output one with !. In the tree2graph example ! is used for both input and output ones. And out of curiosity I used the "Epsilon->Generate ETL" menu over an ecore model and the transformation uses ! and the element name inside double qutoes.
What I am trying to figure out is when to use one or the other, not from a "meaning" point of view (as you explained in your answer), but for my workflow to run without erroros, that with such a simple test seems to come from somewhere else than the actual "meaning" of each separator.
Regards,
Horacio Hoyos
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
Re: Model Elemenet Types: "!" vs. "::" [message #582492 is a reply to message #494865] |
Tue, 03 November 2009 00:55 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi Horacio,
In Epsilon, models are referred to by their names. For example, you can
have two (in general an arbitrary number of) models A and B that conform
to the same metamodel (e.g. the UML 2.x metamodel). In this case,
A!Class.all will return all UML classes in model A and similarly
B!Model.all will return all UML classes in model B.
Therefore, your rule should look like
rule Pizzas2Menu
transform p : Source!NamedPizza
to i : Target!Item {
...
}
where Source and Target (or whatever else you choose them to be in the
"name" field of the model configuration dialogs or in the "name"
attribute of your <epsilon.loadModel ...> ANT tasks) are the names of
your source and target models (not metamodels).
What the rule in its existing form does is that it transforms all
NamedPizzas from the first model of your launch configuration
(regardless of its name) to an Item in your Menu model.
Up to 0.8.7, "" were used to allow you to use reserved words or strings
containing non alphanumeric characters as property/type names (e.g
"transform".allInstances or myObject."my strange property name"). The
Generate ETL utility generates all identifiers within "" to cater for
potential reserved words in your EClasses/EAttributes. From 0.8.8, ``
are used for this reason and "" are used for enclosing literal strings
(to give it a more Java-like flavour).
Cheers,
Dimitris
Horacio wrote:
> Thanks for your reply Dimitris. and don't worry about the delay :d.
>
> Ok, I understand the diference between the two.. or at least I think I
> do. In my test transformation I created a rule to transform one element
> to another:
>
> rule Pizzas2Menu
> transform p : Pizza::NamedPizza
> to i : Menu!Item {
> i.name = p.name;
> }
>
> My input metamodel is PIzza, and my output one is Menu. For the
> transformation to work I had to, as you can see, identify the input
> model element with :: and the output one with !. In the tree2graph
> example ! is used for both input and output ones. And out of curiosity I
> used the "Epsilon->Generate ETL" menu over an ecore model and the
> transformation uses ! and the element name inside double qutoes.
> What I am trying to figure out is when to use one or the other, not from
> a "meaning" point of view (as you explained in your answer), but for my
> workflow to run without erroros, that with such a simple test seems to
> come from somewhere else than the actual "meaning" of each separator.
>
> Regards,
>
>
> Horacio Hoyos
|
|
|
Re: Model Elemenet Types: "!" vs. "::" [message #582840 is a reply to message #494866] |
Fri, 13 November 2009 15:49 |
|
Hello, and sorry fort the late response.
I still can't get it to work.... maybe i'm a doing something wrong elsewhere. This are some snippets of my code (No more pizza :) ):
Transformation.xml:
<epsilon.emf.register file="../HiLeSPL.generator/metamodels/hiles/StructuralHiles.ecore "/>
<epsilon.emf.register file="../HiLeSPL.generator/metamodels/vhdl/ams/VHDL-AMS.ecore "/>
...
<epsilon.loadModel name="Petri" type="EMF_M2">
<parameter name="modelFile" file="../HiLeS(Epsilon)/models/hiles/Petri.xmi"/>
...
</epsilon.loadModel>
...
<epsilon.loadModel name="PetriVHDL" type="EMF_M2">
<parameter name="modelFile" file="../models/vhdl/PetriVHDL.xmi"/>
...
</epsilon.loadModel>
So now on my ETL, usign the model names:
rule System2DesignUnit
transform hs : Petri!HilesSystem
to ds : PetriVHDL!DesignUnit {
ds.identifier = hs.name;
}
This is part of the Petri model:
<?xml version="1.0" encoding="ASCII"?>
<hl:HilesSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hl="/HiLeSPL.generator/metamodels/hiles/StructuralHiles.ecore " xmi:id="_wUOYkLmSEd6krrbVnIHY-w" name="Petri">
<initialArchitecture xmi:id="_fq8nQLmUEd6krrbVnIHY-w" name="main">
...
</initialArchitecture>
</hl:HilesSystem>
So as far as I can see it should work, but I keep getting a "Type Petri!HilesSystem not found" error.
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
| |
Re: Model Elemenet Types: "!" vs. "::" [message #582898 is a reply to message #498038] |
Tue, 17 November 2009 16:05 |
|
Hi Dimitris,
My models have a .xmi extension and reading other posts I thought EMF_M2 was the correct type. Any how I changed it as you suggested and now I get a new error, from the ant processing:
java.lang String index out of range: 0
I am sending you the files as requested.
Regards,
Horacio Hoyos
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
| |
Re: Model Elemenet Types: "!" vs. "::" [message #583051 is a reply to message #498603] |
Thu, 19 November 2009 14:37 |
|
Dimitris,
Thanks for your help! I have a final question:
[QUOTE]
2. I changed both
<parameter name="isMetamodelFileBased" value="true"/>
to
<parameter name="isMetamodelFileBased" value="false"/>
[/QUOTE
Why and when to set that property to true, and where can I get detailed information on the attributes of the Epsilon workflow tasks?
Thanks,
Horacio
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
| |
Goto Forum:
Current Time: Wed Sep 25 09:32:51 GMT 2024
Powered by FUDForum. Page generated in 0.04561 seconds
|