Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpmn-moddle

Package Overview
Dependencies
Maintainers
3
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpmn-moddle - npm Package Compare versions

Comparing version 0.8.3 to 0.9.0

test/fixtures/bpmn/activity-children.bpmn

4

package.json
{
"name": "bpmn-moddle",
"version": "0.8.3",
"version": "0.9.0",
"description": "A moddle wrapper for BPMN 2.0",

@@ -46,4 +46,4 @@ "scripts": {

"moddle": "^0.6.0",
"moddle-xml": "^0.7.0"
"moddle-xml": "^0.8.0"
}
}

@@ -133,2 +133,17 @@ {

{
"name": "artifacts",
"type": "Artifact",
"isMany": true
},
{
"name": "resources",
"type": "ResourceRole",
"isMany": true
},
{
"name": "correlationSubscriptions",
"type": "CorrelationSubscription",
"isMany": true
},
{
"name": "supports",

@@ -149,17 +164,2 @@ "type": "Process",

"type": "Boolean"
},
{
"name": "resources",
"type": "ResourceRole",
"isMany": true
},
{
"name": "artifacts",
"type": "Artifact",
"isMany": true
},
{
"name": "correlationSubscriptions",
"type": "CorrelationSubscription",
"isMany": true
}

@@ -200,3 +200,5 @@ ]

"type": "LaneSet",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -331,3 +333,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -777,3 +781,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -783,3 +789,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -789,3 +797,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -848,3 +858,5 @@ ]

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -1137,19 +1149,19 @@ ]

{
"name": "inputSets",
"type": "InputSet",
"name": "dataInputs",
"type": "DataInput",
"isMany": true
},
{
"name": "outputSets",
"type": "OutputSet",
"name": "dataOutputs",
"type": "DataOutput",
"isMany": true
},
{
"name": "dataInputs",
"type": "DataInput",
"name": "inputSets",
"type": "InputSet",
"isMany": true
},
{
"name": "dataOutputs",
"type": "DataOutput",
"name": "outputSets",
"type": "OutputSet",
"isMany": true

@@ -1206,3 +1218,5 @@ }

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -1212,3 +1226,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -1620,3 +1636,5 @@ ]

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -1670,3 +1688,6 @@ {

"name": "ioSpecification",
"type": "InputOutputSpecification"
"type": "InputOutputSpecification",
"xml": {
"serialize": "property"
}
},

@@ -1682,3 +1703,6 @@ {

"type": "InputOutputBinding",
"isMany": true
"isMany": true,
"xml": {
"serialize": "property"
}
}

@@ -2240,11 +2264,2 @@ ]

{
"name": "loopCharacteristics",
"type": "LoopCharacteristics"
},
{
"name": "resources",
"type": "ResourceRole",
"isMany": true
},
{
"name": "default",

@@ -2256,9 +2271,7 @@ "type": "SequenceFlow",

{
"name": "properties",
"type": "Property",
"isMany": true
},
{
"name": "ioSpecification",
"type": "InputOutputSpecification"
"type": "InputOutputSpecification",
"xml": {
"serialize": "property"
}
},

@@ -2272,2 +2285,7 @@ {

{
"name": "properties",
"type": "Property",
"isMany": true
},
{
"name": "dataInputAssociations",

@@ -2289,2 +2307,7 @@ "type": "DataInputAssociation",

{
"name": "resources",
"type": "ResourceRole",
"isMany": true
},
{
"name": "completionQuantity",

@@ -2294,2 +2317,6 @@ "default": 1,

"type": "Integer"
},
{
"name": "loopCharacteristics",
"type": "LoopCharacteristics"
}

@@ -2366,3 +2393,5 @@ ]

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -2392,3 +2421,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -2429,3 +2460,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -2435,3 +2468,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -2555,3 +2590,5 @@ ]

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -2669,3 +2706,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
},

@@ -2686,3 +2725,5 @@ {

"type": "Expression",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -2689,0 +2730,0 @@ ]

@@ -83,3 +83,5 @@ {

"type": "dc:Point",
"serialize": "xsi:type"
"xml": {
"serialize": "xsi:type"
}
}

@@ -86,0 +88,0 @@ ]

