Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function PlanItemDefinitionUpdater(
eventBus,
modeling,
cmmnReplace,
itemRegistry
) {
this._modeling = modeling;
this._cmmnReplace = cmmnReplace;
this._itemRegistry = itemRegistry;
var self = this;
CommandInterceptor.call(this, eventBus);
var containment = 'planItemDefinitions';
// CREATION //////////////////////////////////////////////////////////
this.postExecuted('shape.create', function(context) {
var shape = context.shape;
if (!isItemCapable(shape)) {
return;
}
var item = getBusinessObject(shape),
definition = getDefinition(item),
function CmmnUpdater(eventBus, cmmnFactory, itemRegistry, connectionDocking) {
CommandInterceptor.call(this, eventBus);
this._cmmnFactory = cmmnFactory;
this._itemRegistry = itemRegistry;
var self = this;
// connection cropping /////////////////
// crop connection ends during create/update
function cropConnection(e) {
var context = e.context,
connection;
if (!context.cropped) {
connection = context.connection;
function SentryUpdater(eventBus, modeling, itemRegistry, cmmnReplace, cmmnFactory) {
var self = this;
CommandInterceptor.call(this, eventBus);
var containment = 'sentries';
// CONNECTIONS ////////////////////////////////////////////////////////////
this.postExecuted('connection.create', function(context) {
var connection = context.connection;
if (!isOnPartConnection(connection)) {
return;
}
var onPart = getOnPart(connection),
criterion = connection.target,
function PlanningTableUpdater(eventBus, cmmnFactory, modeling, itemRegistry) {
this._cmmnFactory = cmmnFactory;
this._modeling = modeling;
this._itemRegistry = itemRegistry;
var self = this;
CommandInterceptor.call(this, eventBus);
var containment = 'tableItems';
// CONNECTION /////////////////////////////////////////////
// delete + reconnectEnd //////////////////////////////////
this.preExecuted([ 'connection.delete', 'connection.reconnectEnd', 'connection.reconnectStart' ], function(event) {
var context = event.context,
isReconnectStart = (event.command === 'connection.reconnectStart'),
connection = context.connection,
target = connection.target;
function LabelBehavior(eventBus, modeling, cmmnFactory) {
CommandInterceptor.call(this, eventBus);
// create external labels on shape creation
this.postExecuted([ 'shape.create', 'connection.create' ], 200, function(e) {
var context = e.context;
var element = context.shape || context.connection,
businessObject = element.businessObject;
var position;
if (hasExternalLabel(businessObject)) {
position = getExternalLabelMid(element);
modeling.createLabel(element, position, {
id: businessObject.id + '_label',
function ReplaceElementBehavior(
cmmnReplace,
cmmnRules,
elementFactory,
elementRegistry,
eventBus,
modeling,
selection,
rules
) {
CommandInterceptor.call(this, eventBus);
this._cmmnReplace = cmmnReplace;
this._cmmnRules = cmmnRules;
this._elementFactory = elementFactory;
this._elementRegistry = elementRegistry;
this._modeling = modeling;
this._selection = selection;
this._rules = rules;
var self = this;
function canConnect(source, target) {
return rules.allowed('connection.create', {
source: source,
function UnclaimIdBehavior(eventBus, modeling) {
CommandInterceptor.call(this, eventBus);
this.preExecute('elements.delete', function(event) {
var context = event.context,
elements = context.elements;
forEach(elements, function(element) {
modeling.unclaimId(element.businessObject.id, element.businessObject);
});
});
}
function CaseFileItemUpdater(
eventBus,
itemRegistry,
cmmnFactory,
modeling
) {
this._cmmnFactory = cmmnFactory;
this._modeling = modeling;
CommandInterceptor.call(this, eventBus);
var containment = 'caseFileItems';
this.preExecuted('shape.create', function(context) {
var shape = context.shape,
parent = context.parent,
parentBusinessObject = getBusinessObject(parent),
definitions,
caseFileItemDefinition,
caseFileModel;
if (!isCaseFileItem(shape)) {
return;
function ReplaceConnectionBehavior(eventBus, modeling, cmmnRules, selection, rules) {
CommandInterceptor.call(this, eventBus);
function canConnectPlanItemOnPartConnection(source, target) {
return cmmnRules.canConnectPlanItemOnPartConnection(source, target);
}
function canConnectCaseFileItemOnPartConnection(source, target) {
return cmmnRules.canConnectCaseFileItemOnPartConnection(source, target);
}
function canConnectDiscretionaryConnection(source, target, connection) {
return cmmnRules.canConnectDiscretionaryConnection(source, target, connection);
}
function CmmnReplacePreview(
cmmnReplace,
cmmnRules,
elementFactory,
elementRegistry,
eventBus,
graphicsFactory
) {
CommandInterceptor.call(this, eventBus);
function createShape(element, replacement) {
var newElement = {
type: replacement.newElementType,
x: element.x,
y: element.y,
width: element.width,
height: element.height
};
if (isItemCapable(element)) {
var bo = getBusinessObject(element),
definition = getDefinition(element),