cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with navigation pattern into delegated associations

carlonnheim
Participant
0 Kudos
313

Hi,

We are delegating service calls to a remote service as described here:

https://github.com/sap-samples/cloud-cap-samples/blob/main/bookstore/srv/mashup.js

It is working if we navigate straight into the entity, e.g. by following patterns like "/Books(123)/reviews", but we get a local query to the database if we try an expansion like "/Books?$expand=reviews" or if we come into the association from some other association like "/OrderItem/Book/reviews" (does not exist in the sample code, but hope it is clear what I mean anyway)

Would appreciate if we can get some guidance on how to use (and when to not use this):

  • Is there a way to generically redirect an association like the above to a remote service or does this type of redirection only support direct navigation from the superordinate context?
  • If not, is there a way to tell the framework about this constraint? We have been trying the "@Capabilities.ExpandRestrictions.Expandable: false" annotation but it does not seem to have any result (the query still gets through).
  • Is there a way to make SAP UI5 and/or fiori elements aware so it would form its queries accordingly?

Thanks in advance for any input or clarification!

//Carl

Accepted Solutions (0)

Answers (1)

Answers (1)

vansyckel
Advisor
Advisor
0 Kudos

Hi Carl,

Reading a resource is handled differently than expanding one. With the former, Reviews is the target, with the latter, Reviews is a branch of a deep read, for which you cannot redirect. In general, CAP doesn't join data from different sources. GETs to /OrderItem(foo)/book/reviews should behave the same as to /Books(bar)/reviews.

The annotation is @Capabilities.ExpandRestrictions.NonExpandableProperties.

If this doesn't help, could you please provide some coding to make your scenario clearer?

Best,
Sebastian