Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [atl] foreach related with Called rule
[atl] foreach related with Called rule [message #77182] Wed, 19 March 2008 12:39
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello,

I know the foreach statement does not work inside the called rule, but I
also got error in run time when I invoke a called rule form a matched rule
with a foreach statemnet.

rule Concept2Topic{
from ....
to
newLearnerStereotypes : distinct COURSE!LearnerStereotype foreach (e
in DOMAIN!LearnerStereotype.allInstances())(
type <- e.type,
knowledgeConstraints <-
Sequence{thisModule.ruleNewKnowledgeConstraint(e.knowledgeCo nstraints.first())}.debug('-------')
),


rule ruleNewKnowledgeConstraint(r1p1:DOMAIN!KnowledgeConstraint){

to
r1p2: COURSE!KnowledgeConstraint (
name <- r1p1.name
)
do{
r1p2;
}
}

Error:

[am3.atl] INFO: sfsdf: Sequence {mikaelLow!xml, mikaelLow!xml,
mikaelLow!java}
[am3.atl] INFO: sfsdf: Sequence {mikaelLow!xml, mikaelLow!xml,
mikaelLow!java}
[am3.atl] INFO: -------: Sequence {OUT!xmlGoal}
[am3.atl] INFO: -------: Sequence {OUT!xmlGoal2}
[am3.atl] SEVERE: ****** BEGIN Stack Trace
[am3.atl] SEVERE: exception:
[am3.atl] SEVERE: null
[am3.atl] java.lang.reflect.InvocationTargetException
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.atl] at
org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:59)
[am3.atl] at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
[am3.atl] at org.eclipse.
...........

Thank you,
Wong
Previous Topic:[ATL] Programmatically
Next Topic:[ATL] Where are other posts ?!
Goto Forum:
  


Current Time: Fri Apr 19 05:31:17 GMT 2024

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

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

Back to the top