Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Superimposition, Delete elements
[ATL] Superimposition, Delete elements [message #66116] Wed, 14 November 2007 16:19 Go to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi all,

I'm specifying an ATL transformations to modify some elements of a
model, and copy the remaining ones. I'm using ATL 2006 since I need
rules with more than one source element.

At the beginning, I thought to use superimposition feature with an ATL
transformation that copy all the elements of a model. The problem is
that superimposition is based on rule names, and I can have rules
modifying elements with more than one source elements. I want all the
elements that does not match with any rules to be copied. Finally I use
Superimposition but all elements are copied. Thus, I need an operation
to delete elements that match with any rule. I have seen the post:

[news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used do
block in matched rules

and other solutions where provided (different from deleting) that can
not be used in my case. Is there any operation able to delete element
(independent of its metaclass)?

Thank you in advance,
Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #66269 is a reply to message #66116] Thu, 15 November 2007 12:28 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Jose E. Rivera schreef:
> Hi all,
>
> I'm specifying an ATL transformations to modify some elements of a
> model, and copy the remaining ones. I'm using ATL 2006 since I need
> rules with more than one source element.
>
> At the beginning, I thought to use superimposition feature with an ATL
> transformation that copy all the elements of a model. The problem is
> that superimposition is based on rule names, and I can have rules
> modifying elements with more than one source elements. I want all the
> elements that does not match with any rules to be copied. Finally I use
> Superimposition but all elements are copied. Thus, I need an operation
> to delete elements that match with any rule. I have seen the post:

So, you cannot override all unwanted copying rules, because you don't
have a replacement rule for each original copying rule, am I correct?

About superimposition being based on rule names:

If we want to override rules based on whether they match or not, then
the easiest way is to change the ATL virtual machine behaviour. The ATL
VM can "test" whether an overriding rule matches and then skip all
original rules.

Superimposition does not change the behaviour of the ATL virtual
machine, but does bytecode manipulation at load-time. There is no
information on the elements that will match against the rules at load-time.

That leaves static analysis to find out whether overriding rules match
against the same input as a copying rule. Static analysis is
computationally intensive, however, and currently not even possible in ATL.

>
> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used do
> block in matched rules
>
> and other solutions where provided (different from deleting) that can
> not be used in my case. Is there any operation able to delete element
> (independent of its metaclass)?
>
> Thank you in advance,
> Jose E. Rivera

It looks like you need an operation that actually removes matched rules
from a transformation module.

Perhaps this is a good use case for mapping an input element to
"nothing"? That seems the closest to a real delete operation. In OCL,
"nothing" is represented as OclUndefined. Maybe you can experiment with
that?
--
Dennis
Re: [ATL] Superimposition, Delete elements [message #66292 is a reply to message #66269] Thu, 15 November 2007 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi Dennis,

Dennis Wagelaar escribió:
> Jose E. Rivera schreef:
>> Hi all,
>>
>> I'm specifying an ATL transformations to modify some elements of a
>> model, and copy the remaining ones. I'm using ATL 2006 since I need
>> rules with more than one source element.
>>
>> At the beginning, I thought to use superimposition feature with an ATL
>> transformation that copy all the elements of a model. The problem is
>> that superimposition is based on rule names, and I can have rules
>> modifying elements with more than one source elements. I want all the
>> elements that does not match with any rules to be copied. Finally I
>> use Superimposition but all elements are copied. Thus, I need an
>> operation to delete elements that match with any rule. I have seen the
>> post:
>
> So, you cannot override all unwanted copying rules, because you don't
> have a replacement rule for each original copying rule, am I correct?

Yes, you are right. I can have for example a rule with three source
elements to be modified (they also can be added, deleted or modified),
and copy rules have one source element. And many rules can have in one
of its source elements the same metaclass.
>
> About superimposition being based on rule names:
>
> If we want to override rules based on whether they match or not, then
> the easiest way is to change the ATL virtual machine behaviour. The ATL

¿Can it be done in a not very difficult way? :)

> VM can "test" whether an overriding rule matches and then skip all
> original rules.
>
> Superimposition does not change the behaviour of the ATL virtual
> machine, but does bytecode manipulation at load-time. There is no
> information on the elements that will match against the rules at load-time.
>
> That leaves static analysis to find out whether overriding rules match
> against the same input as a copying rule. Static analysis is
> computationally intensive, however, and currently not even possible in ATL.
>
>>
>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used do
>> block in matched rules
>>
>> and other solutions where provided (different from deleting) that can
>> not be used in my case. Is there any operation able to delete element
>> (independent of its metaclass)?
>>
>> Thank you in advance,
>> Jose E. Rivera
>
> It looks like you need an operation that actually removes matched rules
> from a transformation module.

Actually I need an operation to remove elements that match some rules.
Because not all elements of a metaclass have to be deleted (i.e, not
copied) only those that macth a rule in relation with other elements of
other metaclasses.
>
> Perhaps this is a good use case for mapping an input element to
> "nothing"? That seems the closest to a real delete operation. In OCL,
> "nothing" is represented as OclUndefined. Maybe you can experiment with
> that?

If I use superimposition all elements will be copied. I have to remove
those that I don't need after being copied. I can not use a matching
rule (to match it with OclUndefined or with nothing) since these
elements will be already in the target model. I think I need this
operation in the do block....
> --
> Dennis

Thank you very much,
Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #66716 is a reply to message #66292] Fri, 23 November 2007 17:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi Dennis,

Thank you very much. Now I think I have understood what you tried to
tell me. I have written in the imperative block (do) something like

my_var <- OclUndefined;

(being my_var a variable belonging to the source pattern) but it does
not make any effect, my_var at the end has the same value as nothing
(the assignement) had been done . But it should work as a delete
operation, should not it?

Jose E. Rivera escribió:
> Hi Dennis,
>
> Dennis Wagelaar escribió:
>> Jose E. Rivera schreef:
>>> Hi all,
>>>
>>> I'm specifying an ATL transformations to modify some elements of a
>>> model, and copy the remaining ones. I'm using ATL 2006 since I need
>>> rules with more than one source element.
>>>
>>> At the beginning, I thought to use superimposition feature with an
>>> ATL transformation that copy all the elements of a model. The problem
>>> is that superimposition is based on rule names, and I can have rules
>>> modifying elements with more than one source elements. I want all the
>>> elements that does not match with any rules to be copied. Finally I
>>> use Superimposition but all elements are copied. Thus, I need an
>>> operation to delete elements that match with any rule. I have seen
>>> the post:
>>
>> So, you cannot override all unwanted copying rules, because you don't
>> have a replacement rule for each original copying rule, am I correct?
>
> Yes, you are right. I can have for example a rule with three source
> elements to be modified (they also can be added, deleted or modified),
> and copy rules have one source element. And many rules can have in one
> of its source elements the same metaclass.
>>
>> About superimposition being based on rule names:
>>
>> If we want to override rules based on whether they match or not, then
>> the easiest way is to change the ATL virtual machine behaviour. The ATL
>
> ¿Can it be done in a not very difficult way? :)
>
>> VM can "test" whether an overriding rule matches and then skip all
>> original rules.
>>
>> Superimposition does not change the behaviour of the ATL virtual
>> machine, but does bytecode manipulation at load-time. There is no
>> information on the elements that will match against the rules at
>> load-time.
>>
>> That leaves static analysis to find out whether overriding rules match
>> against the same input as a copying rule. Static analysis is
>> computationally intensive, however, and currently not even possible in
>> ATL.
>>
>>>
>>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used
>>> do block in matched rules
>>>
>>> and other solutions where provided (different from deleting) that can
>>> not be used in my case. Is there any operation able to delete element
>>> (independent of its metaclass)?
>>>
>>> Thank you in advance,
>>> Jose E. Rivera
>>
>> It looks like you need an operation that actually removes matched
>> rules from a transformation module.
>
> Actually I need an operation to remove elements that match some rules.
> Because not all elements of a metaclass have to be deleted (i.e, not
> copied) only those that macth a rule in relation with other elements of
> other metaclasses.
>>
>> Perhaps this is a good use case for mapping an input element to
>> "nothing"? That seems the closest to a real delete operation. In OCL,
>> "nothing" is represented as OclUndefined. Maybe you can experiment
>> with that?
>
> If I use superimposition all elements will be copied. I have to remove
> those that I don't need after being copied. I can not use a matching
> rule (to match it with OclUndefined or with nothing) since these
> elements will be already in the target model. I think I need this
> operation in the do block....
>> --
>> Dennis
>
> Thank you very much,
> Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #66829 is a reply to message #66716] Tue, 27 November 2007 03:20 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Jose,

Regarding changing the values of properties: this is not possible yet
(see my answer to "Re: [ATL] Insert elements in reference features").

However, what you describe could be done in ATL refining mode (only
available in ATL 2004 so far). To delete an element, make sure you do
not transform it or use it in any binding.


Regards,

Frédéric Jouault


Jose E. Rivera wrote:
> Hi Dennis,
>
> Thank you very much. Now I think I have understood what you tried to
> tell me. I have written in the imperative block (do) something like
>
> my_var <- OclUndefined;
>
> (being my_var a variable belonging to the source pattern) but it does
> not make any effect, my_var at the end has the same value as nothing
> (the assignement) had been done . But it should work as a delete
> operation, should not it?
>
> Jose E. Rivera escribió:
>> Hi Dennis,
>>
>> Dennis Wagelaar escribió:
>>> Jose E. Rivera schreef:
>>>> Hi all,
>>>>
>>>> I'm specifying an ATL transformations to modify some elements of a
>>>> model, and copy the remaining ones. I'm using ATL 2006 since I need
>>>> rules with more than one source element.
>>>>
>>>> At the beginning, I thought to use superimposition feature with an
>>>> ATL transformation that copy all the elements of a model. The
>>>> problem is that superimposition is based on rule names, and I can
>>>> have rules modifying elements with more than one source elements. I
>>>> want all the elements that does not match with any rules to be
>>>> copied. Finally I use Superimposition but all elements are copied.
>>>> Thus, I need an operation to delete elements that match with any
>>>> rule. I have seen the post:
>>>
>>> So, you cannot override all unwanted copying rules, because you don't
>>> have a replacement rule for each original copying rule, am I correct?
>>
>> Yes, you are right. I can have for example a rule with three source
>> elements to be modified (they also can be added, deleted or modified),
>> and copy rules have one source element. And many rules can have in one
>> of its source elements the same metaclass.
>>>
>>> About superimposition being based on rule names:
>>>
>>> If we want to override rules based on whether they match or not, then
>>> the easiest way is to change the ATL virtual machine behaviour. The ATL
>>
>> ¿Can it be done in a not very difficult way? :)
>>
>>> VM can "test" whether an overriding rule matches and then skip all
>>> original rules.
>>>
>>> Superimposition does not change the behaviour of the ATL virtual
>>> machine, but does bytecode manipulation at load-time. There is no
>>> information on the elements that will match against the rules at
>>> load-time.
>>>
>>> That leaves static analysis to find out whether overriding rules
>>> match against the same input as a copying rule. Static analysis is
>>> computationally intensive, however, and currently not even possible
>>> in ATL.
>>>
>>>>
>>>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used
>>>> do block in matched rules
>>>>
>>>> and other solutions where provided (different from deleting) that
>>>> can not be used in my case. Is there any operation able to delete
>>>> element (independent of its metaclass)?
>>>>
>>>> Thank you in advance,
>>>> Jose E. Rivera
>>>
>>> It looks like you need an operation that actually removes matched
>>> rules from a transformation module.
>>
>> Actually I need an operation to remove elements that match some rules.
>> Because not all elements of a metaclass have to be deleted (i.e, not
>> copied) only those that macth a rule in relation with other elements
>> of other metaclasses.
>>>
>>> Perhaps this is a good use case for mapping an input element to
>>> "nothing"? That seems the closest to a real delete operation. In OCL,
>>> "nothing" is represented as OclUndefined. Maybe you can experiment
>>> with that?
>>
>> If I use superimposition all elements will be copied. I have to remove
>> those that I don't need after being copied. I can not use a matching
>> rule (to match it with OclUndefined or with nothing) since these
>> elements will be already in the target model. I think I need this
>> operation in the do block....
>>> --
>>> Dennis
>>
>> Thank you very much,
>> Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #66834 is a reply to message #66829] Tue, 27 November 2007 17:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi Frédéric,

