Skip to main content

Our users want to be able to store case files locally on their computer and reupload to the cloud environment at a later stage. It looks like the WebUI data manager does not support this requirement. 

What is the best way to enable users with such a feature?

Hello @Paulus, you can develop it or copy what we already have available in an example! 😉

In our Employee Scheduling example (https://how-to.aimms.com/Articles/387/387-employee-scheduling.html#language), you can see in the page action, the button ‘Case Manager’ where you can download and load a case for this project. All the procedures related to this functionality can be found trough that dialog page. 

Hope this helps!


Hi @gabiservidone,
 

The example you shared is very similar to what I've implemented, with the addition that during the case upload I save it in the central storage. This can be done by adding the lines marked in yellow to your code example. <see screenshot 1> 

Although this creates a case, the case becomes read only. Which can be seen via the data manager, but it can not be deleted or modified. <see screenshot 2>. Why is that? Is this a potential bug?

Regards,
Jacob Jan

P.s. Let me put in the feature request to get a case download and case upload directly in the Data Manager.


<Figure 1 Saving the case on the central storage>

<Figure 2 Case appears as read only, as the delete function is not appearing>
 

 


Dear @Paulus 

 

I was able to get this to work by doing the following:

 

CaseFileSave("PRO:/UserData/ROOT/luis_test/Cases/luis_tested/" + sp_caseName, AllIdentifiers);

sp_creatorFile := sp_caseName + ".creator.luis_test@ROOT";

FileCopy("creator.template", sp_creatorFile, 0);

pro::SaveFileToCentralStorage(sp_creatorFile, "PRO:/UserData/ROOT/luis_test/Cases/luis_tested/" + sp_creatorFile);

 

Let me explain what I am doing.

 

Line 1: just saving my case in the correct folder (you already do this in your code). In my case I am using a fixed ROOT environment with luis_test as my username and luis_tested as my app name and the sp_caseName is defined elsewhere (with the .data at the end - so "test.data” for example).

 

Line 2: I am creating the creator File name. It is the case name + “.creator.USERNAME@ENVIRONMENT”

 

Line 3: I downloaded a "creator.template” file from storage manager - this is created for every case file that is editable. It is an empty file, so you can download or create your own.

 

Line 4: I am copying that file with new name to the same folder as the case was saved.

 

This is what my bucket looks like:

 

And in AIMMS:

 

 

Please let me know if this helps.

 

Best regards,


Hi Luis,

Thank you for supplying the solution.

It took me some time to realize the file "creator.template" should be part of the project (included in the aimmspack) to make the code work.

Also the FileCopy statement is not needed:

CaseFileSave("PRO:/UserData/ROOT/luis_test/Cases/luis_tested/" + sp_caseName, AllIdentifiers);

sp_creatorFile := sp_caseName + ".creator.luis_test@ROOT";

pro::SaveFileToCentralStorage("creator.template", "PRO:/UserData/ROOT/luis_test/Cases/luis_tested/" + sp_creatorFile);

Regard,


Reply


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

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