Author Topic: Check if Model Validation produced errors  (Read 4562 times)

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Check if Model Validation produced errors
« on: May 21, 2013, 11:52:06 pm »
Hi everyone,

I've been developing an EA Add-in which performs a model validation of some custom rules. Now I would like to check if the validation succeeded (without errors or warnings). My idea is to perform this check in the "EA_OnEndValidation" method, but I don't know where this information is stored. Can anyone help me out?

Many thanks!  :)


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Check if Model Validation produced errors
« Reply #1 on: May 22, 2013, 04:02:05 pm »
André,

At a first glance it doesn't look like you have access to the results of the model validation.
I think the results are written to the system output only, no to the database, and I haven't seen any functions to read the system output completely (only a line when clicked or doubleclicked)

Geert

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Check if Model Validation produced errors
« Reply #2 on: May 23, 2013, 06:49:17 am »
Hi,

a year ago I wrote an EA validation. If I remember right I used an Example of the EA documentation. It wasn't just writing a single function. It's more a framework for rules organized in categories and more...

If you follow the rules you can add your own rules and categories.  

Have a look in the EA documentation and resources. If you can't find anything I can send you my pretty complex validation or search for myself. Just ask.


Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Check if Model Validation produced errors
« Reply #3 on: May 23, 2013, 07:12:52 am »
Hello André,

I've found the example.

- Go into the EA help (F1)
- Search
- Select search for subject/title or so
- Search item is "Model Validation Example"

There you find an example.

Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

André Ribeiro

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Check if Model Validation produced errors
« Reply #4 on: May 23, 2013, 11:01:28 pm »
Hi everyone,

I've already solved my problem in a dummy way.
I've used a boolean that I set to false each time my custom rules are not respected.
Then in the end of the validation (EA_OnEndValidation method) I check its value: if true no errors occurred.
I've also reset the boolean to true in the EA_OnInitializeUserRules method.
Anyway thank you for the answers.
« Last Edit: June 08, 2013, 11:05:56 pm by krypton »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Check if Model Validation produced errors
« Reply #5 on: May 24, 2013, 11:04:51 pm »
André,

I would be nice for the next user that has this issue and find this topic, that you describe what you did to solve the problem.

Geert