Search code examples
enterprise-architect

How to extract the extension point which is set to an extend relation between use cases in Enterprise Architect using the API


I have a Usecase diagram which has usecases having extends relationship. I want to know if there is any API which can be used to know what extension point is set to a specific extends relation (out of many extension points that can be applied). The Usecase diagram along with the Extension Point highlighted is shown below. enter image description here


Solution

  • Assuming this being a standard note and not some fancy new EA feature you can find such a note with a simple query:

    SELECT note as n FROM t_object WHERE pdata4 = "idref1=<connectorID>"
    

    where <connectorID> needs to be the connector's id in question. That will return the text written in the note. Just use Repository.SQLQuery to pass that to EA. You need to unwrap the returned XML in whatwever language you use (I'm using my Python framework which does that and returns a row array of column arrays).

    Edit Having found how to create such a note the above still is valid. However, it seems that EA also sets the name of the element to #EXP#<objectID>. So you could likely use that as search criterion as well.