Modify suggested/related elements of an event in Bpmn.io

Hi,

Can anybody help me out to modify(delete&add new) suggested group of icons which comes with event after dragged to the canvas, i just want to add a new icon also delete some icons from the group.

image

Thanks,
Siva

Hi SIva,

If you want to just add the icons, you can register your own provider using ContextPad#registerProvider: https://github.com/bpmn-io/diagram-js/blob/master/lib/features/context-pad/ContextPad.js#

For further modification, you can subclass existing ContextPadProvider and reimplement ContextPadProvider#getContextPadEntries: https://github.com/bpmn-io/bpmn-js/blob/350a5ab75ed675991599faff9615e4bbe184d491/lib/features/context-pad/ContextPadProvider.js

Best,

Maciej

1 Like

Hi Maciej,

Thanks for the reply,
I have ContextPadProvider.js file, i’m using angular version of bpmn.io, whether i have to create a instance or i have to edit directly inside the file, i’m new to bpmn.io thats why!

thanks,
Siva

What are you referring to as the Angular version of bpmn.io?

Hi philipp,

I’m referring the angular project created by narve.

thanks,
Siva

You’d have to override the current provider with your customized version of it.

thanks for the help philipp, how can i make the text input lable disable once the value is set

thanks,
Siva

Hi Siva,

please provide a code example so that we can help you.

Best,

Maciej

Hi Maciej,

image

i want to make the name readonly, i’m binding the name using the following method through a seperate form,

var elementRegistry = this.modeler.get(ā€˜elementRegistry’);
var element = elementRegistry.get(id);
var modeling = this.modeler.get(ā€˜modeling’);
var name=ā€œstart eventā€;
modeling.updateProperties(element, {
name: name,
});

so i just want to disable or make it readonly in the canvas.

Thanks,
Siva

You’d have to override LabelEditingProvider with your own implementation to achieve this.

i will try, thanks for the idea