Menu

EA and Associations

2011-02-25
2013-04-29
  • Michael Müller

    Michael Müller - 2011-02-25

    Hi,

    i have an association. In the EA(8.0) Properties Dialog at the Tab "Source Role" i set the property Navigability = Navigable. 1. But my Association is not navigable:
    Xpand Code:

    «FOREACH this.AllAssociations().typeSelect(uml::Association) AS ass»
    «FOREACH ass.ownedEnd.select(e|e.type.name!=name) AS a»
    //1. name!=name «a.name» «a.isNavigable()»
    «ENDFOREACH» 
    «ENDFOREACH»
    Java Code:
    public static EList getAllAssociations(Classifier classifier) {
    return classifier.getAssociations();
    }
    [code]
    2. I add a qualifier in this association, but the collection is also empty
    [code] «ass.qualifier.size» //always 0 [/end]
    3. How could i get teh direction of the association? I tried:
    [code] «ass.associationEnd» [/end] but its always null!
    Has anybody an idea how to solve this problems? Or does the EA_Exporter not export this information?
    
     
  • Michael Müller

    Michael Müller - 2011-02-25

    oh sorry could you edit my code tags, they are wrong.

     
  • Ueli Brawand

    Ueli Brawand - 2011-02-25

    Hi Micheal

    EA_Exporter export the navigability information.

    Here is an extension that works for me

    uml::Property sourceEnd(uml::Association this):
        let meList = memberEnd.select(e|!e.isNavigable()):
        meList.size == 1 ? meList.get(0) : null;
    

    This extension is available in the exporter as following:

    extension net::cmp4oaw::uml2::support::UMLSupport
    

    Hope this helps.

    Ueli

     
  • Ueli Brawand

    Ueli Brawand - 2011-02-25

    Oh, now I see why it isn't working.

    You use ownedEnd() instead of memberEnd().

    ownedEnd() are for associations where navigability is not set!!

    Ueli

     
  • Michael Müller

    Michael Müller - 2011-02-25

    Ahhhh nice =) that works =) if i use memberEnd()…

    But how does i get my other information? The qualifiers and the direction?

     
  • Ueli Brawand

    Ueli Brawand - 2011-02-25

    Direction is not a property of UML model. This is somerthing internal of EA.

    In UML there is no "direction". An association has two or more ends. Each end could be navigable, non-navigable or not defined. If it's navigable in the classifier of the oposite end a property is added. So if you need a direction, you have to find it out yourself.

    Qualifiers are not supported yet. If you need them, pleas add a feature request.

    :-)

     
  • Michael Müller

    Michael Müller - 2011-03-03

    thanks =)…

    i done a feature request.

     
  • Michael Müller

    Michael Müller - 2011-03-07

    Can you estimate the time, when the next realease is available (with the qualifiers?

     
  • Ueli Brawand

    Ueli Brawand - 2011-03-14

    Hi Michael
    I'm working on it and I hope it will be finished until end of this week. Then I prepare a release for you for testing.

    Regards

     

Log in to post a comment.