The tooling supports different kinds of popup menus, each of these can be extended by implementing a PopupMenuProvider
. As you implement it you must pass the name of the popup menu to extend, in this case bpmn-replace
.
Full example for such an extension:
class CustomReplaceMenuProvider {
constructor(popupMenu) {
popupMenu.registerProvider('bpmn-replace', this);
}
getPopupMenuEntries(element) {
return {
alert: {
label: 'Alert element ID',
className: 'alert',
action: function () {
alert(element.id);
}
}
};
}
}