feat(Modeler): rename createDiagram to createTemplate
This will allow us to have the same interface on dmn-js BREAKING CHANGE: * Modeler.createDiagram is renamed to Modeler.createTemplate
This commit is contained in:
parent
b17d63e883
commit
4e79d16c90
|
@ -7,7 +7,7 @@ var IdSupport = require('bpmn-moddle/lib/id-support'),
|
||||||
|
|
||||||
var Viewer = require('./Viewer');
|
var Viewer = require('./Viewer');
|
||||||
|
|
||||||
var initialDiagram =
|
var initialTemplate =
|
||||||
'<?xml version="1.0" encoding="UTF-8"?>' +
|
'<?xml version="1.0" encoding="UTF-8"?>' +
|
||||||
'<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
|
'<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
|
||||||
'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
|
'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
|
||||||
|
@ -106,8 +106,8 @@ function Modeler(options) {
|
||||||
|
|
||||||
inherits(Modeler, Viewer);
|
inherits(Modeler, Viewer);
|
||||||
|
|
||||||
Modeler.prototype.createDiagram = function(done) {
|
Modeler.prototype.createTemplate = function(done) {
|
||||||
return this.importXML(initialDiagram, done);
|
return this.importXML(initialTemplate, done);
|
||||||
};
|
};
|
||||||
|
|
||||||
Modeler.prototype.createModdle = function() {
|
Modeler.prototype.createModdle = function() {
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe('scenario - simple modeling', function() {
|
||||||
var modeler = new Modeler({ container: container });
|
var modeler = new Modeler({ container: container });
|
||||||
|
|
||||||
// when
|
// when
|
||||||
modeler.createDiagram(function(err) {
|
modeler.createTemplate(function(err) {
|
||||||
|
|
||||||
done(err);
|
done(err);
|
||||||
});
|
});
|
||||||
|
|
|
@ -189,7 +189,7 @@ describe('Modeler', function() {
|
||||||
|
|
||||||
it('should create new diagram', function(done) {
|
it('should create new diagram', function(done) {
|
||||||
var modeler = new Modeler({ container: container });
|
var modeler = new Modeler({ container: container });
|
||||||
modeler.createDiagram(done);
|
modeler.createTemplate(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue