Hello Peter,
Yes you're right about the implementation of the server on the listener side.
About the events themselves it is true that they are generic (the entity is passed). The subscriber can pick only a subset of the attributes when it subscribes via the HUB (specifying the expected attributes).
We are working on this event topic for the next release.
For example we will leverage the json-patch grammar in the informationRequired event.
To give you an couple of examples on the Quote API (but the pattern will be the same)
Information required example:
{
"correlationId": "qs1-k33",
"description": "QuoteInformationRequiredEvent illustration",
"domain": "Commercial",
"eventId": "966",
"eventTime": "2021-09-27T07:43:59.059Z",
"eventType": "QuoteInformationRequiredEvent",
"priority": "1",
"timeOcurred": "2021-09-27T07:43:59.059Z",
"title": "QuoteInformationRequiredEvent",
"event": {
"quote": {
"id": "5252",
"href": "https://host:port/quoteManagement/v4/quote/5252",
"@type": "EntityRef",
"@referredtype": "Quote"
},
"informationRequired": {
"informationRequiredPath": [
{
"op": "add",
"path": "agreement.id"
},
{
"op": "add",
"path": "contactMedium"
}
]
}
},
"@baseType": "Event",
"@type": "QuoteInformationRequiredEvent"
}
State change example:
{
"correlationId": "333-fd6",
"description": "QuoteStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "569",
"eventTime": "2021-09-27T07:43:59.059Z",
"eventType": "QuoteStateChangeEvent",
"priority": "1",
"timeOcurred": "2021-09-27T07:43:59.059Z",
"title": "QuoteStateChangeEvent",
"event": {
"quote": {
"id": "9693",
"href": "https://host:port/quoteManagement/v4/quote/9693",
"@type": "Quote",
"state": "approved",
"itemStateChange": [
{
"itemId": "1",
"state": "approved"
},
{
"itemId": "2",
"state": "approved"
}
]
}
},
"@baseType": "Event",
"@type": "QuoteStateChangeEvent"
}
Hope it helps,
Ludovic
------------------------------
Ludovic Robert
Orange
My answer are my own & don't represent necessarily my company or the TMF
------------------------------