'use strict';
var os = require('os');
var Helper = require('../../helper');

@@ -126,3 +128,3 @@

$type: 'camunda:Script',
source: '\n return "scriptValue";\n '
source: os.EOL + ' return "scriptValue";'+ os.EOL +' '
}

@@ -184,3 +186,3 @@ ]

$type: 'camunda:Script',
source: '\n return 1 + 1;\n '
source: os.EOL + ' return 1 + 1;'+ os.EOL + ' '
}

@@ -203,2 +205,2 @@ }

});
});

@@ -0,1 +1,3 @@

'use strict';
var _ = require('lodash'),

@@ -43,3 +45,7 @@ fs = require('fs'),

if (last && descriptor) {
if (!descriptor) {
throw new Error('property <' + name + '> does not exist');
}
if (last) {
// remove from old position

@@ -46,0 +52,0 @@ properties.splice(descriptor.idx, 1);

@@ -71,2 +71,8 @@ 'use strict';

// fix ioSpec children order
builder.alter('InputOutputSpecification', function(desc) {
builder.reorderProperties(desc, [ 'dataInputs', 'dataOutputs', 'inputSets', 'outputSets' ]);
});
builder.alter('Relationship#sources', function(desc) {

@@ -103,2 +109,29 @@ desc.name = 'source';

// fix Activity order serialization
builder.alter('Activity', function(desc) {
builder.reorderProperties(desc, [
'ioSpecification',
'properties',
'dataInputAssociations',
'dataOutputAssociations',
'resources',
'loopCharacteristics'
]);
});
builder.alter('Process', function(desc) {
builder.reorderProperties(desc, [
'auditing',
'monitoring',
'properties',
'artifacts',
'resources',
'correlationSubscriptions',
'supports'
]);
});
builder.alter('SubProcess', function(desc) {

@@ -129,3 +162,3 @@ desc.superClass.push('InteractionNode');

if (p.type === 'Expression') {
p.serialize = 'xsi:type';
p.xml = { serialize: 'xsi:type' };
}

@@ -136,3 +169,3 @@ });

builder.alter('Lane#childLaneSet', {
serialize: 'xsi:type'
xml: { serialize: 'xsi:type' }
});

@@ -205,6 +238,18 @@

builder.alter('FormalExpression#body', {
"type": "String",
"isBody": true
'type': 'String',
'isBody': true
});
builder.alter('CallableElement#ioSpecification', function(desc) {
desc.xml = { serialize: 'property' };
});
builder.alter('CallableElement#ioBinding', function(desc) {
desc.xml = { serialize: 'property' };
});
builder.alter('Activity#ioSpecification', function(desc) {
desc.xml = { serialize: 'property' };
});
builder.exportTo('resources/bpmn/json/bpmn.json');

@@ -274,3 +319,3 @@ }, done);

builder.alter('Edge#waypoint', {
serialize: 'xsi:type'
xml: { serialize: 'xsi:type' }
});

@@ -303,2 +348,2 @@

});
});

@@ -93,2 +93,38 @@ 'use strict';

