Versions Compared

Key

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

...

But the same does not apply in case of update operation. and because there can be several complex scenarios which can occur in case update operation. This documentation discusses a few of the scenarios and how to handle them.

...

  • In order to find the values that have been updated between two data nodes, each leaf of node present under the source data node is to be accessed and compared to the leaf of node present under the target data node. In doing so all the information about the data nodes relation to other data nodes is lost, because the algorithm accesses each data node based on their xpath, then accesses the individual leaves of the said data node, which are then compared and based on any changes detected the leaves are added to the delta report.
    Since the data is accessed at a low level (leaf node) to generate the delta report, it becomes impossible to reconstruct the data node back and represent the updated data in the original JSON/XML structure. Therefore, the best approach is to provide the delta of updated nodes individually irrespective of the fact that they are in a parent-child relationship.

  • Reconstructing the data node to represent the original data structure would require some kind of data manipulation which is not suitable as it could lead to discrepancies in the delta that is generated.

For the following scenarios we take the following source and target data as a common starting point

Expand

Source Data

Target Data

Code Block
[
  {
    "parent": {
      "leaf-1": "leaf-1 data",
      "leaf-2": "leaf-2 data",
      "child": {
        "child-1 data": "child-1 data",
        "child-2 data": "child-2 data"
      }
    }
  }
]
Code Block
languagejson
[
  {
    "parent": {
      "leaf-1": "leaf-1 data",
      "leaf-2": "leaf-2 updated data",
      "child": {
        "child-1 data": "child-1 updated data",
        "child-2 data": "child-2 data"
      }
    }
  }
]

Mechanism for comparison

Gliffy
macroId126c577b-730c-4caf-9f6a-ca9338875b53

Scenario 1: Parent is updated; child is updated

...