node.bind(new Binding("height", "", (data: AllFlowNodeType, node: Node) => {
let bounds = data.BPMNShape.Bounds;
return bounds.height
}).makeTwoWay((height, data) => {
console.log("height");
let task = data as ServiceTask;
task.BPMNShape.Bounds.height = height;
}))
now this work perfect.
but when I do undo operation I noticed that the makeTwoWay function is not called (the console log is empy).
so my model is not in sync with the diagram.
If you called Model.set on data.BPMNShape.Bounds, "height", ..., then the undo and redo will re-set the property, in addition to re-setting of the GraphObject.height property.
model.setDataProperty(data,"BPMNShape", data.BPMNShape) looks like it will always be a no-op, since it is equivalent to data.BPMNShape = data.BPMNShape.
Why can’t you do what I suggested? model.set(data.BPMNShape, "height", height)
instead of both of those lines of code?