Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.postExecuted('element.updateProperties', function(event) {
var context = event.context,
properties = context.properties,
element = context.element,
businessObject = element.businessObject,
connection;
// remove condition on change to default
if (properties.default) {
connection = find(
element.outgoing,
matchPattern({ id: element.businessObject.default.id })
);
if (connection) {
modeling.updateProperties(connection, { conditionExpression: undefined });
}
}
// remove default from source on change to conditional
if (properties.conditionExpression && businessObject.sourceRef.default === businessObject) {
modeling.updateProperties(element.source, { default: undefined });
}
});
}
function alter(elementName, extension) {
var elementParts = elementName.split('#');
var elementsById = desc.byId;
var element = elementsById[elementParts[0]];
if (!element) {
throw new Error('[transform] element <' + elementParts[0] + '> does not exist');
}
if (elementParts[1]) {
var property = find(element.properties, matchPattern({
name: elementParts[1]
}));
if (!property) {
throw new Error('[transform] property <' + elementParts[0] + '#' + elementParts[1] + '> does not exist');
}
if (isFunction(extension)) {
extension.call(element, property);
} else {
assign(property, extension);
}
} else {
if (isFunction(extension)) {
extension.call(element, element);
} else {
function deferConnection(semantic, property) {
var id = parseID(property),
edge = find(edges, matchPattern({ source: id }));
if (edge) {
deferred.push(function() {
visit(semantic, edge);
});
}
}
function isFinished(activity) {
return find(processInstance.trace, matchPattern({ activityId: activity.id })).endTime !== null;
}
var filteredElements = filter(elements, function(element) {
if (!isConnection(element)) {
return true;
} else {
return (
find(elements, matchPattern({ id: element.source.id })) &&
find(elements, matchPattern({ id: element.target.id }))
);
}
});
const outgoing = filter(activity.outgoing, connection => {
const found = find(activities, matchPattern({ id: connection.target.id }));
const finished = isFinished(activity);
return found && finished;
});
CopyPaste.prototype.hasRelations = function(element, elements) {
var labelTarget,
source,
target;
if (isConnection(element)) {
source = find(elements, matchPattern({ id: element.source.id }));
target = find(elements, matchPattern({ id: element.target.id }));
if (!source || !target) {
return false;
}
}
if (isLabel(element)) {
labelTarget = find(elements, matchPattern({ id: element.labelTarget.id }));
if (!labelTarget) {
return false;
}
}
return true;
};
elements = elements.filter(function(element) {
return find(autoResize, matchPattern({ id: element.id }));
});
}
PopupMenu.prototype._getEntry = function(entryId) {
var search = matchPattern({ id: entryId });
var entry = find(this._current.entries, search) || find(this._current.headerEntries, search);
if (!entry) {
throw new Error('entry not found');
}
return entry;
};