Book a Demo

Author Topic: Synchronize stereotype bug when name contains a single quote  (Read 3432 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Hi,

I have an MDG with a stereotype which name contains a single quote e.g. "that's my test"
Having updated the tagged values definition, I made an attempt to synchronize it both from a script (Repository.CustomCommand("Repository", "SynchProfile", ...), or manually using the toolbox (right click > sync stereotype).
The query sent by EA doesn't handle single quote and generates an error message. I found the following query from the DBError file:
Select Object_ID, Description from (t_xref inner join t_object on t_xref.Client = t_object.ea_guid) where (t_xref.Name = 'Stereotypes') and (t_object.Object_Type <> 'Package') and (t_xref.Description LIKE '%Name=that's my test;%')

It would work if the single quote would be escaped by doubling it e.g.
Select Object_ID, Description from (t_xref inner join t_object on t_xref.Client = t_object.ea_guid) where (t_xref.Name = 'Stereotypes') and (t_object.Object_Type <> 'Package') and (t_xref.Description LIKE '%Name=that''s my test;%')


Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize stereotype bug when name contains a single quote
« Reply #1 on: June 27, 2022, 04:47:50 pm »
Hi Guillaume,

Probably not the best idea to have single quotes in your taggged value names.
I can imagine wreaking havoc in other places as well.

If I was you I would change the tagged value name to avoid the single quotes.

Geert

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Synchronize stereotype bug when name contains a single quote
« Reply #2 on: June 27, 2022, 05:31:59 pm »
Hi Geert,

The single quote is used in the stereotype name but I will indeed consider with my client removing it, especially as we can maintain it in the metatype.
However I think it should be fixed in EA.

Thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Synchronize stereotype bug when name contains a single quote
« Reply #3 on: June 27, 2022, 06:30:49 pm »
However I think it should be fixed in EA.

You are absolutely right about that. It's a bug and should be fixed.

Geert