resolvetemp and Sequence [message #1809418] |
Tue, 16 July 2019 03:31 |
Marshall Charron Messages: 72 Registered: August 2018 |
Member |
|
|
Hi
Given this sample :
rule rule1 {
from s: MMA!MAModel
to t : MMA!MAModel(
objects <- s.objects, -- This is a Sequence of MMA!Object
)
}
rule rule2 {
from s : MMB!Any
to t : MMA!Object(
name <- s.anyname
)
}
I would like to add the target of rule2 i.e MMA!Object in "objects" of rule1, how can I achieve that ?
[Updated on: Tue, 16 July 2019 03:33] Report message to a moderator
|
|
|
|
|
|
Re: resolvetemp and Sequence [message #1809548 is a reply to message #1809529] |
Thu, 18 July 2019 00:10 |
Marshall Charron Messages: 72 Registered: August 2018 |
Member |
|
|
As I said the previous rules create MMA!Object outside of MMA!MAModel. But now I am trying to include it inside 'objects', but still don't figure it out :
rule rule1 {
from s: MMA!MAModel
to t : MMA!MAModel(
objects <- thisModule.resolveTemp(s.objects, 't') , -- This is a Sequence of MMA!Object
)
}
rule rule2 {
from s : MMB!Any
to t : MMA!Object(
name <- s.anyname
)
}
But I got this error :
org.eclipse.m2m.atl.emftvm.util.VMException: Cannot resolve default trace target 't' for Sequence{X:MMA!Object}
Anyone can help ?
Thanks in advance
[Updated on: Thu, 18 July 2019 02:56] Report message to a moderator
|
|
|
|
|
Re: resolvetemp and Sequence [message #1809709 is a reply to message #1809684] |
Sun, 21 July 2019 17:37 |
|
s.objects->union(MMB!Any.allInstances())
is a mixed Sequence of MMA!Object and MMB!Any. As soon as this mixed Sequence is passed through the '<-' operator, all source elements in this Sequence are replaced by their default (=first) target element (regardless of the rule by which these elements are generated). This is called the implicit tracing mechanism.
Cheers,
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.02353 seconds