Solved

Get Complex structures in ODATA, second question

  • 11 January 2023
  • 3 replies
  • 223 views

Userlevel 1
Badge +4

I earlier added the question https://community.ifs.com/topic/show?tid=30227&fid=50 regarding complex ODATA responses. 

Now, I just want someone to confirm the assumed framework limitation, or if it is no limitation. Just, to clearify things for me 😀

According to ODATA standard the Expand feature is used to get/filter complex structures, like 1..m or m..1 or just 1...1 relations.

If you trying the Odata org example service, you can run the following request:

https://services.odata.org/V4/TripPinServiceRW/People?$expand=Trips($filter=startswith(Name, 'Trip'))

It will list the persons and the trips they have done. This will return a typical 1..m structure.

As I understand, there is no support for this Expand usage within Marble? Please correct me if I am wrong. The only usage of the Expand in Marble is references, i.e. 1..1, which means that below collection is not possible to achieve.

If this is a current limitation in Marble, will this feature be added in the future? (So the Expand can be used as it supposed to be used).

 

 

icon

Best answer by Rifki Razick 13 January 2023, 12:48

View original

3 replies

Userlevel 4
Badge +9

Hi @LevFredrB ,

 

This particular $expand scenario (1 to many) is currently not supported in the IFS OData implementation. However we have plans to support this in a future release.

Also note that this can be modeled today in Marble using the array keyword in the projection model. But the current OData API implementation only provides the child items via a navigation per parent object.

e.g. Orders(Id=1)/OrderItems

 

Regards,

/Rifki

 

Userlevel 5
Badge +17

@LevFredrB As Rifki has mentioned you cannot achieve this with the current IFS Implementation of the $expand functionality and this is a known limitation. If you build your own projection though (i.e. model it in Developer Studio) you can define structures including arrays though but the difference is that you will have to write the logic to fill these structures yourself in PL/SQL rather than having the fetching of the data being automatically implemented from the model as a SQL statement.

Userlevel 1
Badge +4

Thanks for the replys, yes. I have used the more manually way of to achieve the complex structure, by filling structures/arrays. It works but of course, even though the 1..m usage is not needed for the Aurena FW, it really usable for integrations. So, it would be create if the $Expand 1..m feature would be added to IFS OData logic (so it was possible to model in Marble too) 😀

 

Reply