Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
forEach(element.labels, function(label) {
addElementData(label, depth);
});
addElementData(element, depth);
});
}
forEach([ element.attachers, element.incoming, element.outgoing ], addRelatedElements);
addElementData(element, depth);
return element.children;
});
elements = map(elementsData, function(elementData) {
return elementData.element;
});
// (2) copy elements
elementsData = map(elementsData, function(elementData) {
elementData.descriptor = {};
self._eventBus.fire('copyPaste.copyElement', {
descriptor: elementData.descriptor,
element: elementData.element,
elements: elements
});
return elementData;
});
function get(elementId) {
if (isArray(elementId)) {
return map(elementId, get);
}
var element;
if (isString(elementId)) {
element = getBpmnJS().invoke(function(elementRegistry) {
return elementRegistry.get(elementId);
});
if (!element) {
throw new Error('element #' + elementId + ' not found');
}
return element;
}
function mapProperty(shapes, prop) {
return map(shapes, function(shape) {
return shape[prop];
});
}
label: 'Keyboard Shortcuts',
click: () => app.emit('menu:action', 'show-shortcuts')
},
getSeparatorTemplate(),
{
label: 'Search Feature Requests',
click: () => browserOpen('https://github.com/camunda/camunda-modeler/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement')
},
{
label: 'Report Issue',
click: () => browserOpen('https://github.com/camunda/camunda-modeler/issues/new/choose')
},
getSeparatorTemplate()
];
const providedMenus = map(this.options.providers, provider => provider.helpMenu)
.filter(menu => Boolean(menu.length));
const middlePart = providedMenus.reduce((helpMenus, current) => {
return [
...helpMenus,
...current.map(mapHelpMenuTemplate),
getSeparatorTemplate()
];
}, []);
const bottomPart = [
{
label: 'Version ' + app.version,
enabled: false
}
];
function collectWaypoints(waypoints) {
return map(waypoints, function(p) {
return { x: p.x, y: p.y };
});
}
function getAllDraggedElements(shapes) {
var allShapes = selfAndAllChildren(shapes, true);
var allConnections = map(allShapes, function(shape) {
return (shape.incoming || []).concat(shape.outgoing || []);
});
return flatten(allShapes.concat(allConnections));
}
_getActivities(processInstance, filterFn) {
const elementRegistry = this._elementRegistry;
const { trace } = processInstance;
let activities = values(trace);
if (isFunction(filterFn)) {
activities = filter(activities, filterFn);
}
return map(activities, ({ activityId }) => elementRegistry.get(activityId));
}
forEach(elements, function(element) {
if (isConnection(element)) {
element.waypoints = map(element.waypoints, function(waypoint) {
return {
x: waypoint.x - bbox.x - bbox.width / 2,
y: waypoint.y - bbox.y - bbox.height / 2
};
});
}
assign(element, {
x: element.x - bbox.x - bbox.width / 2,
y: element.y - bbox.y - bbox.height / 2
});
});