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