Deletes an archived model from the EDMdatabase and from the file system of the machine hosting the EDMserver.
There is a maximum number of models that may coexist within an EDMdatabase. Users that need to store great numbers of models may exceed this capacity. Therefore, models may be temporarely archived, thereby releasing capacity in the EDMdatabase. Models that are rarely used need not be permanently active in the EDMdatabase.
When the EDMdatabase is configured with EXTENSIVE_ACCESS_CHECKING, the EDMuser must have delete access to the archived model. Otherwise, write access is sufficient.
Related functions: edmiRemoteActivateModel, edmiRemoteArchiveModel
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDeleteArchivedModel (SdaiServerContext serverContextId,
SdaiString remoteArchivedModelName,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
remoteArchivedModelName |
The name that was assigned to the archived model when it was created by edmiRemoteArchiveModel. |
edmiInvocationId |
Not yet used. When the edmiInvocationId is specified unequal NULL, the actual operation will be asynchronous and a handle (identifier) of the call will be returned in the edmiInvocationId argument. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat;
SdaiServerContext myContext;
SdaiModel modelId;
SdaiArchivedModel archModId;
SdaiInstance instId;
SdaiBoolean updateAccepted = sdaiFALSE;
/* Create Server Context */
rstat = edmiDefineServerContext("MyContext",
"Johnny", "Supervisor", "cf37ftr",
"TCP", "9090", "MyServerHost",
NULL, NULL, NULL, NULL, NULL, &myContext);
/* Activate the model */
rstat = edmiRemoteActivateModel(myContext, "MyArchivedModel",
"DataRepository", "MyModel",
KEEP_ARCHIVED_MODEL, &modelId, NULL);
/* Update the population */
rstat = edmiRemoteCreateInstanceAndPutAttrsBN(myContext,
"DataRepository", "MyModel", "FRIEND", 2,
&instId, NULL,
"FIRST_NAME", sdaiSTRING, "Lucy",
"LAST_NAME", sdaiSTRING, "Schmidt");
/* Validate the update here */
if (updateAccepted == sdaiTRUE) {
rstat = edmiRemoteDeleteArchivedModel(myContext,
"MyArchivedModel", NULL);
rstat = edmiRemoteArchiveModel(myContext,
"DataRepository", "MyModel",
"MyArchivedModel", 0, &archModId, NULL);
printf("\nUpdate Accepted. Archiving updated model.");
} else {
rstat = edmiRemoteDeleteModel(myContext,
"DataRepository", "MyModel", NULL);
printf("\nUpdate Rejected. Updated model overruled.");
}
. . .