Our process requires to listen to every change that occurs in both "TaskStore" and "DependencyStore".
With "TaskStore" the data structure returned are the same, whenever in the taskStore an event is "Added" "Updated" or "Deleted".
BUT with the "DependecyStore" we noticed that the data Structure returned are different
(Please have a look at the screenshot to have a clear understanding)
The Data Structure does not mean the value itself but the type of data returned.
As a matter of fact :
1) When a dependency is "Added" then the event returns 2 main properties :
- Data ------------------> This property contains the layout of the dependency (how it is drawn) (fromSide, toSide)
- OriginalData -----> This property contains the data structure matches the record set and where all new value
can be retrieved, so as to perform Database create (fromEvent / toEvent) Why here
2) When a dependency is "Updated " then the event returns 1 main property:
- Data --------> Where the data structure matches the record set and where all updated value can be retrieved;
so as to perform a Database update. (as the TaskStore we think this is the right place to retrieve data value)
In conclusion, we wonder whether this is done on purpose or if this is a mistake because with the TaskStore we do not need to switch between "data" or "original data" since the event returned, gives us the right recordset and value in the property "data".
This is not a big deal since we can monitor the type of change that occurs in the dependencyStore; but in term of coherence, this does not make sense to retrieve the value in the property "OriginalData" when a dependency is ADDED
To complete our post, since we want to be more precise.
When a dependency is added we have to grab values from :
event.originalData.fromEvent.id
event.originalData.toEvent.id
event.data.type
event.data.lag