<%@page
	import="com.blueland.bpm.engine.core.model.ProcessDefinitionModel"%>
<%@page import="com.blueland.bpm.engine.config.model.ProcessInfoConfig"%>
<%@page import="com.blueland.bpm.common.page.*"%>
<%@page import="com.blueland.bpm.common.util.*"%>
<%@page import="java.util.*"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>查看流程图</title>
<%@ include file="/commons/meta.jsp"%>
 <link rel="stylesheet" href="${ctx}/resource/js/plugins/bpmn/css/diagram-js.css" />
</head>
<body class="white-page">
<div class="main-container" id="main-container">
<textarea name="bpmXml" rows="5" cols="20" style="display:none" id="bpmXml">
	${bpmXml}
	</textarea>
  <div class="canvas">
    <div id="js-canvas"></div>
  </div>
 </div>
  <!-- viewer -->
<script  type='text/javascript'src="${ctx}/resource/js/plugins/bpmn/bpmn-viewer.development.js"></script>
  <script type="text/javascript">
  var height1 = window.parent.document.documentElement.clientHeight;
  var windowHeight = (parseInt(height1)-250)
    var viewer = new BpmnJS({
      container: document.querySelector('#js-canvas'),
      height: windowHeight
    });
	$(function(){	
		createNewDiagram();
	})
 	function createNewDiagram () {
		viewer.importXML($("#bpmXml").val(), function (err) {
         if (err) {
           console.error(err)
         }else{
           var canvas = viewer.get('canvas');
           canvas.zoom('fit-viewport');
         }
       })
     }
</script>
</body>
</html>
