[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.gmt] Re: [MOFScript] 1.1.5 : rules overriding does not work?

Hello Yannik

probably this error has the same reason as the ignored inheritance. (-> see thread "MOF Script ignores inheritance").

The reason for this was that the runtime environment always only pics the first fitting transformation rule from the "TransformationProxy" and does not care about the inheritance dependencies.

Maybe the same occurs when using overriding of rules. Which means that the matching for the transformation rules is only based on the name of the transformation rule instead of the complete rule signature including the context definition.

Maybe you could check the order of the transformation rules in the TransformationProxy at runtime to see if the runtime always pics the first transformation rule with a specific name.

Cheers
Jan

Yannick wrote:
Hi,

I noticed another strange behaviour when using rules' overriding.

1) when the call to rule (ex: myrule() ), and the two rules definition
(ex : uml.Class::myrule() and uml.Interface::myrule() ) are all in the
same file, rules' overriding works properly.

2) when the two rules definition are in the same template, but not in
the same as the call, rules' overriding doesn't work : it applies only
the latest defined rule.
Ex: file1:
	classOrInterfaceWithClassifierContext.myrule()

    file2:
	uml.Class::myrule(){
		...
	}
	uml.Interface::myrule(){
		...
	}
This way, only the rule with Interface context will apply, even when
context is Class.

Is there anyone having the same problem?