Hello everyone,
I have a problem similar to Name of TextAnnotation resize eventhandler, but I think it is sufficiently different to warrant its own post:
Goal
I am trying to make the Text Boxes / Labels on all Elements, including on Flows, resizable. We often have rather large amounts of text there and while they do adapt in height, we would like to be able to change the width as well.
Generally speaking I would like to solve this with annotations instead of labels, but as far as I understood it bpmn.io does not support annotations on flows.
Approach
Generally we are using this code to make all elements resizable:
ResizeAllRules.prototype.init = function() {
this.addRule('shape.resize', 1500, ({ shape }) => {
return !is(shape, 'bpmn:SequenceFlow');
});
};
Problem
Currently I have two problems:
-
The label text does not follow the resizing. I can resize labels (except see below), but the text stays the same.
-
The
shape.resize
-Rule does not apply to labels on flows. Labels on start events can be resized, but the text does not adapt.
What I’m looking for
I saw the solution to my first problem here. However, I do not know how to apply this to my application without forking bpmn.io. Can I overwrite / extend TextRenderer / BpmnRenderer somehow?
As for my second problem I’m at a bit of a loss: Why would the label for flows behave differently from the label for start events?