...
The CPS-core notification system only sends data-update events when a root data node is created or the anchor is updated. There is no support for delete change. And, the existing supported operations are also not differentiated in the event. To define the operation type, we need to change the existing event structure and the changes on both the cps-core and cps-temporal sides to support the new event version.
Decision/Issues
1 | 'operation' field in the event should be mandatory or optional? | |
2 | Multiple root data nodes |
Proposal
Operation
Operation | Scenario |
---|---|
CREATE |
|
UPDATE |
|
DELETE |
|
Event
Event Structure
The event V1 schema definition is strict and it is not possible to add any optional fields without breaking the old schema contract. To have the flexibility of adding optional fields in future with full compatibility, we are setting the value of 'additionalProperties' to true in both 'CpsDataUpdatedEvent' and 'Content' definitions.
...
cps core should send the event with the 'operation' information for all the events. The scenarios are defined in the Operation section of the proposal.
' Delete Data Node means → Anchor deletion"
In the case of the 'delete' event, the 'data' field should not be sent.
...
It will store the new 'operation' field in the newly added column in the network_data table. if If this field is optional in the event, the default value of UPDATE will be set on the temporal side.
...
The newly added field 'operation' should have a value of 'UPDATE' for the existing fielddata in the network_data table.