Author Topic: Access an element's discussions using a script.  (Read 209 times)

deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Access an element's discussions using a script.
« on: October 25, 2017, 10:37:19 pm »
Hi everyone.

I've been struggling lately with discussions. See http://www.sparxsystems.com/forums/smf/index.php/topic,38373.0.html for more.

My final aim is to create a report of every discussion in the model with a particular status. For example, generate a report containing all of the "Awaiting review" discussions.
And gueww what? There is no way to do this using regular document generations, even using Model Search. Because no, discussions have no ea_guid...

So I'm trying to complete this using scripts. So far, my jscript iterates through the whole model and thus has access to every single element/package. But now, I can't find a way to access these elements/packages' discussions. I've searched through the model (see http://sparxsystems.com/enterprise_architect_user_guide/13.5/automation/reference.html), no luck so far...

Can someone help?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7752
  • Karma: +165/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access an element's discussions using a script.
« Reply #1 on: October 25, 2017, 10:43:22 pm »
I'm afraid the discussions are not exposed in the API. (send in a feature request?)
In that case the only way to get them (short term) is to query the database directly.

You can use Repository.SQLQuery()

Geert

deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +1/-0
    • View Profile
Re: Access an element's discussions using a script.
« Reply #2 on: October 26, 2017, 08:28:58 pm »
the more I know about how EA implements Discussions, the more I think it's been coded by a trainee...

PeterHeintz

  • EA User
  • **
  • Posts: 549
  • Karma: +37/-14
    • View Profile
Re: Access an element's discussions using a script.
« Reply #3 on: October 26, 2017, 08:57:35 pm »
Yes, from my perspective, this is among other things, some really rudimentary implemented stuff.

I personally did my own MDG to handle review stuff. In principle it could be well suited to our needs, but there are some sticky corners just because some implemented EA constraints not needed but disturbing.
Best regards,

Peter Heintz