diff --git a/resources/zeebe.json b/resources/zeebe.json index 4ef45ec..f5de4cd 100644 --- a/resources/zeebe.json +++ b/resources/zeebe.json @@ -325,6 +325,27 @@ "isAttr": true } ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": [ + "bpmn:Collaboration", + "bpmn:Process", + "bpmn:FlowElement" + ], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + }, + { + "name": "modelerTemplateVersion", + "isAttr": true, + "type": "Integer" + } + ] } ] } diff --git a/test/fixtures/xml/task-modelerTemplate.part.bpmn b/test/fixtures/xml/task-modelerTemplate.part.bpmn new file mode 100644 index 0000000..5f8a083 --- /dev/null +++ b/test/fixtures/xml/task-modelerTemplate.part.bpmn @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/test/fixtures/xml/task-modelerTemplateVersion.part.bpmn b/test/fixtures/xml/task-modelerTemplateVersion.part.bpmn new file mode 100644 index 0000000..8a75e2b --- /dev/null +++ b/test/fixtures/xml/task-modelerTemplateVersion.part.bpmn @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/test/spec/xml/read.js b/test/spec/xml/read.js index 4beb7d1..06f52ef 100644 --- a/test/spec/xml/read.js +++ b/test/spec/xml/read.js @@ -548,6 +548,55 @@ describe('read', function() { }); + + describe('zeebe:TemplateSupported', function() { + + describe('zeebe:modelerTemplate', function() { + + it('on Task', async function() { + + // given + var xml = readFile('test/fixtures/xml/task-modelerTemplate.part.bpmn'); + + // when + const { + rootElement: task + } = await moddle.fromXML(xml, 'bpmn:Task'); + + // then + expect(task).to.jsonEqual({ + $type: 'bpmn:Task', + modelerTemplate: 'foo' + }); + }); + + }); + + + describe('zeebe:modelerTemplateVersion', function() { + + it('on Task', async function() { + + // given + var xml = readFile('test/fixtures/xml/task-modelerTemplateVersion.part.bpmn'); + + // when + const { + rootElement: task + } = await moddle.fromXML(xml, 'bpmn:Task'); + + // then + expect(task).to.jsonEqual({ + $type: 'bpmn:Task', + modelerTemplate: 'foo', + modelerTemplateVersion: 1 + }); + }); + + }); + + }); + }); }); diff --git a/test/spec/xml/write.js b/test/spec/xml/write.js index c11b204..fc5f074 100644 --- a/test/spec/xml/write.js +++ b/test/spec/xml/write.js @@ -226,6 +226,44 @@ describe('write', function() { expect(xml).to.eql(expectedXML); }); + + it('zeebe:modelerTemplate', async function() { + + // given + const moddleElement = moddle.create('zeebe:ZeebeServiceTask', { + modelerTemplate: 'foo' + }); + + const expectedXML = ''; + + // when + const xml = await write(moddleElement); + + // then + expect(xml).to.eql(expectedXML); + }); + + + it('zeebe:modelerTemplateVersion', async function() { + + // given + const moddleElement = moddle.create('zeebe:ZeebeServiceTask', { + modelerTemplateVersion: '12' + }); + + const expectedXML = ''; + + // when + const xml = await write(moddleElement); + + // then + expect(xml).to.eql(expectedXML); + }); + }); });