Bug 575027 - [ETL] Direct access to output variables of a transformation rule in other rules
Summary: [ETL] Direct access to output variables of a transformation rule in other rules
Status: UNCONFIRMED
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: 2021-07-26 03:34 EDT by Guillaume Dupont CLA
Modified: 2021-07-26 03:34 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 Guillaume Dupont CLA 2021-07-26 03:34:45 EDT
For any rule of the form:
  rule R from a_in : in!A to b1_out : out!B, b2_out : out!B

it would be useful to be able to access directly a specific output variable from the result of an application of R in another rule; for instance:
  rule R2 from c_in : in!C to d_out : out!D {
    c.elements = c_in.getA().equivalent('R').***b1_out***;
    ...

Currently, using equivalent, even with a filter, will return one of the output (possibly the first?). When the called rule has only one output of type T then one can filter with selectByKind(T) and obtain the desired output; but in this case, both outputs of R have the same type, making it impossible to select one over another.

A solution would be to add a Tuble to the called rule:
  rule R from a_in : in!A to b1_out : out!B, b2_out : out!B, Tb : Tuple {
    ...
    Tb.b1_out = b1_out;
    Tb.b2_out = b2_out;
  }

  rule R2 from c_in : in!C to d_out : out!D {
    c.elements = c_in.getA().equivalent('R').selectByKind(Tuble).b1_out;
    ...



The issue (+ a valid example) has been more thoroughly discussed here:
https://www.eclipse.org/forums/index.php/m/1843090/