AIMMS PRO and Data Management¶
Where to Locate Data¶
You can read data from files that are contained in the same directory as the published model, or in any of its subdirectories, if such files are exported as part of the .aimmspack file as well. You should, however, never write persistent data to such files, as a next session may be run from a different location, or even on a different server. If you need to write persistent data to disk, you should locate such files on e.g. a network share that can be reached from any server on which your server sessions are running.
PRO Central Data Management¶
Alternatively, when using the new data management style of AIMMS 3.12 or newer, using Disk Files and Folders, you will also be able to store case files directly on the PRO server. Whenever you open the AIMMS Case Manager dialog box from within a PRO client session, three new locations for saving and loading cases will become visible, as shown in the figure below.
PRO User Cases¶
The PRO User Cases area in the AIMMS Case Manager refers to an application-specific central storage location on the PRO server that is private to you. The storage location is the same for all published versions of the same application, so if the published application is upgraded, the data from previous versions is still available to you. You can access the cases stored in this location, from wherever you start the application. The data you store here, is not accessible for other users except those that are part of the admin group.
PRO Central Storage¶
The PRO Central Storage area in the AIMMS Case Manager provides you with a full overview of the complete central storage area available on the PRO server. Each folder and file in this storage area can have read, write and execute access rights assigned to specific users and groups within PRO. These access rights determine whether specific folders or files will be visible to you in the AIMMS Case Manager, or whether you can write in certain locations. The Case Manager will automatically filter out all files and folders to which you have no access.
Central Case URL’s¶
You can also programmatically load cases to or save cases from the PRO Central Storage area through existing AIMMS data management functions such as CaseFileLoad and CaseFileSave. The case URL for cases stored in the PRO Central Storage area consists of the prefix “PRO:” (to indicate to the AIMMS Case Manager that the case should be saved in the PRO Central Storage area), followed by the path in the central storage area.
Besides centrally saving cases in the PRO Central Storage area through the Case Manager, you can also manually transfer files between your local disk and the PRO Central Storage area through the functions
You can use these functions if your project depends on private files that need to be kept in sync from wherever you run a client session to the project, or depends on shared files that need to be kept in sync for all users from all locations. Both functions require a local path as well as a path in the PRO Central Storage area.
Manipulating PRO Files and Folders¶
To manipulate files and folders in the PRO Central Storage area, you can use the following functions:
The functions pro::SaveFileToCentralStorage and pro::CreateCentralStorageFolder have an Access rights optional permissions string argument through which you can specify the access rights for the files and folders you create with these functions. When you do not explicitly specify access rights to the files and folders you create in the central storage area, PRO will automatically only give access to the currently logged on user.
Specifying Access Rights¶
To select which users and/or groups should have which access rights, you can call the function progui::EditAuthorization which is part of the PRO GUI library. This function will open the Authorization Manager dialog, through which you can modify a new or existing permissions string. You can then pass this string as the permissions argument to the functions above.
Using a Database¶
For communicating the data between the client and the server session, or between multiple server sessions, you also have the possibility to use a common database that both instances can access. If you do want to use a common database for data communication, ensure that you have the required ODBC drivers on both the server and client side installed. With regards to the server side, keep in mind that most drivers must be installed separately for the 32-and 64-bit version of ODBC.