How to use bpmn-moddle - 8 common examples

To help you get started, we’ve selected a few bpmn-moddle 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 bpmn-io / bpmn-js-properties-panel / test / spec / helper / ImplementationTypeHelperSpec.js View on Github external
describe('implementation type', function() {

  var moddle = new BpmnModdle({
    camunda: CamundaBpmnModdle
  });


  describe('service task like', function() {

    var serviceTask;

    beforeEach(function() {
      serviceTask = moddle.create('bpmn:ServiceTask');
    });


    it('should return no implementation type', function() {

      // when
github ProcessMaker / modeler / src / components / modeler / Modeler.vue View on Github external
* so they could be extended.
     *
     */
    window.ProcessMaker.EventBus.$emit('modeler-before-init', {
      registerComponentMixin: this.registerComponentMixin,
    });

    this.registerNode(Process);
    /* Initialize the BpmnModdle and its extensions */
    window.ProcessMaker.EventBus.$emit('modeler-init', {
      registerInspectorExtension,
      registerBpmnExtension: this.registerBpmnExtension,
      registerNode: this.registerNode,
    });

    this.moddle = new BpmnModdle(this.extensions);

    this.linter = new Linter(linterConfig);
  },
  mounted() {
github bpmn-io / bpmn-js / test / integration / model / BpmnModdleSpec.js View on Github external
function parse(xml, done) {
    var moddle = new BpmnModdle();
    moddle.fromXML(xml, 'bpmn:Definitions', done);
  }
github paed01 / bpmn-elements / test / helpers / testHelpers.js View on Github external
function moddleContext(source, options = {}) {
  const moddleOptions = options.extensions && Object.keys(options.extensions).reduce((result, ext) => {
    result[ext] = options.extensions[ext].moddleOptions;
    return result;
  }, {});

  const bpmnModdle = new BpmnModdle(moddleOptions);

  return new Promise((resolve, reject) => {
    bpmnModdle.fromXML(Buffer.isBuffer(source) ? source.toString() : source.trim(), (err, definitions, moddleCtx) => {
      if (err) return reject(err);
      resolve(moddleCtx);
    });
  });
}
github bpmn-io / bpmn-js / test / spec / import / ImporterSpec.js View on Github external
function runImport(diagram, xml, diagramId, done) {

    if (isFunction(diagramId)) {
      done = diagramId;
      diagramId = null;
    }

    var moddle = new BpmnModdle();

    moddle.fromXML(xml, function(err, definitions) {

      var selectedDiagram = find(definitions.diagrams, function(element) {
        return element.id === diagramId;
      });

      importBpmnDiagram(diagram, definitions, selectedDiagram, done);
    });
  }
github bpmn-io / bpmn-js / test / spec / import / BpmnTreeWalkerSpec.js View on Github external
function createModdle(xml, done) {
  var moddle = new BpmnModdle();

  moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions, context) {
    done(err, definitions, context, moddle);
  });
}
github paed01 / bpmn-elements / test / helpers / factory.js View on Github external
'bpmn:ExclusiveGateway',
  'bpmn:InclusiveGateway'
];

const activities = [
  'bpmn:Task',
  'bpmn:ScriptTask',
  'bpmn:ServiceTask',
  'bpmn:UserTask',
  'bpmn:SubProcess',
  'bpmn:ParallelGateway'
];

const cache = {};

const moddle = new BpmnModdle();

export default {
  activities,
  gateways,
  eventActivities,
  valid,
  invalid,
  userTask,
  multipleInbound,
  resource,
  create,
};

const invalidProcess = `

github Activiti / activiti-modeling-app / src / app / process-editor / services / bpmn-js / property-handlers / documentation.handler.spec.ts View on Github external
beforeEach(() => {
        const moddle = new BpmnModdle();
        handler = handlers[property];
        mockElement = getDiagramElementMock({
            [property]: [moddle.create('bpmn:Documentation', { text: 'documentation-lorem-ipsum' })]
        });

        modeling = getModelingMock();
    });

bpmn-moddle

A moddle wrapper for BPMN 2.0

MIT
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Popular bpmn-moddle functions