Author Topic: Way to silently get error message of pop-window when using API  (Read 2971 times)

ea0921

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-1
    • View Profile
Way to silently get error message of pop-window when using API
« on: September 11, 2024, 07:31:40 pm »
Hello,

I am using enterprise architect application as source and target. In the source I have created packages which I want to sync in the target repository.
I am using API to automate this task. I am C# to automate this task.
I am using OpenFile2 command to open the EA repository. In this scenario when I give wrong project path and do not release the GDI objects, after some times I get an pop-up from EA application saying cannot create empty document.
Whenever this pop-up comes up, my automation gets stuck in the middle and I need to manually go to the VM and close the pop-up.

I would like to know more about following two questions:

1: What are the pop-up which EA application gives. And in what case/scenarios does EA give pop-up when interacting EA through API's. Link to the documentation or any blog released by EA will be more helpful.

2: Is there any way in which we can avoid opening of pop-up and get the error message in API response, or some other way to silently handle pop-ups


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13282
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Way to silently get error message of pop-window when using API
« Reply #1 on: September 11, 2024, 08:02:40 pm »
There is no documented list of popups. Sometimes you get a popup, sometimes EA silently ignores errors, sometimes EA crashes completely.

The only way I know of handling this is preventing the error to occur (or to be noticed by EA)

One of the things I did was build a catch-all exception handler in my code, to avoid throwing the exception up to EA (which often meant a hard crash, or a popup)

Futhermore you'll have to make sure at every step you check all known exception scenario's and handle them yourself. (e.g. check if file exists before asking EA to read it)
There is also a method Repository.GetLastError() which might be helpful in these cases

Geert

ea0921

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-1
    • View Profile
Re: Way to silently get error message of pop-window when using API
« Reply #2 on: September 12, 2024, 02:47:56 pm »
Thanks Geert for sharing information, it will surely help us in avoiding crashing of EA.

I also wanted to ask that is there any way present in EA by which we can silently ignore all the pop-ups and get the error messages of the pop-ups in the API's itself.

Or else is there any way where we can non-interactively communicate with EA without the need of interactive user.

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13282
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Way to silently get error message of pop-window when using API
« Reply #3 on: September 12, 2024, 03:42:20 pm »
The only way I know of handling this is preventing the error to occur (or to be noticed by EA)

ea0921

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-1
    • View Profile
Re: Way to silently get error message of pop-window when using API
« Reply #4 on: September 13, 2024, 07:58:37 pm »
In my environment, I have created multiple integrations from EA to EA. in which I am syncing multiple source projects to multiple target projects in multithreaded environment.

There are multiple qea files and in that qea file there are multiple packages. I have different integration for each package of one qea file, in such a way that there are multiple read and write api calls to same qea file.

Also I am integrating attachments, relationships, diagrams as well. With too many requests, is there any way to prevent the errors to occur.
Also I have version control enabled projects, where every time I do check-out and check-in at every write request.

Few pop ups which I have encountered:
1. Failed to create empty document
2. Warning underlying model data may have been modified by another user.
3. SQL update failed with error : database is locked
4. The memory could not be written.

I am using windows machine I my machine has 12 GB of RAM.

Can you please help me in preventing above kind of issues.

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Way to silently get error message of pop-window when using API
« Reply #5 on: September 13, 2024, 08:10:23 pm »
Sounds like you should hire someone to do it... (not me)

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13282
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Way to silently get error message of pop-window when using API
« Reply #6 on: September 13, 2024, 08:25:13 pm »
In my environment, I have created multiple integrations from EA to EA. in which I am syncing multiple source projects to multiple target projects in multithreaded environment.

There are multiple qea files and in that qea file there are multiple packages. I have different integration for each package of one qea file, in such a way that there are multiple read and write api calls to same qea file.

Also I am integrating attachments, relationships, diagrams as well. With too many requests, is there any way to prevent the errors to occur.
Also I have version control enabled projects, where every time I do check-out and check-in at every write request.

You might want to stop and reconsider the basic premises.
Is this whole setup with multiple .qea files being synchronized really a solid architecture? Is there really no alternative?

It feels to me like a situation that will be hard (if not impossible) to really solve in a reliable way.

Geert