Custom Script Functions for OData Channel

The process flow chart depicts how the two custom script functions that are available for OData Channel work.

  1. The function ProcessRequestData is invoked after the OData request is handled by the Integration Gateway runtime where, OData request is converted into HashMap format and URI into UriInfo header. Use ProcessRequestData to modify the request body (in HashMap format) before it is handed over to ODC endpoint.

    Input: For create and update requests, the message body contains the HashMap representation of the OData request data. For other operations, the body is empty. All other information is available as headers. See Message Headers.

    Output: The message output contains a HashMap in its body.

    Example: Create and update request: If the OData request is in the format given below, then the HashMap should be as shown in the HashMap table.
    <EntityTypeName>
      <Key1>KeyValue1</Key1>
      <Key2>KeyValue2</Key2>
      <Property1>Value1</Property1> 
      <Property2>Value2</Property2> 
    </EntityTypeName> 
    HashMap
    Key Value
    EntityTypeName <HashMap1>
    The HashMap1 contains:
    Key Value
    Key1 KeyValue1
    Key2 KeyValue2
    Property1 Value1
    Property2 Value2.
  2. Function ProcessResponseDatais invoked after the response is received from the ODC endpoint. Use ProcessResponseData to modify the response in HashMap format.

    Input: Response body in HashMap format.

    Output: Final response body in HashMap format, which is converted to OData response by Integration Gateway.