bpmn-moddle
Advanced tools
Comparing version 0.0.1 to 0.1.0
{ | ||
"name": "bpmn-moddle", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "A moddle wrapper for BPMN 2.0", | ||
@@ -8,3 +8,2 @@ "scripts": { | ||
}, | ||
"main": "lib/main.js", | ||
"repository": { | ||
@@ -32,21 +31,22 @@ "type": "git", | ||
"devDependencies": { | ||
"grunt": "^0.4.4", | ||
"cmof-parser": "0.0.3", | ||
"grunt": "~0.4.2", | ||
"grunt-contrib-jshint": "~0.7.2", | ||
"grunt-contrib-watch": "~0.5.0", | ||
"grunt-contrib-jshint": "~0.7.2", | ||
"grunt-jasmine-node": "~0.2.1", | ||
"grunt-jsdoc": "~0.5.1", | ||
"grunt-jasmine-node": "~0.2.1", | ||
"grunt-release": "~0.7.0", | ||
"grunt-release": "^0.7.0", | ||
"jsondiffpatch": "~0.1.4", | ||
"load-grunt-tasks": "~0.3.0", | ||
"jsondiffpatch": "~0.1.4", | ||
"xsd-schema-validator": "0.0.3", | ||
"sax": "~0.6.0", | ||
"lodash": "^2.4.1", | ||
"xsd-schema-validator": "0.0.3" | ||
}, | ||
"peerDependencies": { | ||
"lodash": "~2.4.0" | ||
}, | ||
"dependencies": { | ||
"moddle": "~0.0.2", | ||
"moddle-xml": "~0.0.3" | ||
}, | ||
"peerDependencies": { | ||
"lodash": "~2.4.0" | ||
"sax": "~0.6.0", | ||
"moddle": "~0.1.0", | ||
"moddle-xml": "~0.1.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ var _ = require('lodash'), | ||
var CmofParser = require('moddle/lib/adapter/cmof/Parser'); | ||
var CmofParser = require('cmof-parser'); | ||
@@ -8,0 +8,0 @@ var Helper = require('../../Helper'); |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var Builder = require('./Builder'); | ||
@@ -11,19 +13,21 @@ | ||
var builder = new Builder(); | ||
builder.parse('resources/bpmn/cmof/BPMN20.cmof', function(pkg, cmof) { | ||
builder.cleanIDs(); | ||
// remove associations | ||
pkg.associations = []; | ||
pkg.alias = 'lowerCase'; | ||
pkg.xml = { | ||
alias: 'lowerCase' | ||
}; | ||
// perform a translation from | ||
// | ||
// | ||
// BaseElement | ||
// - extensionValues = [ ExtensionAttributeValue#value = ... ] | ||
// | ||
// | ||
// to | ||
// | ||
// | ||
// BaseElement | ||
@@ -51,3 +55,3 @@ // - extensionElements: ExtensionElements#values = [ ... ] | ||
// fix positioning of elements | ||
builder.alter('FlowElementsContainer', function(desc) { | ||
@@ -103,7 +107,7 @@ builder.swapProperties(desc, 'laneSets', 'flowElements'); | ||
var builder = new Builder(); | ||
builder.parse('resources/bpmn/cmof/BPMNDI.cmof', function(pkg) { | ||
builder.cleanIDs(); | ||
// remove associations | ||
@@ -121,3 +125,3 @@ pkg.associations = []; | ||
var builder = new Builder(); | ||
builder.parse('resources/bpmn/cmof/DI.cmof', function(pkg, cmof) { | ||
@@ -143,7 +147,7 @@ | ||
var builder = new Builder(); | ||
builder.parse('resources/bpmn/cmof/DC.cmof', function(pkg, cmof) { | ||
builder.cleanIDs(); | ||
// remove associations | ||
@@ -150,0 +154,0 @@ pkg.associations = []; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -8,2 +10,3 @@ | ||
describe('Bpmn', function() { | ||
@@ -13,2 +16,3 @@ | ||
describe('parsing', function() { | ||
@@ -154,5 +158,5 @@ | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -26,3 +26,3 @@ var fs = require('fs'), | ||
} | ||
function createModel(packageNames) { | ||
@@ -29,0 +29,0 @@ |
@@ -1,2 +0,1 @@ | ||
var logger = require('moddle').util.Logger; | ||
var jsondiffpatch = require('jsondiffpatch'), | ||
@@ -22,3 +21,3 @@ _ = require('lodash'); | ||
if (!result.pass) { | ||
logger.error('[to-deep-equal] elements do not equal. diff: ', compare.diff(actualClone, expectedClone), false, 4); | ||
console.error('[to-deep-equal] elements do not equal. diff: ', compare.diff(actualClone, expectedClone), false, 4); | ||
} | ||
@@ -43,3 +42,3 @@ | ||
// Remove when we got jasmin 2.x in browser AND node env | ||
var old = !jasmine.addMatchers; | ||
@@ -46,0 +45,0 @@ |
@@ -32,6 +32,6 @@ var os = require('os'); | ||
// given | ||
// when | ||
readFile('documentation.bpmn', 'bpmn:Definitions', function(err, result) { | ||
// then | ||
@@ -65,3 +65,3 @@ expect(result).toDeepEqual({ | ||
}); | ||
done(err); | ||
@@ -75,6 +75,6 @@ }); | ||
// given | ||
// when | ||
readFile('escalation-error.bpmn', 'bpmn:Definitions', function(err, result) { | ||
// then | ||
@@ -90,3 +90,3 @@ expect(result).toDeepEqual({ | ||
}); | ||
done(err); | ||
@@ -99,6 +99,6 @@ }); | ||
// given | ||
// when | ||
readFile('extension-elements.bpmn', 'bpmn:Definitions', function(err, result) { | ||
expect(result).toDeepEqual({ | ||
@@ -116,3 +116,3 @@ $type: 'bpmn:Definitions', | ||
}); | ||
done(err); | ||
@@ -129,6 +129,6 @@ }); | ||
readFile('simple.bpmn', 'bpmn:Definitions', function(err, result) { | ||
// then | ||
expect(result.id).toBe('simple'); | ||
done(err); | ||
@@ -142,6 +142,6 @@ }); | ||
// given | ||
// when | ||
readFile('scriptTask-script.part.bpmn', 'bpmn:ScriptTask', function(err, result) { | ||
// then | ||
@@ -163,6 +163,6 @@ expect(result).toDeepEqual({ | ||
// given | ||
// when | ||
readFile('di/bpmnedge-waypoint.part.bpmn', 'bpmndi:BPMNEdge', function(err, result) { | ||
// then | ||
@@ -189,5 +189,5 @@ expect(result).toDeepEqual({ | ||
readFile('simple-default-ns.bpmn', 'bpmn:Definitions', function(err, result) { | ||
expect(result.id).toBe('simple'); | ||
done(err); | ||
@@ -216,3 +216,3 @@ }); | ||
var references = context.getReferences(); | ||
var references = context.references; | ||
@@ -255,3 +255,3 @@ // then | ||
var references = context.getReferences(); | ||
var references = context.references; | ||
@@ -275,3 +275,3 @@ // then | ||
readFile('empty-definitions.bpmn', 'bpmn:Definitions', function(err, result) { | ||
var expected = { | ||
@@ -294,3 +294,3 @@ $type: 'bpmn:Definitions', | ||
// given | ||
// when | ||
@@ -343,3 +343,3 @@ readFile('empty-definitions-default-ns.bpmn', 'bpmn:Definitions', function(err, result) { | ||
// given | ||
// when | ||
@@ -371,3 +371,3 @@ readFile('sub-process.part.bpmn', 'bpmn:SubProcess', function(err, result) { | ||
// given | ||
// when | ||
@@ -405,3 +405,3 @@ readFile('subprocess-flow-nodes-outgoing.part.bpmn', 'bpmn:Process', function(err, result) { | ||
var sequenceFlow = result.flowElements[1]; | ||
// expect correctly resolved references | ||
@@ -422,3 +422,3 @@ expect(subProcess.incoming).toDeepEqual([ expectedSequenceFlow ]); | ||
// given | ||
// when | ||
@@ -509,3 +509,3 @@ readFile('di/bpmnshape.part.bpmn', 'bpmndi:BPMNShape', function(err, result) { | ||
describe('should handle errors', function() { | ||
@@ -518,5 +518,5 @@ | ||
readFile('error/no-xml.txt', 'bpmn:Definitions', function(err, result) { | ||
expect(err).not.toEqual(null); | ||
done(); | ||
@@ -542,3 +542,3 @@ }); | ||
readFile('error/invalid-child.bpmn', 'bpmn:Definitions', function(err, result) { | ||
expect(err).not.toEqual(null); | ||
@@ -545,0 +545,0 @@ |
@@ -1,9 +0,11 @@ | ||
var SchemaValidator = require('xsd-schema-validator'); | ||
'use strict'; | ||
var Helper = require('../Helper'), | ||
Matchers = require('../Matchers'); | ||
var Matchers = require('../Matchers'); | ||
var BpmnModel = Helper.bpmnModel(); | ||
var Helper = require('./RoundtripHelper'), | ||
BpmnModel = Helper.bpmnModel(); | ||
var BPMN_XSD = 'resources/bpmn/xsd/BPMN20.xsd'; | ||
var writeBpmn = Helper.writeBpmn, | ||
readBpmn = Helper.readBpmn, | ||
validate = Helper.validate; | ||
@@ -15,37 +17,3 @@ | ||
function readBpmnDiagram(file) { | ||
return Helper.readFile('test/fixtures/bpmn/' + file); | ||
} | ||
function readBpmn(file, callback) { | ||
BpmnModel.fromXML(readBpmnDiagram(file), 'bpmn:Definitions', callback); | ||
} | ||
function writeBpmn(element, opts, callback) { | ||
BpmnModel.toXML(element, opts, callback); | ||
} | ||
function validate(err, xml, done) { | ||
if (err) { | ||
done(err); | ||
} else { | ||
if (!xml) { | ||
done(new Error('XML is not defined')); | ||
} | ||
SchemaValidator.validateXML(xml, BPMN_XSD, function(err, result) { | ||
if (err) { | ||
done(err); | ||
} else { | ||
expect(result.valid).toBe(true); | ||
done(); | ||
} | ||
}); | ||
} | ||
} | ||
beforeEach(Matchers.add); | ||
@@ -84,3 +52,3 @@ | ||
readBpmn('complex-no-extensions.bpmn', function(err, result) { | ||
if (err) { | ||
@@ -126,3 +94,3 @@ done(err); | ||
} | ||
// when | ||
@@ -145,3 +113,3 @@ writeBpmn(result, { format: true }, function(err, xml) { | ||
} | ||
// when | ||
@@ -148,0 +116,0 @@ writeBpmn(result, { format: true }, function(err, xml) { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
868733
4
69462
55
4723
+ Addedsax@~0.6.0
+ Addedmoddle@0.1.0(transitive)
+ Addedmoddle-xml@0.1.0(transitive)
+ Addedtiny-stack@0.1.0(transitive)
- Removedmoddle@0.0.5(transitive)
- Removedmoddle-xml@0.0.4(transitive)
Updatedmoddle@~0.1.0
Updatedmoddle-xml@~0.1.0