Author Topic: Is there a way to override the value displayed for a tagged value?  (Read 5239 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Looking at the Sparx automation interface, there seems to be a way to override what is entered by the user into the tagged value (i.e. by capturing the input using the tagged value broadcast event).
However, is there a way to intercept the text that is displayed for the tagged value and do some "massaging" on it so that the user sees something different from what is actually stored in the database?

Cheers

Jays :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #2 on: October 26, 2020, 05:38:18 am »
Hey Thomas

I did see that already and from what I understand, this will allow me to implement a custom editor for the tagged value.
However, what I am wanting is to override what is displayed in the Tags pane of the Element/Connector/Attribute.

For example, the tagged value might have "ABC" stored in the database but I want the user to see "Alpha Bravo Charlie".
Is there a way to do this?

Cheers :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #3 on: October 26, 2020, 06:24:19 am »
I'm not sure if I get what you actually want but it merely looks like you want a drop down here. There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for drop down. However, for drop downs a user does not need to type the long string but rather select it.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #4 on: October 26, 2020, 01:30:22 pm »
I'm not sure if I get what you actually want but it merely looks like you want a dropdown here. There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for dropdown. However, for dropdowns, a user does not need to type the long string but rather select it.

q.
I think what Jayson wants is something I've thought would be useful (especially for an enumeration).  The literal is a code, but there is an associated caption which is the value to be presented to the user.

One could envision:
Code: [Select]
Type=Enum;
Values=P,R,S,A;Captions=provided,required,symmetric,assembly
Or some escape character for the Values to indicate the Caption.   P//provided,R//required

Obviously, with the separated lists, synchronisation would be the responsibility of the MDG maintainer.

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #5 on: October 26, 2020, 02:02:46 pm »
There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for dropdown. However, for dropdowns, a user does not need to type the long string but rather select it.
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #6 on: October 26, 2020, 06:54:42 pm »
There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for dropdown. However, for dropdowns, a user does not need to type the long string but rather select it.
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.

? How is this done/look like?

@Paolo: Interesting. That one slipped my mind (or maybe it was introduced only recently?).

q.
« Last Edit: October 26, 2020, 06:56:31 pm by qwerty »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #7 on: October 27, 2020, 06:14:00 am »
There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for dropdown. However, for dropdowns, a user does not need to type the long string but rather select it.
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.
? How is this done/look like?
@Paolo: Interesting. That one slipped my mind (or maybe it was introduced only recently?).
I'm gonna take a wild stab in the dark and say it's hard-coded and only applies to Sparx. I've never seen any documentation outlining how to achieve this in a custom technology. (And I have looked.)

Going back to the OP, there is to my knowledge no way of showing something other than what's in the database in the properties dialog/window (pending clarification from Eve, although that would of course be outside my knowledge so my point stands).
You can have a tagged value stored in the database and show something different in diagrams using a shape script. But it's feasible only for limited enum tags, and since you can't control the display of those same tagged values in the properties dialog/window, this sort of behaviour will tend to confuse the user.

It is also quite possible to replace tagged values in generated documents if you use either a document generation script, or SQL / script template fragments. But again, very likely not worth the effort.

Paolo's suggestion I read as a - uh, suggestion. I don't think it actually exists.
But it's not a bad one, and in the profile model it could be implemented as an initial value on the enum literal.

But if the functionality already exists to intercept the tagged value data coming from (and going to!) the database, all that's needed is for Sparx to enlighten us as to how to access it in a custom technology.

/U
My theories are always correct, just apply them to the right reality.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #8 on: October 27, 2020, 07:07:09 am »
There is no DB to GUI translation possible with EA. You will always see what is in the DB, also for dropdown. However, for dropdowns, a user does not need to type the long string but rather select it.
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.

Okie dokie, so the next question is can WE the mere non Sparxian mortals access this and override what appears in those boxes?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #9 on: October 27, 2020, 08:28:05 am »
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.
The people you describe as Sparxians don't do this. There is a mechanism that allows our translators to show translated values in various combo boxes etc. It is not intended or usable as a general purpose substitution.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #10 on: October 27, 2020, 09:39:29 am »
Ok, so not intended as a general pupose solution.
BUT is there a way to do it that I can access?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #11 on: October 27, 2020, 11:03:55 am »
[SNIP]

Paolo's suggestion I read as a - uh, suggestion. I don't think it actually exists.
But it's not a bad one, and in the profile model, it could be implemented as an initial value on the enum literal.

[SNIP]
Indeed, Uffe, it is not possible to envision something that already exists...  ;)  But in these post-fact, post-truth, post-rigorous times, who knows what you might have understood by that word.  [NOT a criticism of you, just the world we live in.   ::)]

Paolo

[Envision: to picture mentally, especially some future event or events.]
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #12 on: October 28, 2020, 09:25:38 am »
That's not entirely true. Translated versions of EA can and do display a different value from the one saved into the database.
The people you describe as Sparxians don't do this. There is a mechanism that allows our translators to show translated values in various combo boxes etc. It is not intended or usable as a general purpose substitution.

Are we the mere mortals able to do this? If so, how?

Cheers :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Is there a way to override the value displayed for a tagged value?
« Reply #13 on: October 28, 2020, 10:55:07 am »
Reading Eve's answer I'd say: become a translator.

q.