Bug 353199 - Parameter type checking not performed in extended rules in ETL
Summary: Parameter type checking not performed in extended rules in ETL
Status: ASSIGNED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-27 06:53 EDT by Andrey Skorikov CLA
Modified: 2013-06-01 04:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Skorikov CLA 2011-07-27 06:53:16 EDT
The ETL engine does not check the parameter types of the extended rules in ETL.
I have two classes State and Event, which have a superclass Node.
Now I try to map them to the corresponding classes Place and Transition, which have a superclass Element. I consider the mapping of States to Places only.
I defined two ETL rules:

@abstract
rule Elements
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;
}

However, if I change the types of the Elements rule following happens:

@abstract
rule Elements
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 States2Places rule. This is strange because the rule
definitions are inconsistent (the extension does not make sense).

Otherwise, if I change the rule to:

@abstract
rule lements
transform src : Source!Node
to dest : Target!Transition

the States2Places 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.
Comment 1 Dimitris Kolovos CLA 2013-06-01 04:24:05 EDT
There's a new strand of work on static analysis of Epsilon programs which will address this class of problems at design time. Changing severity to enhancement and will revisit when we start integrating the results of this work to the main Epsilon development branch.