diff --git a/resources/zeebe.json b/resources/zeebe.json index ff217da..ba9ee55 100644 --- a/resources/zeebe.json +++ b/resources/zeebe.json @@ -531,6 +531,24 @@ "isAttr": true } ] + }, + { + "name": "VersionTag", + "superClass": [ + "Element" + ], + "meta": { + "allowedIn": [ + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "value", + "type": "String", + "isAttr": true + } + ] } ] } diff --git a/test/fixtures/xml/zeebe-versionTag.bpmn b/test/fixtures/xml/zeebe-versionTag.bpmn new file mode 100644 index 0000000..e855ca1 --- /dev/null +++ b/test/fixtures/xml/zeebe-versionTag.bpmn @@ -0,0 +1,20 @@ + + + + + + + + Flow_1 + + + Flow_1 + Flow_2 + + + + Flow_2 + + + + diff --git a/test/fixtures/xml/zeebe-versionTag.part.bpmn b/test/fixtures/xml/zeebe-versionTag.part.bpmn new file mode 100644 index 0000000..ddfba4d --- /dev/null +++ b/test/fixtures/xml/zeebe-versionTag.part.bpmn @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/test/spec/xml/read.js b/test/spec/xml/read.js index fc141ac..7b534fe 100644 --- a/test/spec/xml/read.js +++ b/test/spec/xml/read.js @@ -889,7 +889,6 @@ describe('read', function() { describe('zeebe:ExecutionListener', function() { - it('on Task', async function() { // given @@ -990,7 +989,40 @@ describe('read', function() { } }); }); + + }); + + + describe('zeebe:VersionTag', function() { + + it('on Process', async function() { + + // given + var xml = readFile('test/fixtures/xml/zeebe-versionTag.part.bpmn'); + + // when + const { + rootElement: task + } = await moddle.fromXML(xml, 'bpmn:Process'); + + // then + expect(task).to.jsonEqual({ + $type: 'bpmn:Process', + id: 'process-1', + extensionElements: { + $type: 'bpmn:ExtensionElements', + values: [ + { + $type: 'zeebe:VersionTag', + value: 'v1.0.0' + } + ] + } + }); + }); + }); + }); }); diff --git a/test/spec/xml/roundtrip.js b/test/spec/xml/roundtrip.js index 1917f52..a921e7b 100644 --- a/test/spec/xml/roundtrip.js +++ b/test/spec/xml/roundtrip.js @@ -4,7 +4,6 @@ var readFile = require('../../helper').readFile, createModdle = require('../../helper').createModdle; - describe('import -> export roundtrip', function() { function stripSpaces(xml) { @@ -43,9 +42,9 @@ describe('import -> export roundtrip', function() { } - describe('should keep zeebe attributes', function() { + describe('Zeebe properties', function() { - it('Service Task:FormData', validateExport('test/fixtures/xml/simple.bpmn')); + it('should keep Zeebe properties', validateExport('test/fixtures/xml/simple.bpmn')); }); @@ -56,14 +55,24 @@ describe('import -> export roundtrip', function() { it('should keep zeebe:modelerTemplate', validateExport('test/fixtures/xml/rootElement.bpmn')); - describe('userTask', function() { + describe('zeebe:UserTask', function() { it('should keep zeebe:formDefinition properties', validateExport('test/fixtures/xml/userTask-zeebe-formDefinition.bpmn')); + }); - describe('executionListeners', function() { + describe('zeebe:ExecutionListeners', function() { it('should keep zeebe:executionListeners', validateExport('test/fixtures/xml/zeebe-execution-listeners.bpmn')); + }); + + + describe('zeebe:VersionTag', function() { + + it('should keep zeebe:versionTag', validateExport('test/fixtures/xml/zeebe-versionTag.bpmn')); + + }); + }); diff --git a/test/spec/xml/write.js b/test/spec/xml/write.js index d695c24..265cbc5 100644 --- a/test/spec/xml/write.js +++ b/test/spec/xml/write.js @@ -515,6 +515,25 @@ describe('write', function() { expect(xml).to.eql(expectedXML); }); + + it('zeebe:VersionTag', async function() { + + // given + const moddleElement = moddle.create('zeebe:VersionTag', { + value: 'v1.0.0' + }); + + const expectedXML = ''; + + // when + const xml = await write(moddleElement); + + // then + expect(xml).to.eql(expectedXML); + }); + }); });