How to control the position of a connection label?

Continuing my exploration, I’m programmatically adding connections from a bpmn:ExclusiveGateway to bpmn:Task objects. The connection has a businessObject with a name, so the label appears near the connection.

How can I control where the label appears? Ideally I’d like it to set above the connection at the target end.

Secondly, how can I style the labels - e.g. set a background color or a border, etc?

How can I control where the label appears? Ideally I’d like it to set above the connection at the target end.

We set the label automatically to the center of the created connection. That’s our BPMN specific behavior. If you want to change that, you’ll have to override the existing LabelBehavior. Also cf. to this thread.

Secondly, how can I style the labels - e.g. set a background color or a border, etc?

You will have to create a custom renderer that overrides the existing label rendering.

1 Like

Thanks Niklas - it’s been a bit of a challenge, but I now have a custom renderer integrated into my Angular app, so that should hopefully give me a good starting point for customising things.

1 Like