Reads the additional information / documentation of a method, identified by its methodId, in a remote 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: edmiRemoteDefineMethodSignature, edmiRemoteDeleteMethodSignature, edmiRemoteGetMethodSignatureBN, edmiRemoteListMethodSignatures, edmiRemoteModifyMethodSignature.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetMethodSignature(SdaiServerContext serverContextId,
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,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
methodId |
The instance Id of that uniquely identifies the method in the remote EDMdatabase. 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: |
methodName |
Variable that will receive the name that was assigned to the method when it was defined with edmiRemoteDefineMethodSignature. 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 parameter is only applicable for query function methods. |
returnValueDomainId |
|
argumentNames |
A buffer that will receive a null terminated list of input parameter names. |
argumentDatatypes |
A buffer that will receive a list of the input parameter types that correspond 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. |
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:
int i;
EdmiError rstat;
SdaiServerContext myContext;
SdaiPrimitiveType type;
SdaiInteger nModInst, nInst, nMethod;
SdaiAggr methodAggr;
SdaiInstance *methodBuff;
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Johnny", "Supervisor", "cf37ftr",
"TCP", "9090", "MyServerHost",
NULL, NULL, NULL, NULL, NULL, &myContext);
rstat = edmiRemoteGetEntityExtentBN(myContext, "SystemRepository",
"ExpressDataManager", "EDM_METHOD", 0,
&methodAggr, &nInst, &nModInst, NULL);
nMethod = 100;
rstat = edmiRemoteReadAggrElements(myContext, methodAggr,
0, 0, 100, &nMethod, &type, NULL,
&methodBuff, NULL);
for (i=0;i<nMethod;i++) {
SdaiString _methodType;
SdaiString _methodName;
SdaiString _schemaName;
SdaiString _methodClass;
SdaiInteger _nArgs;
SdaiPrimitiveType _returnType;
SdaiString *_argNames;
SdaiPrimitiveType *_argTypes;
SdaiString _methodDesc;
rstat = edmiRemoteGetMethodSignature(myContext, methodBuff[i],
&_methodType, &_methodName, &_schemaName,
&_methodClass, &_nArgs, &_returnType,
&_argNames, &_argTypes, &_methodDesc, NULL);
printf("\n%d : Method %s\n %s", i, _methodName, _methodDesc);
}
. . .