Author Topic: Diagram modified date not changed after deletion of element  (Read 5177 times)

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Hi all,

some days ago I discovered a very strange (IMHO) behaviour in EA:
When I delete elements from the project browser, which are placed in a diagram, the element disappears from the diagram (so far so good) but the modified date of the diagram has not changed although the diagram is changed.
This brings huge problems for me. I must detect, whether a diagram has changed since a special date and so I can't achieve this only by comparing the dates.

Can someone explain this behaviour to me?

Maybe there is also one who knows how to update the modified date in this case. Currently I check for changes by calculation MD5 checksums for the generated diagram pictures, which is very time consuming.

Thanks and Greetings,

Jörg

P.S.: I'm writing an AddIn but I decided to write here because this behaviour for me is a bug.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8597
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Diagram modified date not changed after deletion of element
« Reply #1 on: May 15, 2020, 07:31:45 pm »
Hi all,

some days ago I discovered a very strange (IMHO) behaviour in EA:
When I delete elements from the project browser, which are placed in a diagram, the element disappears from the diagram (so far so good) but the modified date of the diagram has not changed although the diagram is changed.
This brings huge problems for me. I must detect, whether a diagram has changed since a special date and so I can't achieve this only by comparing the dates.

Can someone explain this behaviour to me?

Maybe there is also one who knows how to update the modified date in this case. Currently I check for changes by calculation MD5 checksums for the generated diagram pictures, which is very time consuming.

Thanks and Greetings,

Jörg

P.S.: I'm writing an AddIn but I decided to write here because this behaviour for me is a bug.
Hi Jörg,

Do you mean an active diagram or one that is not active?  It's not necessarily a simple problem.  As you may be aware, when you add an arc between two vertices on one diagram (or even in the background DB), when you open a diagram that contains the vertices, the new arc is now visible.  Has the diagram changed?  How do/would you know?

(I can answer that because we've done work on "freezing" diagrams and EA now has similar functionality).

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Diagram modified date not changed after deletion of element
« Reply #2 on: May 15, 2020, 08:13:44 pm »
When you delete an element the diagram does not recognize it. You can verify it if you have a diagram open and delete the element (so it's delete in the browser too) it will not change the diagram dirty flag. I think that's the way it is. If you want a different behavior you need to write an add-in that reacts on element deletion, searches where it was placed on a diagram and change the diagram modified date.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13283
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram modified date not changed after deletion of element
« Reply #3 on: May 15, 2020, 08:58:02 pm »
As the other have mentioned, EA doesn't really notice the changes until you open the diagram, and even then, if you just open it without saving, I'm guessing it won't update the modified date.
I suspect that the modified date will only be updated if you actually save a diagram in the application; which of course accounts for only a small percentage of possible ways a diagram can be changed.

But there might be another solution:
You might be able to use the feature to store the diagram image and maps automatically.

This feature is meant to store up-to-date images + imagemaps for each diagram in the database. It is used to show the diagrams in WebEA or Prolaborate.

These records are stored in t_document.
So if your add-in would read the t_document you might be able to determine that way if a diagram has been changed.

For this to work:
- you have to enable the option to automatically save diagram imagemaps (I think it's a user setting, I'm not sure, might also be a model setting)
- EA has to be clever enough to know when it needs to update those diagram imagemaps (e.g. when you delete an element show on a diagram)

Geert

jörg

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Diagram modified date not changed after deletion of element
« Reply #4 on: May 16, 2020, 09:25:39 pm »
Hi all, thanks for your attention. For noe I decided to calculate and store hashes over the GUIDs of the diagram objects of a diagram. So if someone is deleted, the hash is different. This is pretty fast and secure. The methosd with generating a checksum over the generated picture is very time consuming, that*s why I changed it.

@Geert: Thanks for the hint with the database, I'm sure it will be useful in future.

CU,

Jörg