|
|
|
|
|
Re: ETL [message #511256 is a reply to message #511239] |
Sun, 31 January 2010 17:53   |
Eclipse User |
|
|
|
Hi,
Could you please send me a complete snapshot of your project
(transformation, models, metamodels etc) so that I can have a look at this?
Cheers,
Dimitris
c wrote:
> I have some doubts:
> The first one of the doubts that tense is:
> I have the code:
> operation method_seq(c:UML!Class):modeloOR!Method{
> var m: new modeloOR!Method; for (op in c.ownedOperation) {
> m.Name:=op.name;
> }
> return m;
> }
> operation asignartt(c:UML!Class):modeloOR!TypedTable{
> 'asignartt'.println();
> var sx: new modeloOR!TypedTable;
> sx.Name:=c.name+'s<<persistent>>';
> return sx;
> }
>
> rule Class2UDT
> transform c:UML!Class
> to s:modeloOR!StructuredType{
> 'Class2UDT'.println();
> s.Name:=c.name+ "<<udt>>";
> s.Name.println();
> s.typed:=asignartt(c);
> s.method:= method_seq(c); }
>
> And for the assignment of s.typed: = asignartt (c); and s.method: =
> method_seq (c); me the mistake appears " Invalid assignment to property
> 'typed' " and " Invalid assignment to property 'method' " and I do not
> understand because this happens.
>
>
> The second doubt:
> When I transform a type CHAR the method creates Primitive CHAR
> Primitive CHAR
> Primitive CHAR and I want that the result is
> Primitive integer
> Primitive date
> Primitive STRING
> You were recommending to your me that ' you don't explicitly specify one.
> But I do not want to create anything type for default. I want that
> alone when the condificion 'if' is true it create the type PrimitiveType
> CHAR.
> To obtain it I have thought of putting a precondicion in front of this
> method of the following form:
> pre{
> var pr: new UML!PrimitiveType;
> (pr.name='String') or(pr.name='STRING') or (pr.name='string')
> }
> rule String2Varchar
> transform pr:UML!PrimitiveType
> ...........
> ..........
>
> But this does not work. Since I can do it?
>
>
>
> The third doubt is, which is the equivalence of the method resolveTemp"
> of ATL in ETL.
> The defincion of this function in ATL is:
>
> This specific operation makes it possible to point, from an ATL rule, to
> any of the target model elements (including non-default ones) that will
> be generated from a given source model element by an ATL matched rule.
> The operation resolveTemp has the following declaration:
> resolveTemp(var, target_pattern_name). The parameter var corresponds to
> an ATL variable that contains the source model element from which the
> searched target model element is produced. The parameter
> target_pattern_name is a string value that encodes the name of the
> target pattern element (see Section 4.5.2) that maps the provided source
> model element (contained by var) into the searched target model element.
>
>
> I have this code:
> typed <-thisModule.resolveTemp(p->refImmediateComposite(),'tt')
>
> I have thought that the transformation would be in ETL:
>
> operation resolveTemp(d:UML!Property):modeloOR!TypedTable{
> 'resolveTemp'.println();
> var t: new modeloOR!TypedTable;
> d.eContainer():='tt';
> return t;
> }
>
> rule.xxxx
> transform :d:UML!Property
> to .....
> {
> st.typed:=resolveTemp(d);
> }
> but, it is not correct....And I also have tried this:
> typed:=(p.eContainer().type::='tt');
>
> Thanks!!
>
>
>
>
|
|
|
|
|
|
|
|
Re: ETL [message #512742 is a reply to message #512406] |
Sat, 06 February 2010 20:00  |
Eclipse User |
|
|
|
Hi Carol,
OK. I've now reproduced this. The problem is that StructuredType.typed
is an 1..* feature but asignartt() returns a single TypedTable.
Therefore, instead of performing an assignment
s.typed:=asignartt(c);
you should be adding the result to s.typed:
s.typed.add(asignartt(c));
Fixing this makes the transformation run with no errors.
Cheers,
Dimitris
c wrote:
> Hello Dimitrios. I have sent the last version to your mail.The reason of
> that your you do not see the mistakes is because the line this of code
> commented.
>
> Thank you.
|
|
|
Re: ETL [message #585395 is a reply to message #511239] |
Sun, 31 January 2010 17:53  |
Eclipse User |
|
|
|
Hi,
Could you please send me a complete snapshot of your project
(transformation, models, metamodels etc) so that I can have a look at this?
Cheers,
Dimitris
c wrote:
> I have some doubts:
> The first one of the doubts that tense is:
> I have the code:
> operation method_seq(c:UML!Class):modeloOR!Method{
> var m: new modeloOR!Method; for (op in c.ownedOperation) {
> m.Name:=op.name;
> }
> return m;
> }
> operation asignartt(c:UML!Class):modeloOR!TypedTable{
> 'asignartt'.println();
> var sx: new modeloOR!TypedTable;
> sx.Name:=c.name+'s<<persistent>>';
> return sx;
> }
>
> rule Class2UDT
> transform c:UML!Class
> to s:modeloOR!StructuredType{
> 'Class2UDT'.println();
> s.Name:=c.name+ "<<udt>>";
> s.Name.println();
> s.typed:=asignartt(c);
> s.method:= method_seq(c); }
>
> And for the assignment of s.typed: = asignartt (c); and s.method: =
> method_seq (c); me the mistake appears " Invalid assignment to property
> 'typed' " and " Invalid assignment to property 'method' " and I do not
> understand because this happens.
>
>
> The second doubt:
> When I transform a type CHAR the method creates Primitive CHAR
> Primitive CHAR
> Primitive CHAR and I want that the result is
> Primitive integer
> Primitive date
> Primitive STRING
> You were recommending to your me that ' you don't explicitly specify one.
> But I do not want to create anything type for default. I want that
> alone when the condificion 'if' is true it create the type PrimitiveType
> CHAR.
> To obtain it I have thought of putting a precondicion in front of this
> method of the following form:
> pre{
> var pr: new UML!PrimitiveType;
> (pr.name='String') or(pr.name='STRING') or (pr.name='string')
> }
> rule String2Varchar
> transform pr:UML!PrimitiveType
> ...........
> ..........
>
> But this does not work. Since I can do it?
>
>
>
> The third doubt is, which is the equivalence of the method resolveTemp"
> of ATL in ETL.
> The defincion of this function in ATL is:
>
> This specific operation makes it possible to point, from an ATL rule, to
> any of the target model elements (including non-default ones) that will
> be generated from a given source model element by an ATL matched rule.
> The operation resolveTemp has the following declaration:
> resolveTemp(var, target_pattern_name). The parameter var corresponds to
> an ATL variable that contains the source model element from which the
> searched target model element is produced. The parameter
> target_pattern_name is a string value that encodes the name of the
> target pattern element (see Section 4.5.2) that maps the provided source
> model element (contained by var) into the searched target model element.
>
>
> I have this code:
> typed <-thisModule.resolveTemp(p->refImmediateComposite(),'tt')
>
> I have thought that the transformation would be in ETL:
>
> operation resolveTemp(d:UML!Property):modeloOR!TypedTable{
> 'resolveTemp'.println();
> var t: new modeloOR!TypedTable;
> d.eContainer():='tt';
> return t;
> }
>
> rule.xxxx
> transform :d:UML!Property
> to .....
> {
> st.typed:=resolveTemp(d);
> }
> but, it is not correct....And I also have tried this:
> typed:=(p.eContainer().type::='tt');
>
> Thanks!!
>
>
>
>
|
|
|
|
|
Re: ETL [message #585690 is a reply to message #512049] |
Wed, 03 February 2010 18:07  |
Eclipse User |
|
|
|
Thank you for answering me. I am sorry to be a nuisance so much, but I try to solve the problems for hours before writing in the forum.
I know that the error that appears of 'Invalid assignment to property 'typed' " ' refers to incompatible types,but this is not true.
Before writing in the forum, use the functions '.println () ' of the following form
//Invalid assignment to property 'typed'
//s.typed:=asignartt(c);
'type is'.println();
asignartt(c).println();'
and the exits is:
'type is
TypedTable [Name=Class2UDTs<<persistent>>, ] '.
But I look that the type of the variable 's.typed' is of the same type that the value returned by the function'operation asignartt(c:UML!Class):modeloOR!TypedTable{'.
In the file' '
I look in the file 'modeloOR.ecore' at the field 'typed' of the StructuredType that is the type of the variable 's' and also it is of type TypedTable
Because of it I have written in the forum. Because it gives a problem of incompatible types when it is not true and do not be to which other reasons it can owe.
Thank you for saying the existence of the function to me 'equivalent' and excuse me to my for the inconveniences
A greeting
|
|
|
Re: ETL [message #585703 is a reply to message #585690] |
Thu, 04 February 2010 11:37  |
Eclipse User |
|
|
|
Hi Carol,
I can't reproduce this with the last version of the transformation you
sent me (1st Feb). After fixing the name of UM.model -> UML.model,
launch.xml runs with no errors... Perhaps you've sent me an older version?
Cheers,
Dimitris
c wrote:
> Thank you for answering me. I am sorry to be a nuisance so much, but I
> try to solve the problems for hours before writing in the forum.
> I know that the error that appears of 'Invalid assignment to property
> 'typed' " ' refers to incompatible types,but this is not true.
> Before writing in the forum, use the functions '.println () ' of the
> following form //Invalid assignment to property 'typed'
> //s.typed:=asignartt(c);
> 'type is'.println();
> asignartt(c).println();'
>
> and the exits is:
>
> 'type is
> TypedTable [Name=Class2UDTs<<persistent>>, ] '.
>
> But I look that the type of the variable 's.typed' is of the same type
> that the value returned by the function'operation
> asignartt(c:UML!Class):modeloOR!TypedTable{'.
> In the file' '
> I look in the file 'modeloOR.ecore' at the field 'typed' of the
> StructuredType that is the type of the variable 's' and also it is of
> type TypedTable
>
> Because of it I have written in the forum. Because it gives a problem of
> incompatible types when it is not true and do not be to which other
> reasons it can owe.
> Thank you for saying the existence of the function to me 'equivalent'
> and excuse me to my for the inconveniences
> A greeting
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Re: ETL [message #585715 is a reply to message #512320] |
Thu, 04 February 2010 18:25  |
Eclipse User |
|
|
|
Hello Dimitrios. I have sent the last version to your mail.The reason of that your you do not see the mistakes is because the line this of code commented.
Thank you.
|
|
|
Re: ETL [message #585815 is a reply to message #585715] |
Sat, 06 February 2010 20:00  |
Eclipse User |
|
|
|
Hi Carol,
OK. I've now reproduced this. The problem is that StructuredType.typed
is an 1..* feature but asignartt() returns a single TypedTable.
Therefore, instead of performing an assignment
s.typed:=asignartt(c);
you should be adding the result to s.typed:
s.typed.add(asignartt(c));
Fixing this makes the transformation run with no errors.
Cheers,
Dimitris
c wrote:
> Hello Dimitrios. I have sent the last version to your mail.The reason of
> that your you do not see the mistakes is because the line this of code
> commented.
>
> Thank you.
|
|
|
Powered by
FUDForum. Page generated in 0.06659 seconds