DEX Initialization

Userlevel 1
Badge +2

For one of our AIMMS apps, we read in a file from the ADLS on startup. This happens in a procedure that is part of PostMainInitialization. We call dex::dls::ListFiles to determine which file to read, but the API call fails.

Presumably, this problem occurs because parameter StorageAccount is only initialized in procedure Initialize in the PostLibraryInitialization of DEX. This post lib is only run after our PostMainInitialization is run. 

Is there a way to automatically run a procedure on start-up of the application, that is run after the PostLibraryInitialization of DEX? Or is it possible for you to change DEX such that StorageAccount is initialized in the LibraryInitialization instead of the PostLibraryInitialization? 



Best answer by MarcelRoelofs 22 May 2024, 16:58

View original

3 replies

Userlevel 4
Badge +5

Hi @meikedewith 

In DEX the DLS initialization has moved to LibraryInitialization instead of PostLibraryInitialization

Userlevel 1
Badge +2

Hi @MarcelRoelofs, thanks a lot for the extremely quick fix, happy to hear that!

In the meantime we also figured out another solution, which was to remove the start-up procedure from the PostMainInitialization and to have it as ‘start-up procedure’ (which can be set in AIMMS Options > Start-up and initialization). This also solved the issue. 

Out of curiosity: would there be a reason to choose one or the other (either put a procedure in PostMainInitialization or put it as start-up procedure) or is it a matter of taste?


Userlevel 4
Badge +5

LibraryInitalization is intended at library initialization independent of other libraries being initialized, same for Mainitilization.

PostLibraryInitialization is aimed at library intiialization that depends on other libraries being initialized, same for PostMainInitialization.

The startup procedure is a different mechanism that existed prior to the Post… procedures to do model initialization where the model was already initialized. 


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator