[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt.amw] Re: Error in traceability for called rules with params

Hi,

the rule "OutPattern" is valid only for "MatchedRule", because it has the statement "rule".inPattern, as you said.


rule OutPattern {
from
s : ATL!OutPattern
to
t : ATL!OutPattern (
elements <- s.elements->including(traceLink)->union( s."rule".inPattern.elements->union(s.elements)->collect(e |
Sequence {thisModule.LinkEnd(e), thisModule.ElementRef(e)}
)->flatten()
)
)
}



You should create a similar rule, but add one condition for each rule (s.refImmediateComposite().oclIsTypeOf(ATL!MatchedRule) for the current one), and you must also test ATL!Called on the other rule.


However, called rules does not have a "native" traceability behavior, since they do not always have source elements, so we cannot say "this source element is traced into this target element".

The way you obtain the traced elements are different, ie, the expression should be calculated based on the elements you pass as parameters.


Regards,

Marcos.


Marcos.

Ronan wrote:
Hi,
I am trying to use the ATL2WTracer.atl transform to produce a trace model of a transformation. I'm getting an error whenever the input ATL model has called rules with parameters in it. When I remove these rules the transform runs without errors.


For example the following triggers an error....

rule addFunctionalProperty( p : UML!Property ) {
    to
        o : OWL!FunctionalProperty (
                isDefinedBy <- p
        )
}

The error is as follows....

[am3.atl] Executing ATL transformation /UML2OWL/ATL2WTracer.atl
[am3.atl] SEVERE: ****** BEGIN Stack Trace
[am3.atl] SEVERE: message: feature inPattern does not exist on ATL!CalledRule
[am3.atl] SEVERE: A.main() : ??#30 null
[am3.atl] SEVERE: local variables = {self=ATL2WTracer : ASMModule}
[am3.atl] SEVERE: local stack = []
[am3.atl] SEVERE: A.__matcher__() : ??#3 null
[am3.atl] SEVERE: local variables = {self=ATL2WTracer : ASMModule}
[am3.atl] SEVERE: local stack = []
[am3.atl] SEVERE: A.__matchOutPattern() : ??#103 246:54-246:72
[am3.atl] SEVERE: local variables = {s=atlModel!<unnamed>, self=ATL2WTracer : ASMModule}
[am3.atl] SEVERE: variables = {}}, 'sourceVars', Sequence {}]


The error is caused by the "rule".inPattern statements in ATL2WTracer. Obviously I need to be able to include called rules with params in a transformation. Any ideas?
Regards,
Ronan