/AWS1/CL_APY=>EVALUATEMAPPINGTEMPLATE()
¶
About EvaluateMappingTemplate¶
Evaluates a given template and returns the response. The mapping template can be a request or response template.
Request templates take the incoming request after a GraphQL operation is parsed and convert it into a request configuration for the selected data source operation. Response templates interpret responses from the data source and map it to the shape of the GraphQL field output type.
Mapping templates are written in the Apache Velocity Template Language (VTL).
Method Signature¶
IMPORTING¶
Required arguments:¶
iv_template
TYPE /AWS1/APYTEMPLATE
/AWS1/APYTEMPLATE
¶
The mapping template; this can be a request or response template. A
template
is required for this action.
iv_context
TYPE /AWS1/APYCONTEXT
/AWS1/APYCONTEXT
¶
The map that holds all of the contextual information for your resolver invocation. A
context
is required for this action.
RETURNING¶
oo_output
TYPE REF TO /aws1/cl_apyevaluatemaptmplrsp
/AWS1/CL_APYEVALUATEMAPTMPLRSP
¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->/aws1/if_apy~evaluatemappingtemplate(
iv_context = |string|
iv_template = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_evaluationresult = lo_result->get_evaluationresult( ).
lo_errordetail = lo_result->get_error( ).
IF lo_errordetail IS NOT INITIAL.
lv_errormessage = lo_errordetail->get_message( ).
ENDIF.
LOOP AT lo_result->get_logs( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_value( ).
ENDIF.
ENDLOOP.
lv_stash = lo_result->get_stash( ).
lv_outerrors = lo_result->get_outerrors( ).
ENDIF.