| Summary: | Wrong conditional unit results according to wrong resolved attribute conditions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] EMFT.Henshin | Reporter: | Johannes Tietje <johannes.tietje> | ||||
| Component: | Interpreter | Assignee: | Project Inbox <henshin.interpreter-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Johannes Tietje
Created attachment 193751 [details]
The minimal example project mentioned in the description.
Hello,
the problem is more general, because only attribute conditions that contain parameters initialized by the rules are checked.
To illustrate the problem, assume parameter A which is passed to the rule (for example via parameter mapping), parameter B which is initialized by the rule match and parameter C which is neither passed to the rule nor initialized by the match:
A == null: this condition will be checked before the matching starts if A is set
A == B: this conditions will be checked as soon as the object containing B is matched
B == null: this conditions will be checked as soon as the object containing B is matched
C == null: this conditions is not checked because at the end of matching C remains unknown
1+1 == 2: this condition is never checked because it does not contain parameters
Parameter mappings always initialize their target variable either with the value of their source parameter or "null" if the source parameter is not initialized. If you use only rules you have to explicitly set a parameter even if you want its value to be "null" e.g. ra.setParameterValue("C",null);
Regards,
Enrico
|