Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-977

Allow POST with $apply to invoke an action to an aggregated result

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Deferred
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.0_CS02
    • Fix Version/s: None
    • Component/s: Data Aggregation
    • Labels:
    • Environment:

      Proposed

    • Proposal:
      Hide

      Deferred proposal

      Add to chapter 3:

      Service-defined bound actions that take an entity set as their binding parameter MAY be used as the last set transformation within $apply if the type of the binding parameter matches the type of the result set of the preceding transformation. In this case the request MUST be a POST request.

      Example:
      Discount all products that meet a filter condition

      POST Products?$apply=filter(ShelfLife gt duration'P90D')/Special.Discount(Percent=15)
      

      Note: this example is now possible with URL Conventions 4.12 Addressing a Subset of a Collection

      Updated proposal

      If new use cases arise using other transformations, we may introduce a path segment /$apply(...) that can be followed by the action to call on the aggregated result.

      Show
      Deferred proposal Add to chapter 3: Service-defined bound actions that take an entity set as their binding parameter MAY be used as the last set transformation within $apply if the type of the binding parameter matches the type of the result set of the preceding transformation. In this case the request MUST be a POST request. Example: Discount all products that meet a filter condition POST Products?$apply=filter(ShelfLife gt duration 'P90D' )/Special.Discount(Percent=15) Note: this example is now possible with  URL Conventions 4.12 Addressing a Subset of a Collection Updated proposal If new use cases arise using other transformations, we may introduce a path segment /$apply(...) that can be followed by the action to call on the aggregated result.

      Description

      Currently it is not possible to aggregate data and then directly apply an action to the aggregation result.

      An interesting special case is to filter an entity set and then apply an action to the set of entities that passes the filter, e.g. discount all products that have been on the shelf for more than three months.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: