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


 
Returns a numeric typeID that uniquely identifies a defined type instance in the remote EDMdatabase. The defined type is specified by its name and the name of the Express Schema that defines the it.
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 specified Express Schema, then this operation will search for it in the EDMmetaMetaModel named SDAI_DICTIONARY_MODEL_DICTIONARY_DATA.
Related functions: edmiRemoteGetDefinedType, edmiGetDefinedType, edmiGetDefinedTypeBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetDefinedTypeBN(SdaiServerContext serverContextId,
                                      SdaiString        schemaName,
                                      SdaiString        typeName,
                                      SdaiType          *typeId,
                                      SdaiInvocationId  *edmiInvocationId);
 
Arguments:

serverContextId

Context identification, from edmiDefineServerContext

schemaName

Specifies the name of the Express Schema that defines the defined type for which to retrieve its Id. This schema must be found as a dictionary model in the remote _EDMdatabase{_}. Schema names are case insensitive.

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;
 
/* 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); 
 
/* Get the type Id of tAmount */
rstat = edmiRemoteGetDefinedTypeBN(myContext, "Accounts",
"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); 
. . .

  • No labels