Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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?
2Multiple root data nodes 

Proposal

Operation

OperationScenario
CREATE
  • The root data node is created
for the first time
UPDATE
  • update action on the root 'data node'
  • create, update and delete action on the non-root data nodes
DELETE
Either anchor or root
  • Root data node is deleted

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