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 »


 
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

Behaviour

Unset

Set

The instance will be inserted into the target container.

Set

Unset

The instance will be removed from the source container.

Set

Set

The instance will be moved from source to target. I.e removed from the source container and inserted into the target container.

 
Related functions: edmiRemoteCreateInstanceContainer, edmiRemoteDeleteInstanceContainer, edmiRemoteDeleteInstanceContainerBN, edmiRemoteEmptyContainer, edmiRemoteEmptyContainerBN, edmiRemoteGetInstanceContainerId, edmiRemoteGetInstanceContainers, edmiRemoteSetContainerCheckedout, edmiRemoteUnsetContainerCheckedout, edmiRemoteUnsetContainerCheckedoutBN, edmiRemoteSetContainerCheckedoutBN, edmiRemoteInstancesToContainer, edmiRemoteInstancesToContainerBN, edmiRemoteInstanceToContainerBN.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteInstanceToContainer(SdaiServerContext serverContextId, 
                                         SdaiContainer     sourceContainerId, 
                                         SdaiContainer     targetContainerId, 
                                         SdaiAppInstance   currInst,
                                         SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

sourceContainerId

The containerId of the instance container from which to remove the instance <currInst>. By default, the instance will not be removed from any container.

targetContainerId

The containerId of the instance container in which to insert the instance <currInst>. By default, the instance will not be inserted into any container.

currInst

Specifies a numeric instanceID that uniquely identifies an application instance in the EDMdatabase.

edmiInvocationId

Currently not used.

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:
int i;
EdmiError rstat;
SdaiContainer lockContId, *pContainers;
SdaiServerContext myContext;
SdaiInstance instId;
SdaiInteger nCont;
. . .
/* 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 = edmiRemoteInstanceToContainer(myContext,
pContainers[i], 0, instId, NULL); 
}
. . .

  • No labels