I’m using the copyPaste feature of the modeler, and I’ve noticed that it’s not copying the attributes from $attrs.
let selection = this.bpmnModeler.get("selection");
let selected = selection._selectedElements;
let copyPaste = bpmnModeler.get("copyPaste");
copyPaste.copy(selected); //this is the function that doesn´t copy the $attrs
let copied = clipboard.get();
Properties in $attrs are not copied by default. Ideally they wouldn’t be added to $attrs in the first place. I assume you’re not using a model extension?
Yes, in fact I have defined the model extension. For example, here I show you the partial code:
And here I’m passing it to a bpmn-js instance in customFields
I should add that I also have defined a class that extends CommandInterceptor and has a function that is executed after shape.create that sets default values for the properties using this:
modeling.updateProperties(shape, { // my properties })
Maybe this function is adding the properties to $attrs?