Thank you very much, but I need ATL 2006 in order to be able to specify
more than one element in the source pattern of the rules. I will wait
for refining mode for ATL 2006 :)

Regards,
Jose E. Rivera

Frédéric Jouault escribió:
> Hi Jose,
>
> Regarding changing the values of properties: this is not possible yet
> (see my answer to "Re: [ATL] Insert elements in reference features").
>
> However, what you describe could be done in ATL refining mode (only
> available in ATL 2004 so far). To delete an element, make sure you do
> not transform it or use it in any binding.
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Jose E. Rivera wrote:
>> Hi Dennis,
>>
>> Thank you very much. Now I think I have understood what you tried to
>> tell me. I have written in the imperative block (do) something like
>>
>> my_var <- OclUndefined;
>>
>> (being my_var a variable belonging to the source pattern) but it does
>> not make any effect, my_var at the end has the same value as nothing
>> (the assignement) had been done . But it should work as a delete
>> operation, should not it?
>>
>> Jose E. Rivera escribió:
>>> Hi Dennis,
>>>
>>> Dennis Wagelaar escribió:
>>>> Jose E. Rivera schreef:
>>>>> Hi all,
>>>>>
>>>>> I'm specifying an ATL transformations to modify some elements of a
>>>>> model, and copy the remaining ones. I'm using ATL 2006 since I need
>>>>> rules with more than one source element.
>>>>>
>>>>> At the beginning, I thought to use superimposition feature with an
>>>>> ATL transformation that copy all the elements of a model. The
>>>>> problem is that superimposition is based on rule names, and I can
>>>>> have rules modifying elements with more than one source elements. I
>>>>> want all the elements that does not match with any rules to be
>>>>> copied. Finally I use Superimposition but all elements are copied.
>>>>> Thus, I need an operation to delete elements that match with any
>>>>> rule. I have seen the post:
>>>>
>>>> So, you cannot override all unwanted copying rules, because you
>>>> don't have a replacement rule for each original copying rule, am I
>>>> correct?
>>>
>>> Yes, you are right. I can have for example a rule with three source
>>> elements to be modified (they also can be added, deleted or
>>> modified), and copy rules have one source element. And many rules can
>>> have in one of its source elements the same metaclass.
>>>>
>>>> About superimposition being based on rule names:
>>>>
>>>> If we want to override rules based on whether they match or not,
>>>> then the easiest way is to change the ATL virtual machine behaviour.
>>>> The ATL
>>>
>>> ¿Can it be done in a not very difficult way? :)
>>>
>>>> VM can "test" whether an overriding rule matches and then skip all
>>>> original rules.
>>>>
>>>> Superimposition does not change the behaviour of the ATL virtual
>>>> machine, but does bytecode manipulation at load-time. There is no
>>>> information on the elements that will match against the rules at
>>>> load-time.
>>>>
>>>> That leaves static analysis to find out whether overriding rules
>>>> match against the same input as a copying rule. Static analysis is
>>>> computationally intensive, however, and currently not even possible
>>>> in ATL.
>>>>
>>>>>
>>>>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element used
>>>>> do block in matched rules
>>>>>
>>>>> and other solutions where provided (different from deleting) that
>>>>> can not be used in my case. Is there any operation able to delete
>>>>> element (independent of its metaclass)?
>>>>>
>>>>> Thank you in advance,
>>>>> Jose E. Rivera
>>>>
>>>> It looks like you need an operation that actually removes matched
>>>> rules from a transformation module.
>>>
>>> Actually I need an operation to remove elements that match some
>>> rules. Because not all elements of a metaclass have to be deleted
>>> (i.e, not copied) only those that macth a rule in relation with other
>>> elements of other metaclasses.
>>>>
>>>> Perhaps this is a good use case for mapping an input element to
>>>> "nothing"? That seems the closest to a real delete operation. In
>>>> OCL, "nothing" is represented as OclUndefined. Maybe you can
>>>> experiment with that?
>>>
>>> If I use superimposition all elements will be copied. I have to
>>> remove those that I don't need after being copied. I can not use a
>>> matching rule (to match it with OclUndefined or with nothing) since
>>> these elements will be already in the target model. I think I need
>>> this operation in the do block....
>>>> --
>>>> Dennis
>>>
>>> Thank you very much,
>>> Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #67797 is a reply to message #66834] Thu, 29 November 2007 23:58 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

