I have a diagram listener, “ExternalObjectsDropped”, that is called when I drag a node into my diagram from a Palette next to it…
In response to that newly dragged node, I’d like to create other new nodes using the model.addNodeDataCollection and model.addLinkDataCollection. But I’m performing this logic with my ExternalObjectsDropped event handler, and I feel that this is the wrong place. Also I’m getting an error that I shouldn’t modify my model’s data while a “transaction” is in progress.
What is the proper way to programmatically add nodes based on other nodes being dragged into my diagram? Would I have to do some kind of callback called from the event handler?