edmiRemoteInstanceToContainerBN
EdmiError edmiRemoteInstanceToContainerBN(SdaiServerContext serverContextId, SdaiModel modelId, SdaiString sourceContainerName, SdaiString targetContainerName, SdaiAppInstance currInst, SdaiInvocationId *edmiInvocationId);
Adds/removes a single instance to/from an instance container identified by its containerId. This function may also move an instance between containers. The behaviour is controlled by the values given in the source and target parameters <sourceContainerId> and < targetContainerId >. The table below illustrates this;
source | target | Behavior |
Unset | Set | The instances will be inserted into the target container. |
Set | Unset | The instances will be removed from the source container. |
Set | Set | The instances will be moved from source to target. I.e removed from the source container and inserted into the target container. |
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiModel | modelId | A numeric modelID that uniquely identifies the model in the remote EDMdatabase |
SdaiString | sourceContainerId | Optional name of the instance container from which to remove the instance <currInst>. By default, the instance will not be removed from any container. |
SdaiString | targetContainerId | Optional name of the instance container in which to insert the instance <currInst>. By default, the instance will not be inserted into any container. |
SdaiAppInstance | currInst | A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Â
Return Value
Â
Options
 Â
Â
Example
Â
int i; EdmiError rstat; SdaiContainer lockContId, *pContainers; SdaiServerContext myContext; SdaiInstance instId; SdaiInteger nCont; SdaiString contName; SdaiModel modelId; . . . /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyRemoteServerContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get all containers containing instId */ rstat = edmiRemoteGetInstanceContainers(myContext, instId, ANY_CONTAINER, &lockContId, &nCont, &pContainers, NULL); /* Remove instId from all containers */ for (i=0; i<nCont; i++) { rstat = edmiRemoteGetAttrsBN(myContext, pContainers[i], 0, 1, NULL, "NAME", sdaiSTRING, &contName); printf("\nRemoving instance %d from container %s", pContainers[i], contName ? contName : "<empty>"); rstat = edmiRemoteInstanceToContainerBN(myContext, modelId, contName, NULL, instId, NULL); } . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
 Â