Home » Archived » M2M (model-to-model transformation) » [ATL] "Warning, could not find mathing node for ForEachOutPatternElement..."
[ATL] "Warning, could not find mathing node for ForEachOutPatternElement..." [message #22356] |
Fri, 09 March 2007 04:55  |
Eclipse User |
|
|
|
Hi,
I'm working on a transformation which use a CalledRule to factorize some
operations.
When I compile it, I've got this error :
"Warning, could not find matching node for ForEachOutPatternElement in
mode calledRuleCreate" and "... in mode calledRuleInit"
It reports "ERROR: no slot reserved for variable: view used at
XX:XX-XX:XX" for my first Target pattern and the same for the second
pattern.
Here is the code of my CalledRule :
------------------
rule Entities(c : asur!ComputerSystem) {
using {
sources : Sequence(asur!DataExchangeRelation) =
c.relationShipSources->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
and r.target.oclIsKindOf(asur!AOut));
targets : Sequence(asur!DataExchangeRelation) =
c.relationShipTargets->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
and r.source.oclIsKindOf(asur!AIn));
}
to
view : distinct asurIL!E_View foreach(e in sources) (
Name<-'V_'.concat(c.Name.concat('To'.concat(e.target.Name))),
Module_ID <- 'null'
),
control : distinct asurIL!E_Control foreach(e in targets) (
Name<-'C_'.concat(e.source.Name.concat('To'.concat(c.Name))),
Module_ID <- 'null'
)
do {
thisModule.model.components <- view;
thisModule.model.components <- control;
}
}
-------------------
"asur" is my source metamodel and "asurIL" my target metamodel.
When I use this code in my MatchedRule, it works fine, but when I define
this CalledRule, I've got this error.
I call it in the "do" section of 3 Matched rules.
If you see something bad, please tell me where I'm wrong.
Thank you
Guillaume
|
|
|
Re: [ATL] "Warning, could not find mathing node for ForEachOutPatternElement..." [message #22436 is a reply to message #22356] |
Fri, 09 March 2007 05:57   |
Eclipse User |
|
|
|
I found bug 147313 which talk about iterative patterns and "Lazy rules",
which I don't know what is it about.
Are Iterative target patterns in CalledRules implemented in ATL ?
The manual says yes !
Any idea ?
Guillaume
Guillaume Gauffre a écrit :
> Hi,
>
> I'm working on a transformation which use a CalledRule to factorize some
> operations.
> When I compile it, I've got this error :
> "Warning, could not find matching node for ForEachOutPatternElement in
> mode calledRuleCreate" and "... in mode calledRuleInit"
>
> It reports "ERROR: no slot reserved for variable: view used at
> XX:XX-XX:XX" for my first Target pattern and the same for the second
> pattern.
>
> Here is the code of my CalledRule :
> ------------------
> rule Entities(c : asur!ComputerSystem) {
> using {
> sources : Sequence(asur!DataExchangeRelation) =
> c.relationShipSources->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
> and r.target.oclIsKindOf(asur!AOut));
> targets : Sequence(asur!DataExchangeRelation) =
> c.relationShipTargets->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
> and r.source.oclIsKindOf(asur!AIn));
> }
> to
> view : distinct asurIL!E_View foreach(e in sources) (
> Name<-'V_'.concat(c.Name.concat('To'.concat(e.target.Name))),
> Module_ID <- 'null'
> ),
> control : distinct asurIL!E_Control foreach(e in targets) (
> Name<-'C_'.concat(e.source.Name.concat('To'.concat(c.Name))),
> Module_ID <- 'null'
> )
> do {
> thisModule.model.components <- view;
> thisModule.model.components <- control;
> }
> }
> -------------------
> "asur" is my source metamodel and "asurIL" my target metamodel.
>
> When I use this code in my MatchedRule, it works fine, but when I define
> this CalledRule, I've got this error.
>
> I call it in the "do" section of 3 Matched rules.
>
> If you see something bad, please tell me where I'm wrong.
>
> Thank you
>
> Guillaume
|
|
|
Re: [ATL] "Warning, could not find mathing node for ForEachOutPatternElement..." [message #25456 is a reply to message #22436] |
Fri, 23 March 2007 18:54  |
Eclipse User |
|
|
|
Hello,
Iterative patterns are deprecated. They still work with standard rules
to provide compatibility with existing transformations, but they do not
work with features that have been introduced later like lazy rules and
called rules.
In your case, you could create one rule to create an E_View and another
rule to create an E_Control. Then, you can call these rules within a for
statement.
Here is a simplified example in which I only handle the sources:
rule CreateView(e : asurIL!E_View, prefix : String) {
to
view : asurIL!E_View foreach(e in sources) (
Name<-'V_'.concat(prefix.concat('To'.concat(e.target.Name))),
Module_ID <- 'null'
),
do {
view;
}
}
rule Entities(c : asur!ComputerSystem) {
using {
sources : Sequence(asur!DataExchangeRelation) =
c.relationShipSources->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
and r.target.oclIsKindOf(asur!AOut));
}
do {
for(e in sources) {
thisModule.model.components <- thisModule.CreateView(e, c.Name);
}
}
}
Regards,
Frédéric Jouault
Guillaume Gauffre wrote:
> I found bug 147313 which talk about iterative patterns and "Lazy rules",
> which I don't know what is it about.
> Are Iterative target patterns in CalledRules implemented in ATL ?
> The manual says yes !
>
> Any idea ?
>
> Guillaume
>
>
> Guillaume Gauffre a écrit :
>> Hi,
>>
>> I'm working on a transformation which use a CalledRule to factorize
>> some operations.
>> When I compile it, I've got this error :
>> "Warning, could not find matching node for ForEachOutPatternElement in
>> mode calledRuleCreate" and "... in mode calledRuleInit"
>>
>> It reports "ERROR: no slot reserved for variable: view used at
>> XX:XX-XX:XX" for my first Target pattern and the same for the second
>> pattern.
>>
>> Here is the code of my CalledRule :
>> ------------------
>> rule Entities(c : asur!ComputerSystem) {
>> using {
>> sources : Sequence(asur!DataExchangeRelation) =
>> c.relationShipSources->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
>> and r.target.oclIsKindOf(asur!AOut));
>> targets : Sequence(asur!DataExchangeRelation) =
>> c.relationShipTargets->select(r|r.oclIsKindOf(asur!DataExchangeRelation)
>> and r.source.oclIsKindOf(asur!AIn));
>> }
>> to
>> view : distinct asurIL!E_View foreach(e in sources) (
>> Name<-'V_'.concat(c.Name.concat('To'.concat(e.target.Name))),
>> Module_ID <- 'null'
>> ),
>> control : distinct asurIL!E_Control foreach(e in targets)
>> ( Name<-'C_'.concat(e.source.Name.concat('To'.concat(c.Name))),
>> Module_ID <- 'null'
>> )
>> do {
>> thisModule.model.components <- view;
>> thisModule.model.components <- control;
>> }
>> }
>> -------------------
>> "asur" is my source metamodel and "asurIL" my target metamodel.
>>
>> When I use this code in my MatchedRule, it works fine, but when I
>> define this CalledRule, I've got this error.
>>
>> I call it in the "do" section of 3 Matched rules.
>>
>> If you see something bad, please tell me where I'm wrong.
>>
>> Thank you
>>
>> Guillaume
|
|
|
Goto Forum:
Current Time: Sat May 03 01:22:20 EDT 2025
Powered by FUDForum. Page generated in 0.03157 seconds
|