Returns the id, type and contents of an instance container identified by its name and modelId.
Related functions: edmiCreateInstanceContainer, edmiDeleteInstanceContainer, edmiDeleteInstanceContainerBN, edmiEmptyContainer, edmiEmptyContainerBN, edmiGetInstanceContainers, edmiSetContainerCheckedout, edmiSetContainerCheckedoutBN, edmiUnsetContainerCheckedout, edmiUnsetContainerCheckedoutBN, edmiInstanceToContainer, edmiInstanceToContainerBN, edmiInstancesToContainer, edmiInstancesToContainerBN.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetInstanceContainerId(SdaiModel modelId,
SdaiString containerName,
SdaiContainerType *containerType,
SdaiContainer *containerId,
SdaiAggr *containerInstancesId);
Arguments:
modelId |
Instance Id that uniquely identifies the edmModel in the EDMdatabase |
containerName |
The optional name that was assigned to the instance container when it was created. |
containerType |
Variable that will receive an enumeration value representing the type of instance container. possible values are; CONTAINER, LOCK_CONTAINER, MODEL_CONTAINER and MODEL_LOCK_CONTAINER. |
containerId |
Variable that will receive the containerId that uniquely represents the instance container in the EDMdatabase. |
containerInstancesId |
Variable that will receive the instance id of an aggregate containing all instances in the container. |
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 modelId;
SdaiContainerType contType;
SdaiContainer contId;
SdaiAggr contInst;
. . .
if (rstat = edmiGetInstanceContainerId(modelId, "myContainer",
&contType, &contId,
&contInst)) {
printf("\nError %d in edmiGetInstanceContainerId: %s", rstat,
edmiGetErrorText(rstat));
goto err;
}
switch (contType) {
case CONTAINER:
printf("\nPlain Instance Container");
break;
case LOCK_CONTAINER:
printf("\nLockable Instance Container");
break;
case MODEL_CONTAINER:
printf("\nPlain Instance Model Container");
break;
case MODEL_LOCK_CONTAINER:
printf("\nLockable Instance Model Container");
break;
default:
printf("\nError: Unknown Instance Container Type!");
goto err;
}
. . .