Let me suggest the following usage of module superimposition:

-- Copy module:

rule CopyA {
....
}

-- Superimposed module:

abstract rule CopyA {
from
s : MM!A
to
t : MM!A
}

rule PartillayCopyA {
from
s : MM!A
to
t : MM!A (
-- only copy contents of features
-- you want to copy
)
}

rule FullyCopyA extends CopyA {
from
s : MM!A -- no filter = default
to
t : MM!A (
-- copy contents of all features
-- this code may be copied from
-- rule CopyA of the copy module
)
}



Please, let us know if it works.


Regards,

Frédéric Jouault


Jose E. Rivera wrote:
> Hi Frédéric,
>
> Thank you very much, but I need ATL 2006 in order to be able to specify
> more than one element in the source pattern of the rules. I will wait
> for refining mode for ATL 2006 :)
>
> Regards,
> Jose E. Rivera
>
> Frédéric Jouault escribió:
>> Hi Jose,
>>
>> Regarding changing the values of properties: this is not possible yet
>> (see my answer to "Re: [ATL] Insert elements in reference features").
>>
>> However, what you describe could be done in ATL refining mode (only
>> available in ATL 2004 so far). To delete an element, make sure you do
>> not transform it or use it in any binding.
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>>
>> Jose E. Rivera wrote:
>>> Hi Dennis,
>>>
>>> Thank you very much. Now I think I have understood what you tried to
>>> tell me. I have written in the imperative block (do) something like
>>>
>>> my_var <- OclUndefined;
>>>
>>> (being my_var a variable belonging to the source pattern) but it does
>>> not make any effect, my_var at the end has the same value as nothing
>>> (the assignement) had been done . But it should work as a delete
>>> operation, should not it?
>>>
>>> Jose E. Rivera escribió:
>>>> Hi Dennis,
>>>>
>>>> Dennis Wagelaar escribió:
>>>>> Jose E. Rivera schreef:
>>>>>> Hi all,
>>>>>>
>>>>>> I'm specifying an ATL transformations to modify some elements of a
>>>>>> model, and copy the remaining ones. I'm using ATL 2006 since I
>>>>>> need rules with more than one source element.
>>>>>>
>>>>>> At the beginning, I thought to use superimposition feature with an
>>>>>> ATL transformation that copy all the elements of a model. The
>>>>>> problem is that superimposition is based on rule names, and I can
>>>>>> have rules modifying elements with more than one source elements.
>>>>>> I want all the elements that does not match with any rules to be
>>>>>> copied. Finally I use Superimposition but all elements are copied.
>>>>>> Thus, I need an operation to delete elements that match with any
>>>>>> rule. I have seen the post:
>>>>>
>>>>> So, you cannot override all unwanted copying rules, because you
>>>>> don't have a replacement rule for each original copying rule, am I
>>>>> correct?
>>>>
>>>> Yes, you are right. I can have for example a rule with three source
>>>> elements to be modified (they also can be added, deleted or
>>>> modified), and copy rules have one source element. And many rules
>>>> can have in one of its source elements the same metaclass.
>>>>>
>>>>> About superimposition being based on rule names:
>>>>>
>>>>> If we want to override rules based on whether they match or not,
>>>>> then the easiest way is to change the ATL virtual machine
>>>>> behaviour. The ATL
>>>>
>>>> ¿Can it be done in a not very difficult way? :)
>>>>
>>>>> VM can "test" whether an overriding rule matches and then skip all
>>>>> original rules.
>>>>>
>>>>> Superimposition does not change the behaviour of the ATL virtual
>>>>> machine, but does bytecode manipulation at load-time. There is no
>>>>> information on the elements that will match against the rules at
>>>>> load-time.
>>>>>
>>>>> That leaves static analysis to find out whether overriding rules
>>>>> match against the same input as a copying rule. Static analysis is
>>>>> computationally intensive, however, and currently not even possible
>>>>> in ATL.
>>>>>
>>>>>>
>>>>>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element
>>>>>> used do block in matched rules
>>>>>>
>>>>>> and other solutions where provided (different from deleting) that
>>>>>> can not be used in my case. Is there any operation able to delete
>>>>>> element (independent of its metaclass)?
>>>>>>
>>>>>> Thank you in advance,
>>>>>> Jose E. Rivera
>>>>>
>>>>> It looks like you need an operation that actually removes matched
>>>>> rules from a transformation module.
>>>>
>>>> Actually I need an operation to remove elements that match some
>>>> rules. Because not all elements of a metaclass have to be deleted
>>>> (i.e, not copied) only those that macth a rule in relation with
>>>> other elements of other metaclasses.
>>>>>
>>>>> Perhaps this is a good use case for mapping an input element to
>>>>> "nothing"? That seems the closest to a real delete operation. In
>>>>> OCL, "nothing" is represented as OclUndefined. Maybe you can
>>>>> experiment with that?
>>>>
>>>> If I use superimposition all elements will be copied. I have to
>>>> remove those that I don't need after being copied. I can not use a
>>>> matching rule (to match it with OclUndefined or with nothing) since
>>>> these elements will be already in the target model. I think I need
>>>> this operation in the do block....
>>>>> --
>>>>> Dennis
>>>>
>>>> Thank you very much,
>>>> Jose E. Rivera
Re: [ATL] Superimposition, Delete elements [message #68188 is a reply to message #67797] Tue, 04 December 2007 15:16 Go to previous message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi,

Thank you again, but as I told in the previous mail, I need rules to
have more than one element in source pattern. Thus, copy rules won't
have too much sense, since I can not sumperimpose a copy rule with
exactly another rule that modifies it, since more than one rule that
modifies the behavior of copy can have the same type of element (among
others) in the source pattern.

Regards,
Eduardo

Frédéric Jouault escribió:
> Hello,
>
> Let me suggest the following usage of module superimposition:
>
> -- Copy module:
>
> rule CopyA {
> ...
> }
>
> -- Superimposed module:
>
> abstract rule CopyA {
> from
> s : MM!A
> to
> t : MM!A
> }
>
> rule PartillayCopyA {
> from
> s : MM!A
> to
> t : MM!A (
> -- only copy contents of features
> -- you want to copy
> )
> }
>
> rule FullyCopyA extends CopyA {
> from
> s : MM!A -- no filter = default
> to
> t : MM!A (
> -- copy contents of all features
> -- this code may be copied from
> -- rule CopyA of the copy module
> )
> }
>
>
>
> Please, let us know if it works.
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Jose E. Rivera wrote:
>> Hi Frédéric,
>>
>> Thank you very much, but I need ATL 2006 in order to be able to
>> specify more than one element in the source pattern of the rules. I
>> will wait for refining mode for ATL 2006 :)
>>
>> Regards,
>> Jose E. Rivera
>>
>> Frédéric Jouault escribió:
>>> Hi Jose,
>>>
>>> Regarding changing the values of properties: this is not possible yet
>>> (see my answer to "Re: [ATL] Insert elements in reference features").
>>>
>>> However, what you describe could be done in ATL refining mode (only
>>> available in ATL 2004 so far). To delete an element, make sure you do
>>> not transform it or use it in any binding.
>>>
>>>
>>> Regards,
>>>
>>> Frédéric Jouault
>>>
>>>
>>> Jose E. Rivera wrote:
>>>> Hi Dennis,
>>>>
>>>> Thank you very much. Now I think I have understood what you tried to
>>>> tell me. I have written in the imperative block (do) something like
>>>>
>>>> my_var <- OclUndefined;
>>>>
>>>> (being my_var a variable belonging to the source pattern) but it
>>>> does not make any effect, my_var at the end has the same value as
>>>> nothing (the assignement) had been done . But it should work as a
>>>> delete operation, should not it?
>>>>
>>>> Jose E. Rivera escribió:
>>>>> Hi Dennis,
>>>>>
>>>>> Dennis Wagelaar escribió:
>>>>>> Jose E. Rivera schreef:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I'm specifying an ATL transformations to modify some elements of
>>>>>>> a model, and copy the remaining ones. I'm using ATL 2006 since I
>>>>>>> need rules with more than one source element.
>>>>>>>
>>>>>>> At the beginning, I thought to use superimposition feature with
>>>>>>> an ATL transformation that copy all the elements of a model. The
>>>>>>> problem is that superimposition is based on rule names, and I can
>>>>>>> have rules modifying elements with more than one source elements.
>>>>>>> I want all the elements that does not match with any rules to be
>>>>>>> copied. Finally I use Superimposition but all elements are
>>>>>>> copied. Thus, I need an operation to delete elements that match
>>>>>>> with any rule. I have seen the post:
>>>>>>
>>>>>> So, you cannot override all unwanted copying rules, because you
>>>>>> don't have a replacement rule for each original copying rule, am I
>>>>>> correct?
>>>>>
>>>>> Yes, you are right. I can have for example a rule with three source
>>>>> elements to be modified (they also can be added, deleted or
>>>>> modified), and copy rules have one source element. And many rules
>>>>> can have in one of its source elements the same metaclass.
>>>>>>
>>>>>> About superimposition being based on rule names:
>>>>>>
>>>>>> If we want to override rules based on whether they match or not,
>>>>>> then the easiest way is to change the ATL virtual machine
>>>>>> behaviour. The ATL
>>>>>
>>>>> ¿Can it be done in a not very difficult way? :)
>>>>>
>>>>>> VM can "test" whether an overriding rule matches and then skip all
>>>>>> original rules.
>>>>>>
>>>>>> Superimposition does not change the behaviour of the ATL virtual
>>>>>> machine, but does bytecode manipulation at load-time. There is no
>>>>>> information on the elements that will match against the rules at
>>>>>> load-time.
>>>>>>
>>>>>> That leaves static analysis to find out whether overriding rules
>>>>>> match against the same input as a copying rule. Static analysis is
>>>>>> computationally intensive, however, and currently not even
>>>>>> possible in ATL.
>>>>>>
>>>>>>>
>>>>>>> [news.eclipse.modeling.m2m] Re: [ATL] how to delete an element
>>>>>>> used do block in matched rules
>>>>>>>
>>>>>>> and other solutions where provided (different from deleting) that
>>>>>>> can not be used in my case. Is there any operation able to delete
>>>>>>> element (independent of its metaclass)?
>>>>>>>
>>>>>>> Thank you in advance,
>>>>>>> Jose E. Rivera
>>>>>>
>>>>>> It looks like you need an operation that actually removes matched
>>>>>> rules from a transformation module.
>>>>>
>>>>> Actually I need an operation to remove elements that match some
>>>>> rules. Because not all elements of a metaclass have to be deleted
>>>>> (i.e, not copied) only those that macth a rule in relation with
>>>>> other elements of other metaclasses.
>>>>>>
>>>>>> Perhaps this is a good use case for mapping an input element to
>>>>>> "nothing"? That seems the closest to a real delete operation. In
>>>>>> OCL, "nothing" is represented as OclUndefined. Maybe you can
>>>>>> experiment with that?
>>>>>
>>>>> If I use superimposition all elements will be copied. I have to
>>>>> remove those that I don't need after being copied. I can not use a
>>>>> matching rule (to match it with OclUndefined or with nothing) since
>>>>> these elements will be already in the target model. I think I need
>>>>> this operation in the do block....
>>>>>> --
>>>>>> Dennis
>>>>>
>>>>> Thank you very much,
>>>>> Jose E. Rivera
Previous Topic:[ATL] emfvm non-regression tests
Next Topic:M2 to M1 transformation (demotion?)
Goto Forum:
  


Current Time: Thu Apr 25 06:08:57 GMT 2024

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

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

Back to the top