Hi,
I look at the demo custom-elements, and I want to connect two custom elements automatically when I click the first custom element like this:
This is part of the source code I added to CustomContextPadProvider.js:
But these two custom elements are not automatically connected. I think I miss part of the source code. How can I solve this problem? Thank you very much.
function appendAction(type, className, title, options) {
if (typeof title !== 'string') {
options = title;
title = translate('Append {type}', { type: type.replace(/^bpmn:/, '') });
}
function appendStart(event, element) {
var shape = elementFactory.createShape(assign({ type: type }, options));
create.start(event, shape, element);
}
var append = autoPlace ? function(event, element) {
var shape = elementFactory.createShape(assign({ type: type }, options));
autoPlace.append(element, shape);
} : appendStart;
return {
group: 'model',
className: className,
title: title,
action: {
dragstart: appendStart,
click: append
}
};
}
if (isAny(businessObject, [ 'custom:triangle', 'custom:circle'])) {
assign(actions, {
'connect': {
group: 'connect',
className: 'bpmn-icon-connection-multi',
title: translate('Connect using custom connection'),
action: {
click: startConnect,
dragstart: startConnect
}
},
'append.custom:circle': appendAction(
'custom:circle',
'icon-custom-circle'
)
});
}