How to use the bpmn-js/lib/features/modeling/Modeling.prototype function in bpmn-js

To help you get started, we’ve selected a few bpmn-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bptlab / chor-js / lib / features / modeling / ChoreoModeling.js View on Github external
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;
};
github WPS / domain-story-modeler / app / domain-story-modeler / features / modeling / DSModeling.js View on Github external
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) {
github WPS / domain-story-modeler / app / domain-story-modeler / features / modeling / DSModeling.js View on Github external
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 });
};
github WPS / domain-story-modeler / app / domain-story-modeler / features / modeling / DSModeling.js View on Github external
'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) {
github WPS / domain-story-modeler / app / domain-story-modeler / features / modeling / DSModeling.js View on Github external
});
  }
};

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'
];