Versions Compared

Key

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

 

 

 

Code Block
languagecpp
themeConfluence
SdaiAggr edmiCreateUnionAggredmiCreateUnionAggrBN (SdaiModel    modelId,
                                  SdaiInteger  numberofEntities, 
                                  SdaiEntitySdaiString   *entities); 


Creates a union aggregate, i.e. a volatile aggregate instance that contains all instances of the specified types in one data model, i.e., the union aggregate is a union of all the ENTITY_EXTENT.INSTANCES aggregates of the specified instance types in the data model. A numeric aggregateID that uniquely identifies the new created union aggregate instance in the EDMdatabase will be the returned function value. This aggregateID should be used to identify this particular union aggregate instance in subsequent EDMinterface operations. The resulting union aggregate instance will not be persistent in the EDMdatabase, it will exist until it is deleted by the sdaiDeleteAggr  operation or until the open EDMserver session is closed by the function sdaiCloseSession or the current open database is closed. The resulting union aggregate can only be accessed by read operations. It is not permitted to change the contents of an union aggregate. All read (get) operations available for SET and BAG aggregate types are available for accessing union aggregates. This operation is only applicable to data models. The actual data model must be open before this operation can be successfully performed.
Note: The creation and deletion of instance types held by an union aggregate will influence the contents of the related union aggregates, hence it is recommended to delete and re-create the related union aggregate after such operations.

...

TypeNameComment
SdaiModel

modelId

A numeric modelID that uniquely identifies the data model of interest in the EDMdatabase. The modelID is returned from the functions: sdaiCreateModel , sdaiCreateModelBN , sdaiOpenModelBN , edmiGetModel , edmiGetModelBN , sdaiGetInstanceModel

SdaiInteger

numberofEntities

Specifies the number of instance types that constitutes the created union aggregate, i.e., the number of elements in the <entities> argument.

SdaiEntitySdaiString

entities

An array of entityID entity names that defines the instance types that constitutes the union aggregate. A numeric entityID An entity name within a model uniquely identifies an entity definition instance in a dictionary model in the EDMdatabase. This entity definition must be defined in the underlying schema of the actual model specified by the <modelId> argument. The number of elements in the <entities> argument is specified in the <numberOfEntities> argument. The entityID is returned by the sdaiGetEntity function.

Return Value

...

TypeComment
SdaiAggr 

...

Code Block
languagecpp
 SdaiAggr unionAggr;
 SdaiModel modelId;
 SdaiEntitySdaiString entities[MAX_ENTITIES];
 int eIndex;
 ...
 eIndex = 0;
 entities[eIndex++] = sdaiGetEntity(modelId, "HumanBeing");
 entities[eIndex++] = sdaiGetEntity(modelId, "Animal");
 unionAggr = edmiCreateUnionAggredmiCreateUnionAggrBN (modelId,
 eIndex, 
 entities); 
 if (! unionAggr) {
 /* Error in operation */ 
 printf("\nError in edmiCreateUnionAggredmiCreateUnionAggrBN: %s\n", 
 edmiGetErrorText(sdaiErrorQuery())); 
 goto error; 
 }
 . . .

...

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

  Creates a union aggregate, i.e. a volatile aggregate instance that contains all instances of the specified types in one data model, i.e., the union aggregate is a union of all the ENTITY_EXTENT.INSTANCES aggregates of the specified instance types in the data model.
A numeric aggregateID that uniquely identifies the new created union aggregate instance in the EDMdatabase will be the returned function value. This aggregateID should be used to identify this particular union aggregate instance in subsequent EDMinterface operations.
The resulting union aggregate instance will not be persistent in the EDMdatabase, it will exist until it is deleted by the sdaiDeleteAggr operation or until the open EDMserver session is closed by the function sdaiCloseSession or the current open database is closed.
The resulting union aggregate can only be accessed by read operations. It is not permitted to change the contents of an union aggregate. All read (get) operations available for SET and BAG aggregate types are available for accessing union aggregates.
This operation is only applicable to data models. The actual data model must be open before this operation can be successfully performed.
Note: The creation and deletion of instance types held by an union aggregate will influence the contents of the related union aggregates, hence it is recommended to delete and re-create the related union aggregate after such operations.
Related functions: edmiCreateUnionAggrBN, sdaiGetEntity , sdaiDeleteAggr, sdaiCloseSession.
Header:
#include "sdai.h"
Prototype:
SdaiAggr edmiCreateUnionAggrBN (SdaiModel    modelId,
                                 SdaiInteger  numberofEntities, 
                                 SdaiString   *entities); 
Arguments:

modelId

A numeric modelID that uniquely identifies the data model of interest in the EDMdatabase.
The modelID is returned from the functions: sdaiCreateModel , sdaiCreateModelBN , sdaiOpenModelBN , edmiGetModel , edmiGetModelBN , sdaiGetInstanceModel

numberofEntities

Specifies the number of instance types that constitutes the created union aggregate, i.e., the number of elements in the <entities> argument.

entities

An array of entity names that defines the instance types that constitutes the union aggregate. An entity name within a model uniquely identifies an entity definition instance in a dictionary model in the EDMdatabase. This entity definition must be defined in the underlying schema of the actual model specified by the <modelId> argument.
The number of elements in the <entities> argument is specified in the <numberOfEntities> argument.

Returns:
A numeric aggregateID of datatype SdaiAggr that uniquely identifies the created aggregate in the EDMdatabase is the returned function value. This aggregateID is only valid until the actual union aggregate is deleted by the sdaiDeleteAggr function, until the actual open EDMserver session is closed or the database is closed. The aggregateID has the following values:
aggregateID != : Operation successfully performed.
aggregateID = 0: Error in operation. Use sdaiErrorQuery to get error code and edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiAggr unionAggr;
SdaiModel modelId;
SdaiString entities[MAX_ENTITIES];
int eIndex;
...
eIndex = 0;
entities[eIndex++] = "HumanBeing";
entities[eIndex++] = "Animal";
unionAggr = edmiCreateUnionAggrBN (modelId,
eIndex, 
entities); 
if (! unionAggr) {
/* Error in operation */ 
printf("\nError in edmiCreateUnionAggrBN: %s\n", 
edmiGetErrorText(sdaiErrorQuery())); 
goto error; 
}
. . .