Working with the model store via API
Accessing the model store and access rights
Reading models from the store and writing models to the store is done with the DataManager class. The access checks listed below are applied.
1. Starting and finishing model editing
If no user is editing the model, editing can be started with the DataManager.startEdit method. Any user can do this.
If the model is being edited, editing can be finished with the DataManager.saveEdit method, and all changes are saved to the store. To finish editing without saving changes, use the DataManager.calcelEdit method. Only the user who is editing the model can finish editing.
2. Reading a model
If no user is editing the model, any user can read it from the store with the DataManager.readModel method.
If a user is editing the model, it can be read from the store with the DataManager.readEditModel method, but only by the user who is editing the model. Other users can read the model with the DataManager.readModel method, but they will not see the changes made by the user who is editing the model.
3. Writing a model
If a user is editing the model, changes can be saved to the store with the DataManager.writeEditModel method, but only by the user who is editing the model.
Important: other users will not see the changes until model editing is finished with saving.
A new model can be saved to the model store with the DataManager.writeModel method; any user can do this.
4. Reading linked model data
Some models contain not only their own data but also references to other models. For example, a well model contains a reference to a fluid model, and an integrated model contains references to reservoir models, well models, and fluid models. To calculate such models, all linked models must be read. To do this, use the DataManager.readModelLink and DataManager.readEditModelLink methods.
5. Reading and writing calculation results and logs in the model store
The model read and write rules listed above also apply to reading and writing calculation results and logs. To read calculation logs and results, use the DataManager. readResult and DataManager.readEditResult methods.
Writing calculation logs and results is done with the DataManager. writeResult and DataManager.writeEditResult methods.