Parameter type checking in extended rules in ETL [message #699821] |
Fri, 22 July 2011 11:34 |
Eclipse User |
|
|
|
Originally posted by: Andrey Skorikov
Hello,
I have a question regarding the type of parameters in the transformation
rules in ETL. If I understand the semantics of rule extension correctly,
then a rule which extends another rule should have both left and right
parameter types which have a subtype relationship with the the parameter
types defined in the extended rule (covariance). For example consider
following rules:
@abstract
rule BasicElements
transform src : Source!Node
to dest : Target!Element {
dest.name := src.name;
}
rule States2Places
transform src : Source!State
to dest : Target!Place
extends Elements {
dest.foo := src.bar;
}
where State is a subtype of Node and Place is a subtype of Element. Now,
if I change the types of the BasicElements rule, following happens:
rule BasicElements
transform src : Source!Event
to dest : Target!Element
In this case, since State is not a subtype of Event, the transformation
of states simply does not happen at all: the engine just skips the
execution of the States rule. This is strange because the rule
definitions are inconsistent (the extension does not make sense).
Otherwise, if I change the rule to:
rule BasicElements
transform src : Source!Node
to dest : Target!Transition
the States rule is executed without complaints, which is also strange,
because Place is not a subtype of Transition.
In both cases I would expect some kind of error raised, but in the
implementation it is not the case. Why?
(I am using version 0.8.8)
Regards,
Andrey Skorikov
|
|
|
|
Powered by
FUDForum. Page generated in 0.03119 seconds