Author Topic: Model validation from an add-in  (Read 15649 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13257
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model validation from an add-in
« Reply #15 on: September 05, 2014, 08:43:04 pm »
"Count(*)" is not standard SQL and doesn't work on all database types.
First make sure your query works in a real SQL Client and only then try it using Repository.SQLQuery()

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Model validation from an add-in
« Reply #16 on: September 05, 2014, 09:36:46 pm »
Oh. Is there any standard? I thought each vendor just invented its own flavor. iiRC IBM invented SQL in some of their labs. So I guess that there is some IBM standard for DB2. But there is no ISO standard or something like OMG?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13257
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model validation from an add-in
« Reply #17 on: September 05, 2014, 09:47:16 pm »
Yes, there is ANSI SQL.
The most widely supported version is ANSI SQL:92, but according to wikipidia it goes up to ANSI SQL:20011

Geert

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: Model validation from an add-in
« Reply #18 on: September 05, 2014, 11:08:09 pm »
I have tried the query directly towards the database, and it works.
The same error occurs both when using mySQL and MS SQL.

Have sent a question to Sparx regarding this.  I thank you for the help, it feels like we're shooting blind now. :) I hope Sparx have any ideas..
« Last Edit: September 05, 2014, 11:12:57 pm by Sorno »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Model validation from an add-in
« Reply #19 on: September 05, 2014, 11:45:29 pm »
Let us know the outcome.

q.

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: Model validation from an add-in
« Reply #20 on: September 11, 2014, 04:49:16 pm »
Sparx have responded: Alias ...

The error is circumvented by explicit naming the COUNT-column with an alias.

Thank you again for the help.

Update: This is confirmed as a bug, present when not using a EAP-repository.

« Last Edit: October 10, 2014, 05:53:09 pm by Sorno »

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: Model validation from an add-in
« Reply #21 on: September 13, 2014, 12:42:29 am »
I have a new issue with model validation - the time it takes.

When I got SQL working I rewrote some code to optimize the time it would take to run the validation. Alas, it still took a rather long time, so I clocked it (manually).

I had created 6 rules (based on the example from Sparx) and it took over 240 sec to run the validation. I disabled all logic, so that the rules was activated but didn't do anything. The validation then took around 240 sec. Thus, the actual testing hardly affected the total time.

Next I tried to only use one rule, but running the same amount of logic as above (instead of relying on EAs built in ruleIDs I ran the tests depending stereotype). That took about 80 sec.

Last, I ran the validation without any rules at all, which took 75 sec.

It seems that EA's built-in functionality for validation is really, really slow. Is there any point in using the built-in functionality, or is it just better to do it yourself (since your already need an add-in to write the logic)?

I wonder if i'm doing it wrong and anyone else have another experience of it?
« Last Edit: September 13, 2014, 12:45:13 am by Sorno »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Model validation from an add-in
« Reply #22 on: September 13, 2014, 03:53:57 am »
I guess the rules EA applies are rather complex (just have a look into Superstructures and you believe). Sparx is sticking quite strictly to what is written in Superstructures. So that might be the simple explanation. If you just want to verify your own ruleset you should skip the rest by implementing just those test via direct model inspection.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Model validation from an add-in
« Reply #23 on: September 15, 2014, 09:29:51 am »
You can switch off all rules except your own. I think it's Project > Model Validation > Configure Validation Rules. I would be interested to hear your timings with everything else switched off.
The Sparx Team
[email protected]

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13257
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model validation from an add-in
« Reply #24 on: September 15, 2014, 03:54:44 pm »
I wrote my own modelvalidator, partly because the model validation objects weren't available at the time.

But I think I would make the same decision now as well.
I don't like the output the EA validation has, and it doesn't have enough flexibility in selecting what exactly you want to validate.

We have a HUGE model and validating it completely would probably take hours (or days). So I created a mechanism that allows to only validate the part that you touched for a certain request.

Geert

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: Model validation from an add-in
« Reply #25 on: September 15, 2014, 05:17:53 pm »
My timing's are with everything else switch off.

So unless I missunderstand, the time is just for EA to check each element, diagram, and connection, and for each one see that there is no rule to run.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13257
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model validation from an add-in
« Reply #26 on: September 15, 2014, 06:59:23 pm »
Quote
My timing's are with everything else switch off.

So unless I missunderstand, the time is just for EA to check each element, diagram, and connection, and for each one see that there is no rule to run.

I can think of ways to make that more efficient ;D

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Model validation from an add-in
« Reply #27 on: September 15, 2014, 07:55:24 pm »
I just made a test with the example help model. With all turned off it takes 1:40 minutes and it spits out a hand full of warnings (why? didn't I tell him to check nothing?). With all turned on it takes 1:48 minutes.

That#s speaking for itself.

q.
« Last Edit: September 15, 2014, 07:55:44 pm by qwerty »