bpmn-moddle
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
module.exports = function(grunt) { | ||
@@ -2,0 +4,0 @@ |
'use strict'; | ||
var _ = require('lodash'); | ||
var isString = require('lodash/lang/isString'), | ||
isFunction = require('lodash/lang/isFunction'); | ||
var Moddle = require('moddle'), | ||
ModdleXml = require('moddle-xml'); | ||
XmlReader = require('moddle-xml/lib/reader'), | ||
XmlWriter = require('moddle-xml/lib/writer'); | ||
@@ -36,3 +38,3 @@ /** | ||
if (!_.isString(typeName)) { | ||
if (!isString(typeName)) { | ||
done = options; | ||
@@ -43,3 +45,3 @@ options = typeName; | ||
if (_.isFunction(options)) { | ||
if (isFunction(options)) { | ||
done = options; | ||
@@ -49,3 +51,3 @@ options = {}; | ||
var reader = new ModdleXml.Reader(this, options); | ||
var reader = new XmlReader(this, options); | ||
var rootHandler = reader.handler(typeName); | ||
@@ -66,3 +68,3 @@ | ||
if (_.isFunction(options)) { | ||
if (isFunction(options)) { | ||
done = options; | ||
@@ -72,3 +74,3 @@ options = {}; | ||
var writer = new ModdleXml.Writer(options); | ||
var writer = new XmlWriter(options); | ||
try { | ||
@@ -75,0 +77,0 @@ var result = writer.toXML(element); |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var BpmnModdle = require('./bpmn-moddle'); | ||
@@ -2,0 +4,0 @@ |
{ | ||
"name": "bpmn-moddle", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A moddle wrapper for BPMN 2.0", | ||
@@ -31,3 +31,3 @@ "scripts": { | ||
"chai": "^1.9.1", | ||
"cmof-parser": "^0.0.3", | ||
"cmof-parser": "^0.1.0", | ||
"grunt": "^0.4.2", | ||
@@ -42,10 +42,9 @@ "grunt-contrib-jshint": "^0.7.2", | ||
"load-grunt-tasks": "^0.3.0", | ||
"xsd-schema-validator": "^0.1.0" | ||
"xsd-schema-validator": "^0.3.0" | ||
}, | ||
"dependencies": { | ||
"lodash": "^2.4.0", | ||
"sax": "^0.6.0", | ||
"moddle": "^0.5.0", | ||
"moddle-xml": "^0.5.0" | ||
"lodash": "^3.0.0", | ||
"moddle": "^0.6.0", | ||
"moddle-xml": "^0.6.0" | ||
} | ||
} |
@@ -0,3 +1,5 @@ | ||
'use strict'; | ||
var fs = require('fs'), | ||
_ = require('lodash'); | ||
map = require('lodash/collection/map'); | ||
@@ -29,3 +31,3 @@ var Model = require('moddle'); | ||
var packages = _.collect(packageNames, function(f) { | ||
var packages = map(packageNames, function(f) { | ||
var pkg = cache[f]; | ||
@@ -32,0 +34,0 @@ var file = base + f + '.json'; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
module.exports = function(chai, utils) { | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var Helper = require('../helper'); | ||
@@ -2,0 +4,0 @@ |
@@ -5,9 +5,5 @@ 'use strict'; | ||
var XMLHelper = require('../../xml-helper'), | ||
Helper = require('../../helper'); | ||
var Helper = require('../../helper'); | ||
var writeBpmn = XMLHelper.writeBpmn, | ||
readBpmn = XMLHelper.readBpmn; | ||
describe('bpmn-moddle - read', function() { | ||
@@ -358,2 +354,31 @@ | ||
it('Category', function(done) { | ||
// when | ||
fromFile('test/fixtures/bpmn/category.bpmn', 'bpmn:Definitions', function(err, result) { | ||
if (err) { | ||
return done(err); | ||
} | ||
var category = result.rootElements[0]; | ||
// then | ||
expect(category).to.jsonEqual({ | ||
$type: "bpmn:Category", | ||
id: "sid-ccc7e63e-916e-4bd0-a9f0-98cbff749195", | ||
categoryValue: [ | ||
{ | ||
$type: "bpmn:CategoryValue", | ||
id: "sid-afd7e63e-916e-4bd0-a9f0-98cbff749193", | ||
value: "group with label" | ||
} | ||
] | ||
}); | ||
done(err); | ||
}); | ||
}); | ||
it('MultiInstanceLoopCharacteristics#completionCondition', function(done) { | ||
@@ -360,0 +385,0 @@ |
@@ -27,4 +27,2 @@ 'use strict'; | ||
var ServiceTask = moddle.getType('bpmn:ServiceTask'); | ||
var process = moddle.create('bpmn:Process'); | ||
@@ -118,2 +116,24 @@ var serviceTask = moddle.create('bpmn:ServiceTask', { name: 'MyService Task'}); | ||
it('category', function(done) { | ||
// given | ||
fromFile('test/fixtures/bpmn/category.bpmn', function(err, result) { | ||
if (err) { | ||
return done(err); | ||
} | ||
// when | ||
toXML(result, { format: true }, function(err, xml) { | ||
expect(xml).to.contain('sid-afd7e63e-916e-4bd0-a9f0-98cbff749193'); | ||
expect(xml).to.contain('group with label'); | ||
validate(err, xml, done); | ||
}); | ||
}); | ||
}); | ||
it('simple process', function(done) { | ||
@@ -120,0 +140,0 @@ |
@@ -1,3 +0,6 @@ | ||
var _ = require('lodash'); | ||
'use strict'; | ||
var assign = require('lodash/object/assign'), | ||
isFunction = require('lodash/lang/isFunction'); | ||
var Helper = require('../../helper'); | ||
@@ -9,4 +12,2 @@ | ||
var createModel = Helper.createModelBuilder('resources/bpmn/json/'); | ||
var moddle = Helper.createModdle(); | ||
@@ -16,3 +17,3 @@ | ||
function write(element, options, callback) { | ||
if (_.isFunction(options)) { | ||
if (isFunction(options)) { | ||
callback = options; | ||
@@ -23,3 +24,3 @@ options = {}; | ||
// skip preamble for tests | ||
options = _.extend({ preamble: false }, options); | ||
options = assign({ preamble: false }, options); | ||
@@ -125,3 +126,3 @@ moddle.toXML(element, options, callback); | ||
'<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" id="Definitions_1">' + | ||
'<bpmn:documentation textFormat="xyz">FOO\nBAR</bpmn:documentation>' + | ||
'<bpmn:documentation textFormat="xyz"><![CDATA[FOO\nBAR]]></bpmn:documentation>' + | ||
'<bpmn:documentation><![CDATA[<some /><html></html>]]></bpmn:documentation>' + | ||
@@ -128,0 +129,0 @@ '</bpmn:definitions>'; |
Sorry, the diff of this file is not supported yet
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
877098
3
73
5080
+ Addedlodash@3.10.1(transitive)
+ Addedmoddle@0.6.4(transitive)
+ Addedmoddle-xml@0.6.0(transitive)
- Removedsax@^0.6.0
- Removedlodash@2.4.2(transitive)
- Removedmoddle@0.5.1(transitive)
- Removedmoddle-xml@0.5.1(transitive)
Updatedlodash@^3.0.0
Updatedmoddle@^0.6.0
Updatedmoddle-xml@^0.6.0