mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-17 05:19:42 +08:00
chore(project): pull bpmn-moddle changes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var Diagram = require('diagram-js'),
|
||||
BpmnModel = require('bpmn-moddle'),
|
||||
BpmnModdle = require('bpmn-moddle'),
|
||||
$ = require('jquery'),
|
||||
_ = require('lodash');
|
||||
|
||||
@ -72,6 +72,7 @@ function Viewer(options) {
|
||||
// unwrap jquery
|
||||
this.container = container.get(0);
|
||||
|
||||
|
||||
/**
|
||||
* The code in the <project-logo></project-logo> area
|
||||
* must not be changed, see http://bpmn.io/license for more information
|
||||
@ -104,7 +105,9 @@ Viewer.prototype.importXML = function(xml, done) {
|
||||
|
||||
var self = this;
|
||||
|
||||
BpmnModel.fromXML(xml, 'bpmn:Definitions', function(err, definitions) {
|
||||
this.moddle = this.createModdle();
|
||||
|
||||
this.moddle.fromXML(xml, 'bpmn:Definitions', function(err, definitions) {
|
||||
|
||||
if (err) {
|
||||
err = checkValidationError(err);
|
||||
@ -128,11 +131,14 @@ Viewer.prototype.saveXML = function(options, done) {
|
||||
return done(new Error('no definitions loaded'));
|
||||
}
|
||||
|
||||
BpmnModel.toXML(definitions, options, function(err, xml) {
|
||||
this.moddle.toXML(definitions, options, function(err, xml) {
|
||||
done(err, xml);
|
||||
});
|
||||
};
|
||||
|
||||
Viewer.prototype.createModdle = function() {
|
||||
return new BpmnModdle();
|
||||
};
|
||||
|
||||
var SVG_HEADER =
|
||||
'<?xml version="1.0" encoding="utf-8"?>\n' +
|
||||
@ -209,7 +215,8 @@ Viewer.prototype._createDiagram = function(options) {
|
||||
|
||||
// add self as an available service
|
||||
modules.unshift({
|
||||
bpmnjs: [ 'value', this ]
|
||||
bpmnjs: [ 'value', this ],
|
||||
moddle: [ 'value', this.moddle ]
|
||||
});
|
||||
|
||||
options = _.omit(options, 'additionalModules');
|
||||
|
Reference in New Issue
Block a user