Author Topic: Question about WebEA tokens and image cache  (Read 6222 times)

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Question about WebEA tokens and image cache
« on: February 04, 2023, 07:57:29 am »
As I was asked in https://sparxsystems.com/forums/smf/index.php/topic,47559.0.html about the image location when you have licensed PCS and enabled the feature for caching images to webEA...

And having in context this question (not still answered at the moment of current post) https://sparxsystems.com/forums/smf/index.php/topic,47569.0.html

I plan to have a token of PCS in order to enable the image generation in an environment not having PCS licensed (just the free features). The plan is to read the diagrams directly from the database.

My question is: id this scenery possible? I mean, the token license will do the job of store the images? or does it just work for 30 minutes, or something like that? Am I missing something about token usage?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13247
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Question about WebEA tokens and image cache
« Reply #1 on: February 04, 2023, 07:33:31 pm »
IIRC you don't need ProCloud at all to store the diagram images in your database.

The difficult part is getting those images out so you can use them. If you figure that out, please post here.

Geert

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Question about WebEA tokens and image cache
« Reply #2 on: February 07, 2023, 01:46:04 am »
I know I can use the API and save an image from a diagram GUID. But I need to create an automated process that generates the images (no human intervention) and better if not using the API. So, if PCS stores the images in the DB, I will try extracting them from the DB. I will share here if I finally do it.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13247
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Question about WebEA tokens and image cache
« Reply #3 on: February 07, 2023, 01:55:02 am »
If you generate the images using the API, it opens each diagram in the GUI, which is not very practical.
But if you export the owning package as XMI, you can ask it to generate the images as well.

It's still not the same as getting them from the database, but it might be an acceptable workaround.

Geert

DeBAAT

  • EA User
  • **
  • Posts: 63
  • Karma: +2/-0
    • View Profile
Re: Question about WebEA tokens and image cache
« Reply #4 on: February 07, 2023, 09:30:00 am »
The PCS has a "worker" process which regularly generates the images. However, there is a (small?) issue that it generates the images using a default set of parameters which could be different from the set used by the user when using the EA client.

Furthermore, there is still no need to use that process as the EA client itself has a set of "Cloud" options to support the generation of diagram images.
Look at the menu "Settings => Model => Options => Cloud". There you can enable the options "Auto create Diagram Image and Image Map ..." and "Auto create HTML Page...".
When these options are changed, all diagrams are automatically generated and saved whenever the user changes something on the diagram.
However, not all Diagram Images are generated yet. So there is also a "Create" button to Batch create Diagrams...
When you look at the filesize of an EAPX or QEAX file, you could see the difference in filesize before and after the batch generation of all these Diagrams.
These options are expecially necessary when using the WebEA functionality of PCS as this is a php application only reading the (file) database using the generated diagram images. If a diagram image is not available, it shows a message indicating this. It also sometimes shows a message when a diagram needs to be regenerated, due to whatever reason that caused the diagram image to be outdated.

BTW, the token is necessary to use the functionality of PCS like WebEA. The 30 min is a time-out value which releases the token when the user has not used it in the current session.
« Last Edit: February 07, 2023, 09:34:05 am by DeBAAT »

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Question about WebEA tokens and image cache
« Reply #5 on: February 08, 2023, 12:59:09 am »
The PCS has a "worker" process which regularly generates the images. However, there is a (small?) issue that it generates the images using a default set of parameters which could be different from the set used by the user when using the EA client.

Furthermore, there is still no need to use that process as the EA client itself has a set of "Cloud" options to support the generation of diagram images.
Look at the menu "Settings => Model => Options => Cloud". There you can enable the options "Auto create Diagram Image and Image Map ..." and "Auto create HTML Page...".
When these options are changed, all diagrams are automatically generated and saved whenever the user changes something on the diagram.
However, not all Diagram Images are generated yet. So there is also a "Create" button to Batch create Diagrams...
When you look at the filesize of an EAPX or QEAX file, you could see the difference in filesize before and after the batch generation of all these Diagrams.
These options are expecially necessary when using the WebEA functionality of PCS as this is a php application only reading the (file) database using the generated diagram images. If a diagram image is not available, it shows a message indicating this. It also sometimes shows a message when a diagram needs to be regenerated, due to whatever reason that caused the diagram image to be outdated.

BTW, the token is necessary to use the functionality of PCS like WebEA. The 30 min is a time-out value which releases the token when the user has not used it in the current session.

Thanks for your detailed answer, buy a question: what if no user has set the Cloud settings in EA? I mean, my plan is to let the worker to do the job even if no user is opening EA (a fully automated process). In this case nobody would be creating the diagrams in the cache, right?

DeBAAT

  • EA User
  • **
  • Posts: 63
  • Karma: +2/-0
    • View Profile
Re: Question about WebEA tokens and image cache
« Reply #6 on: February 08, 2023, 06:00:29 am »
Hai, sorry I didn't explain it clear enough.
Using the EA client, you can set the cloud options for the repository you are connected to.
So every EA client that makes changes to a diagram in that repository will automatically update the cache for that repository.
So when there is no change, there is also no need to update the cache.
And thus still no need for the worker process nor any PCS token.

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Question about WebEA tokens and image cache
« Reply #7 on: February 11, 2023, 01:28:37 am »
...So every EA client that makes changes to a diagram in that repository will automatically update the cache for that repository.
So when there is no change, there is also no need to update the cache.
And thus still no need for the worker process nor any PCS token.

