Book a Demo

Author Topic: Find discussion status in database  (Read 4670 times)

deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Find discussion status in database
« on: October 19, 2017, 10:53:25 pm »
Hi.
I'm using EA to generate documents containing all the discussions of a project. To do so, I'm using an SQL model search that retrieves t_objects that have a t_document with t_document.ElementType = 'Post'. So far, so good.

But right now, I'd like to generate this document excluding discussions with status "Closed". I searched deeply in the database and found nothing about this status. t_document, for instance, has no column named "status" or so.

Can someone help?

Thanks a lot ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Find discussion status in database
« Reply #1 on: October 19, 2017, 11:03:52 pm »
Well, I almost never used that feature (except for some tests many years ago). I did not manage to create a discussion entry due some Sparxian logic my brain is lacking. If you can give me the steps to create a closed discussion I'll have a look.

q.

deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Re: Find discussion status in database
« Reply #2 on: October 19, 2017, 11:25:53 pm »
Hi qwerty, thanks a lot for your helping hand ^^

To create a discussion:
- select any object in Object Browser, for example an Actor (packages can't have Discussions...)
- open discussions Window: Ribbon, "Start" tab, "Windows" button (on the left), "Discussions"
- double-click on "Create new discussion" and input some text.
- right-click on the text to change discussion status (Open, Awaiting review, Closed). These are the statuses I'm searching for in the database.


deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Re: Find discussion status in database
« Reply #3 on: October 19, 2017, 11:47:43 pm »
Phew...just found how to...grab tightly your socks before they get knocked off...

EA stores the status in t_document.style, in XML.

If the discussion is closed, it appends "\n\t<STATUS>RS_CLSD</STATUS>".
If it's awaiting review, it's "\n\t<STATUS>RS_PEND</STATUS>".

I couldn't see it because tuples in pgAdmin are displayed in a single line. Thus everything after the "\n\t" wasn't visible...

I really wish I had a deep talk with Sparx's database "engineer"...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Find discussion status in database
« Reply #4 on: October 20, 2017, 12:07:49 am »
Happily seeing you solved your issue while I was having a cup of coffee :-)

q.

deadbird

  • EA Novice
  • *
  • Posts: 18
  • Karma: +2/-0
    • View Profile
Re: Find discussion status in database
« Reply #5 on: October 25, 2017, 10:40:30 pm »