Book a Demo

Author Topic: Modifying Stereotype in OnPost method  (Read 4475 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Modifying Stereotype in OnPost method
« on: April 04, 2012, 09:36:40 pm »
When you modify the stereotype inside a OnPostNewConnector EA ignores that change. It seems to write it to the database but keeps it in the diagram. Once you (need to) save the diagram chnges, the stereotype is written back again.

Trying the same with OnPostNewElement EA ignores ALL changes made. The same when trying to change the Type.

OT: How do the Sparxians test their software? Any time they add more functionality but it's not getting better. So many functions simply do not work. Time for another geert-around I have to say once again. It seems I'm turning in circles. Like love between hedgehogs. If you're approaching too much you get hurt.


Mea culpa. I was using the EventProperties as if it were the element itself. After fetching the element explicitly it worked as expected.
 
q.
« Last Edit: April 12, 2012, 09:45:22 pm by qwerty »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modifying Stereotype in OnPost method
« Reply #1 on: April 05, 2012, 10:03:00 am »
q,

EA seems to do that a lot - reporting what is ON DISK not what is on diagram.  The diagram and the disk are only vicariously connected.

Certainly needs a redesign in thes area.

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

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Modifying Stereotype in OnPost method
« Reply #2 on: April 05, 2012, 10:25:24 am »
Not sure, because the behavior described differs, but s.th. like mentioned here might help:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1333578139

WBR
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Modifying Stereotype in OnPost method
« Reply #3 on: April 05, 2012, 03:34:08 pm »
That is indeed a general problem when writing add-ins.
It seems that both the EA GUI and the API are separate clients that both access the database.
They can call each other, but each has its own "in-memory" model.
So changes made by the API are not reflected on the GUI unless you tell it to refresh (flush its in-memory object(s) and get the data again from the database).
Once you see the architecture like this it kinda makes sense.

Geert

PS. Think of the it as if the GUI client would be running on another machine, that helps as well.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modifying Stereotype in OnPost method
« Reply #4 on: April 05, 2012, 06:57:59 pm »
Quote
That is indeed a general problem when writing add-ins.
It seems that both the EA GUI and the API are separate clients that both access the database.
They can call each other, but each has its own "in-memory" model.
So changes made by the API are not reflected on the GUI unless you tell it to refresh (flush its in-memory object(s) and get the data again from the database).
Once you see the architecture like this it kinda makes sense.

Geert

PS. Think of the it as if the GUI client would be running on another machine, that helps as well.
It may well make sense - but the implmentation is BROKEN...

When you load a diagram, EA will update the diagram with any changes (like adding a new attribute etc).  But when you ask EA what is the size of the shape, you get the old size from the disk not the size on the screen.

The API doesn't say XXXFromDisk it just says XXX.

It doesn't even tell you the diagram is "Dirty" although on screen you get the "*" indicator.

Paolo
« Last Edit: April 05, 2012, 06:59:18 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!