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:
Ricardo Matias 2015-11-06 10:51:16 +01:00 committed by pedesen
parent b17d63e883
commit 4e79d16c90
3 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ var IdSupport = require('bpmn-moddle/lib/id-support'),
var Viewer = require('./Viewer');
var initialDiagram =
var initialTemplate =
'<?xml version="1.0" encoding="UTF-8"?>' +
'<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
'xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
@ -106,8 +106,8 @@ function Modeler(options) {
inherits(Modeler, Viewer);
Modeler.prototype.createDiagram = function(done) {
return this.importXML(initialDiagram, done);
Modeler.prototype.createTemplate = function(done) {
return this.importXML(initialTemplate, done);
};
Modeler.prototype.createModdle = function() {

View File

@ -20,7 +20,7 @@ describe('scenario - simple modeling', function() {
var modeler = new Modeler({ container: container });
// when
modeler.createDiagram(function(err) {
modeler.createTemplate(function(err) {
done(err);
});

View File

@ -189,7 +189,7 @@ describe('Modeler', function() {
it('should create new diagram', function(done) {
var modeler = new Modeler({ container: container });
modeler.createDiagram(done);
modeler.createTemplate(done);
});