Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ChoreoModeling.prototype.getHandlers = function() {
var handlers = BpmnModeling.prototype.getHandlers.call(this);
handlers['band.swap'] = SwapParticipantBandHandler;
handlers['band.create'] = CreateParticipantBandHandler;
handlers['band.delete'] = CreateParticipantBandHandler; // TODO split this handler in two
handlers['band.change'] = ChangeParticipantBandHandler;
handlers['band.swapInitiatingParticipant'] = SwapInitiatingParticipantHandler;
handlers['message.toggle'] = ToggleMessageVisibilityHandler;
handlers['message.add'] = AddMessageHandler;
handlers['element.updateLabel'] = UpdateMessageLabelHandler;
handlers['participant.toggleMultiplicity'] = ParticipantMultiplicityHandler;
handlers['elements.paste'] = ChoreoPasteHandler;
handlers['shape.append'] = ChoreoAppendShapeHandler;
handlers['link.callChoreo'] = LinkCallChoreoHandler;
handlers['link.callChoreoParticipant'] = LinkCallChoreoParticipantHandler;
return handlers;
};
if (/^domainStory:/.test(element.type)) {
this._commandStack.execute('element.updateCustomLabel', {
element: element,
newLabel: newLabel,
newBounds: newBounds
});
} else {
this._commandStack.execute('element.updateLabel', {
element: element,
newLabel: newLabel,
newBounds: newBounds
});
}
};
Modeling.prototype.updateNumber = function(element, newNumber, newBounds) {
if (/^domainStory:/.test(element.type)) {
this._commandStack.execute('element.updateCustomLabel', {
element: element,
newNumber: newNumber,
newBounds: newBounds
});
} else {
this._commandStack.execute('element.updateLabel', {
element: element,
newNumber: newNumber,
newBounds: newBounds
});
}
};
Modeling.prototype.replaceShape = function(oldShape, newShape, hints) {
if (/^domainStory:/.test(element.type)) {
this._commandStack.execute('element.updateCustomLabel', {
element: element,
newNumber: newNumber,
newBounds: newBounds
});
} else {
this._commandStack.execute('element.updateLabel', {
element: element,
newNumber: newNumber,
newBounds: newBounds
});
}
};
Modeling.prototype.replaceShape = function(oldShape, newShape, hints) {
let context = {
oldShape: oldShape,
newData: newShape,
hints: hints || {}
};
this._commandStack.execute('shape.replace', context);
return context.newShape;
};
Modeling.prototype.removeGroup = function(element) {
let children = element.children.slice();
element.children = [];
this._commandStack.execute('shape.removeGroupWithoutChildren', { element:element, children:children });
this.removeElements({ element });
};
'use strict';
import Modeling from 'bpmn-js/lib/features/modeling/Modeling';
import { inherits } from 'util';
export default function DSModeling(eventBus, elementFactory, commandStack,
domainStoryRules) {
Modeling.call(this, eventBus, elementFactory, commandStack, domainStoryRules);
}
Modeling.prototype.updateLabel = function(element, newLabel, newBounds) {
if (/^domainStory:/.test(element.type)) {
this._commandStack.execute('element.updateCustomLabel', {
element: element,
newLabel: newLabel,
newBounds: newBounds
});
} else {
this._commandStack.execute('element.updateLabel', {
element: element,
newLabel: newLabel,
newBounds: newBounds
});
}
};
Modeling.prototype.updateNumber = function(element, newNumber, newBounds) {
});
}
};
Modeling.prototype.replaceShape = function(oldShape, newShape, hints) {
let context = {
oldShape: oldShape,
newData: newShape,
hints: hints || {}
};
this._commandStack.execute('shape.replace', context);
return context.newShape;
};
Modeling.prototype.removeGroup = function(element) {
let children = element.children.slice();
element.children = [];
this._commandStack.execute('shape.removeGroupWithoutChildren', { element:element, children:children });
this.removeElements({ element });
};
inherits(DSModeling, Modeling);
DSModeling.$inject = [
'eventBus',
'elementFactory',
'commandStack',
'domainStoryRules'
];