All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jonasrutishauser.maven.plugin.bpmn.bpmn.js Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
/*
 * Copyright (C) 2017 Jonas Rutishauser
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation version 3 of the License.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.
 * If not, see .
 */

function showBpmn( container, url ) {
   var viewer = new BpmnJS( { container } );
   var xhr = new XMLHttpRequest();
   xhr.onreadystatechange = function() {
      if ( xhr.readyState === 4 ) {
         viewer.importXML( xhr.response, function( err ) {
            if ( !err ) {
               var canvas = viewer.get( 'canvas' );
               container.style.height = canvas.viewbox().inner.height + canvas.viewbox().inner.y + 10 + 'px';
               container.style.width = canvas.viewbox().inner.width + canvas.viewbox().inner.x + 100 + 'px';
            }
         } );
      }
   };
   xhr.open( 'GET', url, true );
   xhr.send( null );
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy