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 »


 
 
Reads additional information / documentation of methods in the EDMdatabase.
The purpose of the user defined method signatures is to provide information about the methods and their input parameters to the users. The methods in question are Express-X mapping schemas and query functions.
Related functions: edmiDefineMethodSignature, edmiDeleteMethodSignature, edmiDeleteMethodSignatureBN, edmiGetMethodSignatureBN, edmiModifyMethodSignature edmiGetMethodSignatureId, edmiListMethodSignatures
Header:
#include "sdai.h"
Prototype:
 EdmiError edmiGetMethodSignature(SdaiInstance      methodId,
                                  SdaiString        *methodType,
                                  SdaiString        *methodName,
                                  SdaiString        *schemaName,
                                  SdaiString        *methodClass,
                                  SdaiInteger       *arguments,
                                  SdaiPrimitiveType *returnValueDatatype,
                                  SdaiInstance      *returnValueDomainId,
                                  SdaiString        **argumentNames,
                                  SdaiPrimitiveType **argumentDatatypes,
                                  SdaiInstance      **argumentDomainIds,
                                  SdaiString        *description,
                                  SdaiString        *textualSignature);
Arguments:

methodId

The instance Id of the method. This Id is an instance of the EDM_METHOD entity in the ExpressDataManager model.

methodType

Variable that will receive the type of method. Values are:
"XPX" if the method is an Express-X Schema Map.
"QEX" if the method is a Query Function.

methodName

Variable that will receive the name that was assignad to the method when it was defined with edmiDefineMethodSignature. If the method is a Query Function, the method name will be the name of the query function it self.

schemaName

If the method is an Express-X Schema Map, this variable will receive the name of the mapping schema. If the method is a query function, the variavle will receive the name of the query schema containing the query in question, qualified with the name of the parent Express schema. E.g: "MySchema.MyQuerySchema"

methodClass

Variable that will receive the optional and user defined method class. Method classification may be used to organize methods in the EDMdatabase

arguments

This variable will receive the number of input parameters for the given method.

returnValueDatatype

Variable that will receive the type of the return value from the method. This is only applicable for query function methods.

returnValueDomainId

 

argumentNames

A buffer that will receive a null terminated list of the input parameter names.

argumentDatatypes

A buffer that will receive a list of the input parameter types that corresponds to the argument names in <argumentNames>

argumentDomainIds

 

description

Variable that will receive the user defined description of the method.

textualSignature

Optional, method signature in text.

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;
SdaiInteger nErr, nWrn;
SdaiInstance xpxMethodId;
SdaiString parNamesXpx[4] = {"Name", "Sex", "Weight", NULL};
SdaiPrimitiveType parTypesXpx[3] = {sdaiSTRING, sdaiINTEGER, sdaiREAL};
SdaiString type, name, schema, class, desc, *argNames;
SdaiPrimitiveType returnType, *argTypes;
SdaiInteger nArg;
 
/* Define Schemas */ 
rstat = edmiDefineSchema("c:/data/person.exp",
"c:/temp/person.dia",  
"Person", 0, &nWrn, &nErr); 
rstat = edmiDefineSchemaMap("c:/data/person_maps.xpx",
"c:/temp/person_maps.dia", 
0, &nWrn, &nErr); 
 
/* Define Method Signatures */ 
/* Only applicable for "XPX" */ 
rstat = edmiDefineMethodSignature( "XPX", "Insert a Person",
"InsertPerson", "CLASS_INPUT", 
parNamesXpx, parTypesXpx,  
"Inserts a new person");  
 
rstat = edmiGetMethodSignatureId("XPX", "Insert a Person",
"InsertPerson", &xpxMethodId); 
 
rstat = edmiGetMethodSignature(xpxMethodId, &type, &name, &schema,
&class, &nArg, &returnType, &argNames, 
&argTypes, &desc); 
 
printf("\nMethod Id: %d", xpxMethodId);
printf("\nMethod type : %s", strcmp(type,"XPX") ?
"Express-X SchemaMap" : "Query Function"); 
printf("\nMethod Name : %s", name);
printf("\nSchema Name : %s", schema);
printf("\nMethod Class: %s", class ? class : "Undefined";
for (i=0; i<nArg; i++) {
printf("\nParameter %d: %s (type %d)", i, argNames[i], argTypes[i]);
}
printf("\nMethod Return Type : %d", returnType);
printf("\nMethod Description : %s", desc);

  • No labels