Returns a numeric typeID that uniquely identifies a defined type instance in the remote EDMdatabase. The defined type is specified by its name and a modelID that uniquely identifies a data model in the EDMdatabase. The underlying Express Schema of the edmModel, identified by the modelId, must be the one that defines the type.
The returned typeID may be used to identify the defined type in subsequent remote EDMinterface operations. It will be a constant value for as long as the Express Schema remains defined in the remote EDMdatabase.
If a type with the specified name is not defined in the underlying Express Schema of the edmModel, then this operation will search for it in the EDMmetaMetaModel named SDAI_DICTIONARY_MODEL_DICTIONARY_DATA.
Related functions: edmiRemoteGetDefinedTypeBN, edmiGetDefinedType, edmiGetDefinedTypeBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetDefinedType(SdaiServerContext serverContextId,
SdaiModel modelId,
SdaiString typeName,
SdaiType *typeId,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
modelId |
A numeric modelID that uniquely identifies an edmModel of in the remote _EDMdatabase{_}. The underlying Express Schema of this model must be the one that defines the defined type. |
typeName |
The name of the defined type of interest. A defined type name is unique within the scope of an Express Schema. Names of defined types are case insensitive. |
typeId |
A variable that will receive the typeId that uniquely identifies a defined type in the remote 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:
/*
SCHEMA Accounts
TYPE tUSD = REAL; END_TYPE;
TYPE tEUR = REAL; END_TYPE;
TYPE tNOK = REAL; END_TYPE;
TYPE tAmount = SELECT (tUSD, tEUR, tNOK); END_TYPE;
ENTITY Turnover;
Year
Sales : ARRAY [1:12] OF tAmount;
END_ENTITY;
END_SCHEMA;
*/
EdmiError rstat;
SdaiServerContext myContext;
SdaiAggr aggrId;
SdaiType tAmountId;
SdaiInstance instId;
tSdaiSelect sel;
SdaiSelect salesAmount = &sel;
SdaiModel modelId;
/* Create Server Context */
rstat = edmiDefineServerContext("MyContext",
"Johnny", "Supervisor", "cf37ftr",
"TCP", "9090", "MyServerHost",
NULL, NULL, NULL, NULL, NULL, &myContext);
/* Create instance of sales */
rstat = edmiRemoteCreateInstanceAndPutAttrsBN(myContext,
"AdminRepository", "Economy",
"Turnover", 0, &instId, NULL);
/* Create the Id of the Economy model */
rstat = edmiRemoteGetModelBN(myContext, "AdminRepository",
"Economy", &modelId, NULL);
/* Get the type Id of tAmount */
rstat =edmiRemoteGetDefinedType(myContext, modelId,
"tAmount", &tAmountId, NULL);
/* Create typed aggregate */
salesAmount->nTypes = 1;
salesAmount->type = sdaiREAL;
salesAmount->typeList = &tAmountId;
salesAmount->value.realVal = 0;
rstat = edmiRemoteCreateTypedAggrBN(myContext,
instId, "Sales", salesAmount,
&aggrId, NULL);
. . .