Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 09:55 Go to next message
Guillaume Gauffre is currently offline Guillaume GauffreFriend
Messages: 65
Registered: July 2009
Member
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 10:57 Go to previous messageGo to next message
Guillaume Gauffre is currently offline Guillaume GauffreFriend
Messages: 65
Registered: July 2009
Member
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 22:54 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
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
Previous Topic:[ATL]Load Model Problem in ATLEMFModelHandler
Next Topic:[ATL]Does ATL Engineer always transfer "Element"(SimpleType) to "Attribute" ?
Goto Forum:
  


Current Time: Fri Apr 26 12:31:26 GMT 2024

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

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

Back to the top