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 Current »


 
Checks whether an instance Id is non-existant, unavailable or reserved for the system.
Some features in EDM, such as for instance check-in/check-out, create a need for storing some internal administration data within the model itself. Such instances are handled entirely by EDM and may not be modified directly by users. This function returns an sdai error code if the instance is of such an inaccessible type. The function will return an sdai error code if the instance belongs to a model that is not open for read access.
A non-existent instance will of course also be user-unavailable.
If the instance Id is user-accessible, the parameter entityId will receive the instance type.
Related functions:
Header:
#include "sdai.h"
Prototype:
EdmiError edmiCheckForUserAccessibleInstance (SdaiInstance currInst,
                                               SdaiInstance *entityId);
Arguments:

CurrInst

A numeric instanceID that uniquely identifies an instance in the EDMdatabase

EntityId

A numeric entityID that uniquely identifies the entity definition instance of interest in the EDMdatabase.

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 or the instance is not accessible to the user. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiEntity entityId;
SdaiInstance instanceId;
. . .
if (rstat = edmiCheckForUserAccessibleInstance(instanceId, &entityId)) {
switch(rstat) { 
case sdaiEMODELUNDEFACCESS: printf("\nModel not open!");
break; 
case sdaiENOINSTANCE: printf("\nNot user accessible!");
break; 
default: printf("\nError: %s\n", edmiGetErrorText(rstat));
goto error;

} else {
printf("\nInstance %d is user accessible.", instanceId);
printf("\nThe instance is of type.", entityId);
}

  • No labels