Skip to content

Commit

Permalink
feat: support zeebe:VersionTag
Browse files Browse the repository at this point in the history
Closes #59
  • Loading branch information
philippfromme committed Jul 9, 2024
1 parent b87ba33 commit 8df1658
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 6 deletions.
18 changes: 18 additions & 0 deletions resources/zeebe.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,24 @@
"isAttr": true
}
]
},
{
"name": "VersionTag",
"superClass": [
"Element"
],
"meta": {
"allowedIn": [
"bpmn:Process"
]
},
"properties": [
{
"name": "value",
"type": "String",
"isAttr": true
}
]
}
]
}
20 changes: 20 additions & 0 deletions test/fixtures/xml/zeebe-versionTag.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:extensionElements>
<zeebe:versionTag value="v1.0.0" />
</bpmn:extensionElements>
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1">
<bpmn:incoming>Flow_1</bpmn:incoming>
<bpmn:outgoing>Flow_2</bpmn:outgoing>
</bpmn:task>
<bpmn:sequenceFlow id="Flow_1" sourceRef="StartEvent_1" targetRef="Task_1" />
<bpmn:endEvent id="EndEvent_1">
<bpmn:incoming>Flow_2</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_2" sourceRef="Task_1" targetRef="EndEvent_1" />
</bpmn:process>
</bpmn:definitions>
9 changes: 9 additions & 0 deletions test/fixtures/xml/zeebe-versionTag.part.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<bpmn:process
id="process-1"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
>
<bpmn:extensionElements>
<zeebe:versionTag value="v1.0.0" />
</bpmn:extensionElements>
</bpmn:process>
34 changes: 33 additions & 1 deletion test/spec/xml/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@ describe('read', function() {

describe('zeebe:ExecutionListener', function() {


it('on Task', async function() {

// given
Expand Down Expand Up @@ -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'
}
]
}
});
});

});

});

});
19 changes: 14 additions & 5 deletions test/spec/xml/roundtrip.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var readFile = require('../../helper').readFile,
createModdle = require('../../helper').createModdle;



describe('import -> export roundtrip', function() {

function stripSpaces(xml) {
Expand Down Expand Up @@ -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'));

});

Expand All @@ -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'));

});

});
19 changes: 19 additions & 0 deletions test/spec/xml/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<zeebe:versionTag ' +
'xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" ' +
'value="v1.0.0" />';

// when
const xml = await write(moddleElement);

// then
expect(xml).to.eql(expectedXML);
});

});

});

0 comments on commit 8df1658

Please sign in to comment.