Book a Demo

Author Topic: Model Addin Using MySQL  (Read 8354 times)

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Model Addin Using MySQL
« on: April 16, 2021, 05:36:25 pm »
I'm trying to get a Model (Javascript) Addin to work but for some reason EA refuses to enable the Addin when the model is hosted on a MySQL repository.  It consistently remains at "Disabled" in the Manage Addins window, even if you reset it.  When the model is hosted in a EAP file the addin will show as Optional by default.  Has anyone else come across this and if so did you find a workaround?

I'm using EA 15.1, build 1528.

Thanks in advance,
Martin

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Model Addin Using MySQL
« Reply #1 on: April 16, 2021, 07:03:40 pm »
I would suspect that in your code you have something that fails with MySQL (but not EA). Do add a bunch of traces or just debug it.

q.

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #2 on: April 16, 2021, 07:09:02 pm »
Thanks for the suggestion qwerty  :)

Unfortunately I think it's more fundamental than the script (that was my first thought).  For example, the following steps work in an EAPX based model but fail in a MySQL hosted one:

1) Create class diagram
2) Add a JavascriptAddin class to the diagram (from the Model AddIns toolbox page)
3) Check the status of the AddIn in Specialise-->Addins-->Manage-Addin

Under EAPX the addin is shown as "Optional".  When in MySQL hosted repo the addin is shown as "Disabled".  Both cases without adding any signals/receptions or script code.

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #3 on: April 17, 2021, 12:10:45 am »
Just to follow-up on this, I've found that this issue doesn't happen when using MariaDB, with their ODBC connector, so that at least gives a way forward.

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #4 on: April 26, 2021, 08:29:40 pm »
Unfortunately this worked for a short while using MariaDB, but the Addin is now showing as disabled again.  I've since discovered that this behaviour is somehow linked to User Security - if I disable user security (whilst hosted on MariaDB) then the addin works again.  As soon as user security is switched on it reverts to disabled and cannot be renabled from the Manage Addins dialog.  This applies to any user, irrespective of permissions (i.e. the same thing happens with the Admin user despite it having all model permissions).

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #5 on: April 26, 2021, 08:37:23 pm »
Think I've finally cracked it  :). The issue seems to be having a blank in the "Groups" column in the Manage Add-ins window.  If I set this to Administrators for example (which is the only group currently defined in my model) then it works.  This despite other loaded addins having no group set and despite this not being needed when loading the model from an EAPX file.  Another EA quirk to add to the list....  Happy days  :)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Model Addin Using MySQL
« Reply #6 on: April 27, 2021, 08:53:52 am »
Yes, model add-ins are enabled by security group.

Any chance that the other add-ins aren't model add-ins? That's the best explanation I can think of why they would still work. The other possibility (that I haven't investigated) is that it's theoretically possible that something is missing or failing to load in the dialog, but works when determining which add-ins to actually load.

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #7 on: April 27, 2021, 02:44:20 pm »
Hi Eve,

Thanks for your reply - yes the others are not model addins.  It was just a little strange that it worked when loading the model as an EAPX but not under MySQL/MariaDB.  An error dialog or message on load would be useful really to give a clue as to what's going wrong, but it just failed to load the addin silently.  I did look in the Sparx user data directory for a log file that might help but couldn't find anything (only a database error log).

Martin

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Model Addin Using MySQL
« Reply #8 on: April 27, 2021, 03:58:41 pm »
Does your eapx model have security disabled? Because that would explain it.

When security is model add-ins are configured against specific security groups. Can't really have an error message on load, because without being bound to a group it's not meant to load.

potterm

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Model Addin Using MySQL
« Reply #9 on: April 27, 2021, 05:18:57 pm »
I thought security was enabled in the EAPX as well, but it's possible that I copied the model using a package copy/paste, which would explain it.  In respect of error messages, I understand that now (i.e. that model addins should be linked to a group if security is used) - but when manually enabling the Add-in using the Manage Addins window an error/dialog would be useful when you try to enable it (and it fails) - at the moment it just silently disables it again (and you only know this by opening up Manage Addins again and seeing it listed as disabled).