Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import bpmn file from a directory in the page html? #86

amir3164 opened this Issue Feb 28, 2019 · 2 comments


None yet
3 participants
Copy link

amir3164 commented Feb 28, 2019

hi I want to import a file from of the directory and not of the a url. but dont load

 var diagramUrl = 'http://localhost:40275/lib/diagram.bpmn';
function openDiagram(bpmnXML) {
      // import diagram
        bpmnModeler.importXML(bpmnXML, function (err) {

        if (err) {
          return console.error('could not import BPMN 2.0 diagram', err);

        // access modeler components
        var canvas = bpmnModeler.get('canvas');
        var overlays = bpmnModeler.get('overlays');

        // zoom to fit full viewport

        // attach an overlay to a node
        overlays.add('SCAN_OK', 'note', {
          position: {
            bottom: 0,
            right: 0
          html: '<div class="diagram-note">Mixed up the labels?</div>'
//          var buttonHtml = domify(`
//  <button>Click Me</button>

        //buttonHtml.addEventListener('click', function () {
        //    alert('button clicked');
        //overlays.add('SCAN_OK', {
        //    position: {
        //        bottom: 0,
        //        right: 0
        //    },
        //    html: buttonHtml
        // add marker
        canvas.addMarker('SCAN_OK', 'needs-discussion');

    // load external diagram file via AJAX and open it
     $.get(diagramUrl, openDiagram, 'text');

This comment has been minimized.

Copy link

barmac commented Mar 1, 2019

Unfortunately, I am not able to understand what you are trying to achieve. Can you please describe your use case? Please write, what is your ultimate goal, i.e. what the user should be able or not be able to do when the code runs.


This comment has been minimized.

Copy link

nikku commented Mar 1, 2019

Duplicate / cross post of bpmn-io/bpmn-js#941.

@nikku nikku closed this Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.