Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Code Block
languagecpp
themeConfluence
EdmiError edmiInstanceToContainer(SdaiContainer   sourceContainerId,
                                    SdaiContainer   targetContainerId,
                                    SdaiAppInstance currInst);

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;

 

Behaviour

source

target

Behavior

Unset

Set

The instance instances will be inserted into the target container.

Set

Unset

The instance instances will be removed from the source container.

Set

Set

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

Related functions: edmiCreateInstanceContainer, edmiDeleteInstanceContainer, edmiDeleteInstanceContainerBN, edmiEmptyContainer, edmiEmptyContainerBN, edmiGetInstanceContainerId, edmiGetInstanceContainers, edmiSetContainerCheckedout, edmiSetContainerCheckedoutBN, edmiUnsetContainerCheckedout, edmiUnsetContainerCheckedoutBN, edmiInstanceToContainerBN, edmiInstancesToContainer, edmiInstancesToContainerBN.
Header:
#include "sdai.h"
Prototype
EdmiError edmiInstanceToContainer(SdaiContainer   sourceContainerId,
                                   SdaiContainer   targetContainerId,
                                   SdaiAppInstance currInst);
Arguments:

Arguments

...

TypeNameComment
SdaiContainer

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.

SdaiContainer

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.

SdaiAppInstance

currInst

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

...

Return Value

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

Options

...

 

Example

...

 

Code Block
languagecpp
 EdmiError rstat;
 int i;
 SdaiModel modelId = 0;
 SdaiInstance instId;
 SdaiContainer contId = 0;
 . . .
 rstat = edmiCreateInstanceContainer(modelId, MODEL_CONTAINER,
 "Contacts", "Johnnys contacts", 
 &contId); 
 rstat = edmiProtectInstance(contId, (PUBLIC_NONE |
 GROUP_NONE | OWNER_WRITE)); 
 instId = edmiCreateInstanceAndPutAttrsBN(modelId, "FRIEND", 3,
 "FIRSTNAME", sdaiSTRING, "Lucy", 
 "LASTNAME", sdaiSTRING, "Grant", 
 "BIRTHDATE", sdaiSTRING, "01.13.1987");

...

 
 /* Add lucy to contacts container */

...


 if (rstat = edmiInstanceToContainer(0, contId, instId)) {

...


 printf("\nError %d in edmiInstanceToContainer: %s", rstat,

...

 
 edmiGetErrorText(rstat));

...

 
 goto err;

...

 
 }
 . . .

 

See also

Filter by label (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"