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


 
Creates an instance container within an edmModel in a remote EDMdatabase.
Instance containers are used to group a selection of application instances within the scope of an edmModel. In some connections, the instances contained within an instance container may be treated as one unit of data. Access control may be handled for all instances within the container by setting protection on the container it self. Containers may also be used for checking in and out all their contained instances by checking out the entire instance container. In general terms, an instance container is a data structure for organizing and administrating sets of entity instances of any number and types.
There are four types of instance containers.
1) Plain instance container
2) Plain instance model container
3) Lockable instance container
4) Lockable instance model container.
None of the four instance container types may hold same instance more than once. An instance may not be held by more than one lockable container at the same time. An instance may be simultaneously held by any number of plain instance containers.
The plain/lockable instance model containers are extended versions of the plain/lockable instance containers. The extension consists of the attribute POPULATED_FOLDERS. This attribute provides a higher level of internal organisation of the entity instances within the instance container. The instances are arranged in entity extents in exactly the same way as they are for models. This provides a built in instance type sorting feature that will eliminate the need for writing type checking software code.
Instance containers are represented by a numeric containerId or by a container name. A containerId is unique within the scope of an EDMdatabase. Container names are optional, but when set, they must be unique within the scope of an edmModel.
Related functions: edmiRemoteDeleteInstanceContainer, edmiRemoteDeleteInstanceContainerBN, edmiRemoteEmptyContainer, edmiRemoteEmptyContainerBN, edmiRemoteGetInstanceContainerId, edmiRemoteGetInstanceContainers, edmiRemoteSetContainerCheckedout, edmiRemoteSetContainerCheckedoutBN, edmiRemoteInstancesToContainer, edmiRemoteInstancesToContainerBN, edmiRemoteInstanceToContainer, edmiRemoteInstanceToContainerBN, edmiRemoteUnsetContainerCheckedout, edmiRemoteUnsetContainerCheckedoutBN.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteCreateInstanceContainer(SdaiServerContext serverContextId,
                                             SdaiModel         modelId,
                                             SdaiOptions       options,
                                             SdaiString        name,
                                             SdaiString        description,
                                             SdaiContainer     *containerId,
                                             SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

modelId

The id of the edmModel in which the instance container shall be created.

options

Specifies the type of instance container to create. The options are mutually exclusive. See description of each option below. This parameter is mandatory

name

An optional name of the instance container. A container name must start with a letter. The rest of the name can be any sequence of alphanumeric characters and underscore. Container names are case sensitive.

description

An optional textual description of the purpose of the instance container.

containerId

Variable that will receive the containerId that uniquely identifies the created container within the EDMdatabase.

edmiInvocationId

Currently not used

Options: Descriptions:

CONTAINER

Creates a plain instance container.

LOCK_CONTAINER

Creates a lockable instance container.

MODEL_CONTAINER

Creates a plain instance container with an extended representation of its contained instances.

MODEL_LOCK_CONTAINER

Creates a lockable container with an extended representation of its contained instances.

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;
SdaiContainer contId;
SdaiServerContext myContext;
. . .
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Johnny", "Supervisor", "cf37ftr", 
"TCP", "9090", "MyServerHost", 
NULL, NULL, NULL, NULL, NULL, &myContext); 
 
/* Create a lock container */
rstat = edmiRemoteCreateInstanceContainer(myContext,
modelId, LOCK_CONTAINER "FLOOR01",  
"Check out of first floor", &contId, NULL); 
. . .
/* Delete the container */
rstat = edmiRemoteDeleteInstanceContainer(myContext, contId, NULL);
. . .

  • No labels