|
|
|
|
|
Re: ETL [message #511256 is a reply to message #511239] |
Sun, 31 January 2010 22:53 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
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 #585395 is a reply to message #511239] |
Sun, 31 January 2010 22:53 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
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!!
>
>
>
>
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06083 seconds