The modeling module exports an updateProperties method. I want to extend this method to do some external changes while not littering the commandStack. I found the handler UpdatePropertiesHandler, and calling this directly seems to work fine for SequenceFlow elements, but on task elements the UI doesn’t update to reflect a name change. I tried digging around in the code but I can’t find anything else.
I made a codesandbox to show you how I extended this method, but here’s the general gist:
I registered a handler on the commandstack with the following execute and revert:
EditHandler.prototype.execute = function(context) {
// Do external stuff
console.log("executing edit");
// Run super's execute
UpdatePropertiesHandler.prototype.execute.call(this, context);
};
EditHandler.prototype.revert = function(context) {
// Revert external stuff
console.log("reverting edit");
// Run super's revert
UpdatePropertiesHandler.prototype.revert.call(this, context);
};
Then I later execute it like so (with element
being the bpmn:Task
element)
commandStack.execute("flow-panel.name-edit", {
element,
{name: "New Name", id: "new-name"},
});
This doesn’t update the label in the UI in contrast with the following method:
modeling.updateProperties(element, {name: "New Name", id: "new-name"});
Any help is appreciated!