Comparing document data of same model

Question on behalf of Christian Muno:

Is there an A12 functionality or a project specific implementation to compare document data of the same model, to find out which values have been changed?

Answer on behalf of @tomas-thin-gale:

There is currently a kernel ticket being implemented for that: <INTERNAL_LINK> But it only concerns Java code. Please take a look, if this will fit your needs.

Answer on behalf of @stefan-sparse-array :

We were facing the same problem for our accounting project and implemented a “workaround”: <INTERNAL_LINK> But this is on client side only.

Answer on behalf of @andreas-fresh-mesa:

It should also be possible to use something like: GitHub - deblockt/json-diff: A library to generate a json diff on java.

Answer on behalf of @dave-golden-layer:

I think the easiest way would be to use the Java API, serialize the documents into IDocument and then create a intersection of both document Entity Sets or a difference of them, if you need to know the differences between particular documents.
For this you need to create a Wrapper Class for IEntityInstance that checks for equality of the IEntityInstance and the value.
Then you can stream().map the Entity Sets into the Sets of WrapperClass and afterwards just use the retainAll/removeAll Set methods to calculate the differences.
→ Introduced by: <INTERNAL_LINK>
→ Minimal Kernel Version 24.0.0
→ References: <INTERNAL_LINK> and Set (Java Platform SE 7 )