Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// disallow appending as boundary event
if (source) {
return false;
}
// only (re-)attach one element at a time
if (elements.length !== 1) {
return false;
}
const element = elements[0];
// do not attach labels
if (isLabel(element)) {
return false;
}
// only handle boundary events
if (!isBoundaryCandidate(element)) {
return false;
}
// allow default move operation
if (!target) {
return true;
}
// disallow drop on event sub processes
if (isEventSubProcess(target)) {
return false;
x: mid.x - width / 2,
y: bbox.y - paddingTop
});
assign(style, {
fontSize: externalFontSize + 'px',
lineHeight: externalLineHeight,
paddingTop: paddingTop + 'px',
paddingBottom: paddingBottom + 'px'
});
}
// external label not yet created
if (isLabelExternal(target)
&& !hasExternalLabel(target)
&& !isLabel(target)) {
let externalLabelMid = getExternalLabelMid(element);
let absoluteBBox = canvas.getAbsoluteBBox({
x: externalLabelMid.x,
y: externalLabelMid.y,
width: 0,
height: 0
});
let height = externalFontSize + paddingTop + paddingBottom;
assign(bounds, {
width: width,
height: height,
x: absoluteBBox.x - width / 2,
this.preExecute = function(ctx) {
var element = ctx.element,
businessObject = element.businessObject,
newLabel = ctx.newLabel,
newNumber=ctx.newNumber;
if (!isLabel(element)
&& isLabelExternal(element)
&& !hasExternalLabel(element)
&& (newLabel !== '' || newNumber!=='')) {
// create label
var paddingTop = 7;
var labelCenter = getExternalLabelMid(element);
labelCenter = {
x: labelCenter.x,
y: labelCenter.y + paddingTop
};
modeling.createLabel(element, labelCenter, {
id: businessObject.id + '_label',
function isBoundaryEvent(element) {
return !isLabel(element) && is(element, 'bpmn:BoundaryEvent');
}
export function isAnyAndNotLabel(shape, var_args) {
if (isLabel(shape)) {
return false;
}
for (let i = 1; i < arguments.length; i++) {
if (is(shape, arguments[i])) {
return true;
}
}
return false;
}