Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.executed('connection.reconnect', function(context) {
var connection = context.connection,
connectionBo = connection.businessObject,
oldSource = context.oldSource,
newSource = context.newSource,
oldTarget = context.oldTarget,
oldTargetBo = oldTarget.businessObject,
oldTargetBoExtensionElements = oldTargetBo.get('extensionElements'),
newTarget = context.newTarget,
newTargetBo = newTarget.businessObject,
newTargetBoExtensionElements = newTargetBo.get('extensionElements');
self.updateSemanticParent(connectionBo, newTargetBo);
var edge = find(oldTargetBoExtensionElements.get('values'),
function(extensionElement) {
var source = extensionElement.source;
return is(extensionElement, 'biodi:Edge') && source === oldSource.id;
}
);
if (edge) {
// (1) remove edge from old target
remove(oldTargetBoExtensionElements.get('values'), edge);
// (2) add edge to new target
if (!is(newTarget, 'dmn:TextAnnotation')) {
newTargetBoExtensionElements.get('values').push(edge);
}
function findProperty(name) {
return find(props, matchPattern({ name }));
}
moddle.fromXML(xml, function(err, definitions) {
var selectedDiagram = find(definitions.diagrams, function(element) {
return element.id === diagramId;
});
importBpmnDiagram(diagram, definitions, selectedDiagram, done);
});
}
function getConnection(source, target, connectionOrType) {
return find(source.outgoing, function(c) {
return c.target === target &&
(typeof connectionOrType === 'string' ? is(c, connectionOrType) : c === connectionOrType);
});
}
beforeEach(function() {
connection = find(definitions.get('artifacts'), function(e) {
return e.sourceRef === source.businessObject && e.targetRef === textAnnotation;
});
});
function findElement(element) {
if (element.id === id) {
return element;
}
if (element.flowElements) {
return find(element.flowElements, function(flowElement) {
var foundElement = findElement(flowElement);
return foundElement && foundElement.id === id;
});
}
}
function getTimerEventDefinition(bo) {
var eventDefinitions = bo.eventDefinitions || [];
return find(eventDefinitions, function(event) {
return is(event, 'bpmn:TimerEventDefinition');
});
}
function computeOrder(element) {
if (isCMMNEdge(element)) {
element = element.businessObject.cmmnElementRef || element;
}
var entry = find(orders, function(o) {
return is(element, o.type);
});
return entry && entry.order || { level: 1 };
}