Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


 
This function activates an archived model in the EDMdatabase. There are a maximum number of models that may coexist within an EDMdatabase. Users that need to store great numbers of models may exceed this capacity. However, models may be temporarily archived, thereby releasing capacity in the EDMdatabase. Models that are rarely used need not be permanently active in the EDMdatabase.
For an EDM user to activate a model, he needs at least read access to it.
 
Related functions: edmiArchiveModel
Header:
#include "sdai.h"
Prototype:
EdmiError edmiActivateModel(SdaiString      archivedModelName,
                             SdaiRepository  repository,
                             SdaiString      modelName,
                             SdaiUnsignedInt options,
                             SdaiModel       *modelId);
Arguments:

ArchivedModelName

The name of the archived model to be activated. Model names are case sensitive.

Repository

The instance Id that identifies the repository in which to activate the model.

ModelName

The name to assign to the activated model. Model names are case sensitive. If this parameter is NULL or an empty string, the model will be activated under its original name.

Options

Specifies the options to be used in the invocation of the edmiActivateModel function. The <options> value can be specified as a bitwise OR between the actual options. All options are defined in the header file sdai.h .
See description of the available options below.

*modelId

Address of a variable that will receive the modelID that uniquely identifies the activated data model.

Options: Descriptions:

SKIP_STEP_ID_MODEL

Models that are imported with the KEEP_STEP_IDENTIFIERS option and later archived without the SKIP_STEP_ID_MODEL will have their step Id info archived in separate accompanying models. By default, STEP Id models will be activated together with the data models. Use this option to prevent activation of these step Id models.

RESTORE_MODEL_ADMIN_DATA

Use this option to restore the models original administration data. If this option is not used, the activated model will have its administration data set as if it were created by the user by e.g edmiCreateModel.

KEEP_ARCHIVED_MODEL

The model will be activated but remains archived.

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;
SdaiModel modId;
SdaiArchivedModel arcModId;
SdaiString arcModName = "arcModel";
SdaiString modName = "myModel";
. . .
 
/* Activate the model */
if (rstat = edmiActivateModel(arcModName, repId, modName, 0, &modId)) {
printf("\nError %d in edmiActivateModel: %s", rstat, 
edmiGetErrorText(rstat)); 
goto error; 
}
 
/* Work on the model here */
. . .
 
/* Archive the model */
if (rstat = edmiArchiveModel(repId, modName, arcModName ,0, &arcModId)) {
printf("\nError %d in edmiArchiveModel: %s", rstat, 
edmiGetErrorText(rstat)); 
goto error; 
}
. . .

  • No labels