Menu

#49 No correct exportation of Aggregation References

v1.6.1
open-postponed
5
2009-08-08
2009-06-24
Anonymous
No

I have an EA file with many Aggregation References. Many of the Containments of these Aggregations have the cardinality 0..*. Without any errors, I've got an EMF UML file using the UML2Exporter on the EA file. Next step I produced an EMF Model based on the new EMF UML file to get a *.genmodel and *.ecore file.

Some errors occured validating the new EMF Model file (ecore). It was allways the same error saying that the Reference cardinality of a containment to his container cannot be -1 and must be 1 instead.

So, I looked at the properties of such elements (Container and Containments) inside the EMF Model file. I realized that the properties declaring the Containments as Containers and vice versa. Then, I changed the properties to declare the Containments really to be Containments and Containers to be Containers.

No errors occured validating the refined EMF Ecore file after changes.

Is it possible that the EA-UML2Exporter have a bug when handling Aggregations?

Cheers, Helko

ps: That tool is very great and helpfull!

Discussion

  • Ueli Brawand

    Ueli Brawand - 2009-06-24

    Hi Helko
    I'm not sure what you exactly mean.

    -1 is the representative for *. If you specify nothing for multiplicity in EA then I insert 0..*. That is the equivalent for "not specified".

    In case of an aggregation on both ends 0..* are possible.
    In case of a composition 0..1 is possible on the container end.

    Is it this what you mean?
    Regards, Ueli

     
  • Ueli Brawand

    Ueli Brawand - 2009-06-24
    • milestone: --> v1.6.1
    • status: open --> open-accepted
     
  • Nobody/Anonymous

    Hi Ueli

    No, I meant something else:
    E.g.:
    In the EA file I have Class1 and Class2. Class1 is a container (aggregation) and is containing Class2 as containment.
    After using UML2Exporter, I've got an uml file. Using EMF-Tools, I transformed this uml file into an ecore file.
    Using the Ecore Diagramm Editor (Topcased) or having a look at the EMF reference properties (reference between Class1 and Class2) I realized that the reference between Class1 and Class2 states Class2 as the container and Class1 as the containment.

    Thus, errors was generated during validation of the ecore file (right click on the ecore model and use validate), because:

    The Ecore Validator assumes, that a containments reference to its container must have cardinality 1. Cardinalities 0..1 or 0..* evoke error messages during validation.

    The think behind this is, that a containment shall always be contained by exactly one container.

    This is perhaps an Ecore Validation issue and not relevant for uml models (I agree, in UML it is possible and sometimes wise to use 0..1 or 0..*) generated by the UML2Exporter.

    Regards, Helko

     
  • Ueli Brawand

    Ueli Brawand - 2009-08-08
    • status: open-accepted --> open-postponed
     

Log in to post a comment.