...
Code Block | ||||
---|---|---|---|---|
| ||||
EdmiError edmiRemoteCreateNestedAggr(SdaiServerContext serverContextId,
SdaiAggr parentAggrId,
SdaiAggrFunction aggrFunction,
SdaiAggrIndex aggrIndex,
SdaiAggr *newAggrId,
SdaiInvocationId *edmiInvocationId);
|
Creates an empty nested aggregate within an already existing aggregate. The existing aggregate is denoted the parent aggregate. The nested aggregate to be created is denoted the child aggregate of its parent aggregate.
...
The type of child aggregate that results from this operation is determined by the aggregate element declaration of the parent aggregate in the underlying Express Schema of the edmModel. Suppose the declaration of the attribute myAttr is;
myAttr : LIST [1:3] OF ARRAY [1:12] OF STRING;
This function would create an array of 12 elements within one of the three elements of the list. The list would have to be created and identified by its aggregateId before invoking this function.
...
A numeric aggregateID will be returned from the function. This id uniquely identifies the aggregate within the remote EDMdatabase
...
. The aggregateID will remain unchanged throughout the lifetime of the aggregate and may be used to identify the aggregate in subsequent calls to EDMinterface
...
API functions.
...
The parent aggregate that will be the owner of the nested child aggregate is specified by its aggregateId in the <parentAggrId> argument. AggregateIDs may not be considered plain data values. Nested child aggregates must be created within their parent aggregates. Child aggregateIds may be retrieved by EDMinterface
...
Get operations, but they may not be used to populate parent aggregates by means of EDMinterface
...
Put operations.
This operation is only applicable to aggregates owned by explicit attributes of application instances.
...
Arguments
...
1 | Type | Name | Comment |
2 | SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
3 | SdaiAggr | parentAggrId | A numeric aggregateID that uniquely identifies the aggregate of interest in the remote _EDMdatabase{_}.remote EDMdatabase |
4 | SdaiAggrFunction | aggrFunction | Determines the insert point of the created nested aggregate in its parent aggregate. The following is a description of each of the legal values of this argument.
|
5 | SdaiAggrIndex | aggrIndex | A parent aggregate element position that is used to determine the insertion point of the created nested aggregate. |
6 | SdaiAggr | newAggrId | Variable that will receive the aggregateId that uniquely identifies the nested typed aggregate in the remote EDMdatabase. |
7 | SdaiInvocationId | edmiInvocationId | Currently not used. |
...
Return Value
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
Options
...
Option | Comment |
Option name | Comment |
Example
...
Code Block | ||
---|---|---|
| ||
Example: /* SCHEMA Employees ENTITY person; Name : STRING; Age : INTEGER; END_ENTITY; ENTITY Manning; DivisionStaff : ARRAY [0:4] OF SET OF person; END_ENTITY; END_SCHEMA; */ #define S_NOOF_DIVISIONS 5 int i; EdmiError rstat; SdaiServerContext myContext; SdaiInstance manningId; SdaiAggr parentAggrId; SdaiAggr childAggrId[S_NOOF_DIVISIONS]; |
...
/* Create Server Context */ |
...
rstat = edmiDefineServerContext("MyContext", |
...
"Johnny", "Supervisor", "cf37ftr", |
...
"TCP", "9090", "MyServerHost", |
...
NULL, NULL, NULL, NULL, NULL, &myContext); |
...
/* Create instance of Employees */ |
...
rstat = edmiRemoteCreateInstanceAndPutAttrsBN(myContext, |
...
"AdminRepository", "Employees", |
...
"Manning", 0, &manningId, NULL); |
...
/* Create the parent aggregate */ |
...
rstat = edmiRemoteCreateAggrAndWriteAggrElementsBN(myContext, |
...
manningId, "DivisionStaff", 0, 0, 0, NULL, |
...
&parentAggrId, NULL); |
...
/* Create child aggregates for |
...
all company divisions */ |
...
for (i=0;i<S_NOOF_DIVISIONS;i++) { |
...
rstat = edmiRemoteCreateNestedAggr(myContext, parentAggrId, |
...
ACCESS_BY_INDEX, i, &childAggrId[i], NULL); |
...
}
. . . |
See also
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|