How to use the bpmn-js 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.

github bpmn-io / bpmn-js-examples / bundling / src / app.js View on Github external
// we use stringify to inline an example XML document
import pizzaDiagram from '../resources/pizza-collaboration.bpmn';


// make sure you added bpmn-js to your your project
// dependencies via npm install --save bpmn-js
import BpmnViewer from 'bpmn-js';

var viewer = new BpmnViewer({
  container: '#canvas'
});

viewer.importXML(pizzaDiagram, function(err) {

  if (!err) {
    console.log('success!');
    viewer.get('canvas').zoom('fit-viewport');
  } else {
    console.log('something went wrong:', err);
  }
});
github researchstudio-sat / webofneeds / webofneeds / won-owner-webapp / src / main / webapp / app / components / details / _angular_picker / workflow-picker.js View on Github external
initializeBpmnViewer() {
      console.debug("init bpmnviewer for element: ", this.getUniqueDiagramId());
      this.bpmnViewer = new BpmnViewer({
        container: "#" + this.getUniqueDiagramId(),
      });

      if (this.bpmnViewer) {
        console.debug("Init BpmnViewer Successful");
      } else {
        console.debug("Init BpmnViewer Failed");
      }
    }
github researchstudio-sat / webofneeds / webofneeds / won-owner-webapp / src / main / webapp / app / components / details / _angular_viewer / workflow-viewer.js View on Github external
initializeBpmnViewer() {
      this.bpmnViewer = new BpmnViewer({
        container: "#" + this.getUniqueDiagramId(),
      });

      if (!this.bpmnViewer) {
        console.warn("Init BpmnViewer Failed");
      }
    }
github bpmn-io / bpmn-js-examples / custom-meta-model / app / index.js View on Github external
import BpmnViewer from 'bpmn-js';

import sampleProcess from '../resources/sample.bpmn';

import qaPackage from '../resources/qa';

var viewer = new BpmnViewer({
  container: '#canvas',
  moddleExtensions: {
    qa: qaPackage
  }
});

viewer.importXML(sampleProcess);

function getExtension(element, type) {
  if (!element.extensionElements) {
    return null;
  }

  return element.extensionElements.values.filter(function(e) {
    return e.$instanceOf(type);
  })[0];