Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] parameters in called rules
[ATL] parameters in called rules [message #81558] Sun, 18 May 2008 04:22 Go to next message
neto Mising name is currently offline neto Mising nameFriend
Messages: 33
Registered: July 2009
Member
Well, i m have a throble with a called rule. For instance, consider the
rules below.


rule MainRule {
from myObj:MyMetamodel!MyModel
using {
sequenceObj : Sequence (String) = Sequence{};
}
to
otherObj:MyMetamodel!MyModel(
mySequence <- sequenceObj
)
do {
self.toyRule(sequenceObj);
}
}

rule toyRule(parameter:Sequence(OclAny)) {
do {
parameter <- parameter->including('name');
}
}

Well, when i execute this transformation the value 'name' is not included
in otherObj.mySequence. And, the list manteins empty. So, i think that the
Sequence is passaed as copy to the called rule, but i wanna that this
Sequence should be passed as reference. Someone knowm how can i do it?

Thanks in advance,
Netuh
Re: [ATL] parameters in called rules [message #81755 is a reply to message #81558] Tue, 20 May 2008 15:22 Go to previous messageGo to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hello,

have you tried
parameter->append('name')
instead of
parameter <- parameter->including('name')

I did not try it. I am sorry, if it does not work.
My guess is, that parameter is a local variable in toyRule and the
including function generates a new sequence.
So assigning a new object to the local variable does not change the
passed sequence.


>
> Well, i m have a throble with a called rule. For instance, consider the
> rules below.
>
>
> rule MainRule {
> from myObj:MyMetamodel!MyModel
> using {
> sequenceObj : Sequence (String) = Sequence{};
> }
> to
> otherObj:MyMetamodel!MyModel(
> mySequence <- sequenceObj
> )
> do {
> self.toyRule(sequenceObj);
> }
> }
>
> rule toyRule(parameter:Sequence(OclAny)) {
> do {
> parameter <- parameter->including('name');
> }
> }
>
> Well, when i execute this transformation the value 'name' is not
> included in otherObj.mySequence. And, the list manteins empty. So, i
> think that the Sequence is passaed as copy to the called rule, but i
> wanna that this Sequence should be passed as reference. Someone knowm
> how can i do it?
>
> Thanks in advance,
> Netuh
>
Re: [ATL] parameters in called rules [message #81929 is a reply to message #81755] Wed, 21 May 2008 19:18 Go to previous message
neto Mising name is currently offline neto Mising nameFriend
Messages: 33
Registered: July 2009
Member
Thanks Max, but it does not work. I solve this problem passing as
parameter myObj:MyMetamodel!MyModel instead of sequenceObj.

Thanks again.
Previous Topic:[QVT] The type 'collection:OrderedSet(EAnnotation)' does not conform the type 'OrderedSet(EAnnotatio
Next Topic:[ATL] transformation with JMI
Goto Forum:
  


Current Time: Fri Aug 23 00:38:14 GMT 2019

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

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

Back to the top