it('activity children order', function(done) {
// given
fromFile('test/fixtures/bpmn/activity-children.bpmn', function(err, result) {
if (err) {
return done(err);
}
// when
toXML(result, { format: true }, function(err, xml) {
validate(err, xml, done);
});
});
});
it.skip('process children order', function(done) {
// given
fromFile('test/fixtures/bpmn/process-children.bpmn', function(err, result) {
if (err) {
return done(err);
}
// when
toXML(result, { format: true }, function(err, xml) {
console.log(xml);
validate(err, xml, done);
});
});
});
it('definitions children order', function(done) {

@@ -111,2 +147,19 @@

it('ioSpecification children order', function(done) {
// given
fromFile('test/fixtures/bpmn/inputOutputSpecification-children.bpmn', function(err, result) {
if (err) {
return done(err);
}
// when
toXML(result, { format: true }, function(err, xml) {
validate(err, xml, done);
});
});
});
it('ResourceRole#resourceRef', function(done) {

@@ -113,0 +166,0 @@

@@ -109,2 +109,102 @@ 'use strict';

it.skip('Process', function(done) {
// given
var processElement = moddle.create('bpmn:Process', {
id: 'Process_1',
flowElements: [
moddle.create('bpmn:Task', { id: 'Task_1' })
],
properties: [
moddle.create('bpmn:Property', { name: 'foo' })
],
laneSets: [
moddle.create('bpmn:LaneSet', { id: 'LaneSet_1' })
],
monitoring: moddle.create('bpmn:Monitoring'),
artifacts: [
moddle.create('bpmn:TextAnnotation', {
id: 'TextAnnotation_1',
text: 'FOOBAR'
})
],
resources: [
moddle.create('bpmn:PotentialOwner', { name: 'Walter' })
]
});
var expectedXML =
'<bpmn:process xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
'id="Process_1">' +
'<bpmn:monitoring />' +
'<bpmn:property name="foo" />' +
'<bpmn:laneSet id="LaneSet_1" />' +
'<bpmn:task id="Task_1" />' +
'<bpmn:textAnnotation id="TextAnnotation_1">' +
'<bpmn:text>FOOBAR</bpmn:text>' +
'</bpmn:textAnnotation>' +
'<bpmn:potentialOwner name="Walter" />' +
'</bpmn:process>';
// when
write(processElement, function(err, result) {
if (err) {
return done(err);
}
// then
expect(result).to.eql(expectedXML);
done(err);
});
});
it('Activity', function(done) {
// given
var activity = moddle.create('bpmn:Activity', {
id: 'Activity_1',
properties: [
moddle.create('bpmn:Property', { name: 'FOO' }),
moddle.create('bpmn:Property', { name: 'BAR' })
],
resources: [
moddle.create('bpmn:HumanPerformer', { name: 'Walter'} )
],
dataInputAssociations: [
moddle.create('bpmn:DataInputAssociation', { id: 'Input_1' })
],
dataOutputAssociations: [
moddle.create('bpmn:DataOutputAssociation', { id: 'Output_1' })
],
ioSpecification: moddle.create('bpmn:InputOutputSpecification')
});
var expectedXML =
'<bpmn:activity xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" id="Activity_1">' +
'<bpmn:ioSpecification />' +
'<bpmn:property name="FOO" />' +
'<bpmn:property name="BAR" />' +
'<bpmn:dataInputAssociation id="Input_1" />' +
'<bpmn:dataOutputAssociation id="Output_1" />' +
'<bpmn:humanPerformer name="Walter" />' +
'</bpmn:activity>';
// when
write(activity, function(err, result) {
if (err) {
return done(err);
}
// then
expect(result).to.eql(expectedXML);
done(err);
});
});
it('BaseElement#documentation', function(done) {

@@ -139,3 +239,3 @@

it.skip('CallableElement#ioSpecification', function(done) {
it('CallableElement#ioSpecification', function(done) {

@@ -156,4 +256,2 @@ // given

console.log(result);
// then

@@ -324,2 +422,37 @@ expect(result).to.eql(expectedXML);

it.skip('ItemDefinition#structureRef', function(done) {
// given
var itemDefinition = moddle.create('bpmn:ItemDefinition', {
'xmlns:xs': 'http://xml-types',
id: 'xsdBool',
isCollection: true,
itemKind: 'Information',
structureRef: 'xs:tBool'
});
var expectedXML =
'<bpmn:itemDefinition xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" ' +
'xmlns:xs="http://xml-types" ' +
'id="xsdBool" ' +
'itemKind="Information" ' +
'structureRef="xs:tBool" ' +
'isCollection="true" />';
// when
write(itemDefinition, function(err, result) {
if (err) {
return done(err);
}
// then
expect(result).to.eql(expectedXML);
done();
});
});
});

@@ -330,2 +463,21 @@

it.skip('BPMNDiagram', function(done) {
// given
var diagram = moddle.create('bpmndi:BPMNDiagram', { name: 'FOO' });
var expectedXML =
'<bpmndi:BPMNDiagram xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" name="FOO" />';
// when
write(diagram, function(err, result) {
// then
expect(result).to.eql(expectedXML);
done(err);
});
});
it('BPMNShape', function(done) {

@@ -433,2 +585,2 @@

});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc