Hi Shangfeng,
Here my response is about TMF688.
On our side we took a different approach: whatever the event to POST (through createEvent on the topic) is, the full payload of the resource included (service, resource, product, etc.) is always provided. For example, for a ServiceStateChangeEvent, the full service with full supportingResource and serviceRelationship is posted.
We do that because we expect the field selection to occur at Hub level. In the TMF630 part 1 (V4) section 10.4 Content type filtering, you can see that in the query part of the Hub, you can not only specify a filter but also the fields element (for field selection). Field selection can only be performed if the full payload is passed to TMF688.
It can also have a big advantage at performance level because when a listener receives the event, if the full payload is not passed, he probably has to perform a GET operation to retrieve the full resource (in my case the full service). If all listeners for the same event do that, then it will have a performance hit on the system which is not the case if the full payload is passed at first. The dispatching of the event to the registered listeners will apply the field selection defined for each listener's Hub.
Best regards,
Fred
------------------------------
Frederic Thise
Proximus SA
------------------------------
Original Message:
Sent: Aug 08, 2024 04:11
From: Shangfeng Liu
Subject: TMF 637 ProductAttributeValueChangeEvent and ProductStateChangeEvent Payload
Hey team, (Not sure why the previous post is not uploaded.)
Per TMF637 Product Inventory (PI), we have several questions about what the exact payload of these events and when these event(s) will be published.
Let's say, there are several cases which might trigger ProductAttributeValueChangeEvent and ProductStateChangeEvent.
Case 1:
For a PATCH request with `status` field ONLY, the ProductStateChangeEvent should be published.
- What is the exact payload of this event? With changed `status` field ONLY? When we say "changed", it means the field's value is different from db before Patch.
Case 2:
For a PATCH request with any other fields except `status` field, the ProductAttributeValueChangeEvent should be published.
- What is the exact payload of this event? With changed fields ONLY? For example, if the patch request for `name` and `description`, the event should involve these 2 fields ONLY.
Case 3:
For a PATCH request with any other fields along with `status` field,
- Which event should be published? Or both of them should be published?
- What is the exact payload of this event(s)?
------------------------------
Shangfeng Liu
LotusFlare
------------------------------