Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Can I use foreach in called rules?
Can I use foreach in called rules? [message #70009] Thu, 20 December 2007 14:48
Alexandre Torres is currently offline Alexandre TorresFriend
Messages: 139
Registered: July 2009
Senior Member
Hi.
I'm getting a compilation error every time I try to create a called rule
that uses the foreach construct. I'm sort of clueless what's going on...

The error is

INFO: Dumping ASM to C:/eclipse/atl/eclipse/workspace/Teste/problem.asm
INFO: Warning, could not find mathing node for ForEachOutPatternElement in
mode calledRuleCreate
INFO: Warning, could not find mathing node for ForEachOutPatternElement in
mode calledRuleInit
SEVERE: null
java.lang.NullPointerException
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMString.evalSOTSBr ackets(ASMString.java:346)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

I tried to reduce the fragment to the smallest possible, so I can only
imagine that the foreach is not supported on called rules. here is my
piece of code - it doesn't make much sense now that I stripped from the
big program.

rule createNodes(uc: UML!OpaqueAction){
using {
coll : Sequence(String) = Sequence{'a', 'b', 'c'};
}
to
cells : distinct UMLOut!ControlFlow foreach(e in coll)(
name<-e
)

}

If I move this to a matched rule, it works fine.
Thanks
Previous Topic:[ATL] Starting development of a new, faster Virtual Machine
Next Topic:[ATL] Getting value of an Attribute with reference to EAttribute metaclass
Goto Forum:
  


Current Time: Sun Apr 11 02:24:24 GMT 2021

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

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

Back to the top