What if a user deletes an element (from the Browser, not opening a diagram), and the element is used in several diagrams? so, you will need to update the cache for all those diagrams. Does it work in that way?

If I were the PCS, I would update the diagrams cache according to the date of modification, but at the end of the day I would update all the diagrams cache because all of them could be updated due connector or elements changes (edition, tags, deletion, renaming, etc)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13247
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Question about WebEA tokens and image cache
« Reply #8 on: February 11, 2023, 01:40:35 am »
...So every EA client that makes changes to a diagram in that repository will automatically update the cache for that repository.
So when there is no change, there is also no need to update the cache.
And thus still no need for the worker process nor any PCS token.

What if a user deletes an element (from the Browser, not opening a diagram), and the element is used in several diagrams? so, you will need to update the cache for all those diagrams. Does it work in that way?
Would be a pretty crippled mechanism if it would only update the image for the diagram you just saved, so I guess it will indeed update the images for all impacted diagrams.

Should be fairly easy to test if you want to be sure.

Geert

wivel

  • EA User
  • **
  • Posts: 242
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: Question about WebEA tokens and image cache
« Reply #9 on: February 11, 2023, 09:11:54 am »
The PCS has a "worker" process which regularly generates the images. However, there is a (small?) issue that it generates the images using a default set of parameters which could be different from the set used by the user when using the EA client.

Furthermore, there is still no need to use that process as the EA client itself has a set of "Cloud" options to support the generation of diagram images.
Look at the menu "Settings => Model => Options => Cloud". There you can enable the options "Auto create Diagram Image and Image Map ..." and "Auto create HTML Page...".
When these options are changed, all diagrams are automatically generated and saved whenever the user changes something on the diagram.
However, not all Diagram Images are generated yet. So there is also a "Create" button to Batch create Diagrams...
When you look at the filesize of an EAPX or QEAX file, you could see the difference in filesize before and after the batch generation of all these Diagrams.
These options are expecially necessary when using the WebEA functionality of PCS as this is a php application only reading the (file) database using the generated diagram images. If a diagram image is not available, it shows a message indicating this. It also sometimes shows a message when a diagram needs to be regenerated, due to whatever reason that caused the diagram image to be outdated.

BTW, the token is necessary to use the functionality of PCS like WebEA. The 30 min is a time-out value which releases the token when the user has not used it in the current session.
The autogenerate function only works when you physically change the diagram and save it. There are corner cases where diagrams are not being autogenerated:
  • When copy/pasting packages containing diagrams
  • Imports from other models, containing diagrams
These corner cases can be handle using the EAWorker with the drawback, as mentioned here, that all diagrams, not just the ones with no generate diagrams, will be generated based on the same setting. The settings stored on the machine where the EAWorker runs.

In a previous project, we opted for not using the EAWorker solution, but to manually regenerate stale diagrams and linked document when needed.

Henrik

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: Question about WebEA tokens and image cache
« Reply #10 on: February 15, 2023, 09:32:36 pm »
As stated in "https://sparxsystems.com/forums/smf/index.php/topic,47593.0.html", EA automatically draws connections on diagrams which are created on another diagram.
In this situation, WebEA will not show the most up-to-date version of the diagram as the EA client does.
In my situation this is an argument against the worker automatically generating 'new' images of unintentionally changed diagrams.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13247
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Question about WebEA tokens and image cache
« Reply #11 on: February 15, 2023, 09:53:47 pm »
As stated in "https://sparxsystems.com/forums/smf/index.php/topic,47593.0.html", EA automatically draws connections on diagrams which are created on another diagram.
In this situation, WebEA will not show the most up-to-date version of the diagram as the EA client does.
In my situation this is an argument against the worker automatically generating 'new' images of unintentionally changed diagrams.
That's not a very stable solution then is it, if you have to rely on "not yet touched" to have "correct" diagram in WebEA

Geert

ea0522

  • EA User
  • **
  • Posts: 134
  • Karma: +5/-0
    • View Profile
Re: Question about WebEA tokens and image cache
« Reply #12 on: February 15, 2023, 10:13:10 pm »
Quote
That's not a very stable solution then is it, if you have to rely on "not yet touched" to have "correct" diagram in WebEA
Depends on your definition of stable.
In my opinion, an unintentionally changed diagram is unstable.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13247
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Question about WebEA tokens and image cache
« Reply #13 on: February 15, 2023, 11:15:15 pm »
I mean the solution falls over the minute somebody touches a diagram, because then it gets saved again, and so updated in WebEA.

If you set the relations to be "frozen" you get the same result, but without relying on nobody touching the diagram.

Geert

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: Question about WebEA tokens and image cache
« Reply #14 on: February 17, 2023, 03:30:33 am »
Well, wait. After reading all the discussion, I have not clear this point:  does the PCS Worker correctly save the diagrams even if their modification date is not changed by any user, but they are indirectly affected by having modified or deleted some element or connector?