From c2e49a968a60ecc4aa50ff31eb6b539081e58fe1 Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Tue, 9 Jul 2024 11:33:02 +0200 Subject: [PATCH] feat: support `zeebe:VersionTag` Closes #59 --- resources/zeebe.json | 18 +++++++++++ test/fixtures/xml/zeebe-versionTag.part.bpmn | 9 ++++++ test/spec/xml/read.js | 34 +++++++++++++++++++- test/spec/xml/write.js | 19 +++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/xml/zeebe-versionTag.part.bpmn 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.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/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); + }); + }); });