Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support zeebe:VersionTag #60

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to [zeebe-bpmn-moddle](https://github.com/camunda/zeebe-bpmn

___Note:__ Yet to be released changes appear here._

## 1.3.0

* `FEAT`: support `zeebe:VersionTag` ([#60](https://github.com/camunda/zeebe-bpmn-moddle/pull/60))

## 1.2.0

* `FEAT`: support: `zeebe:ExecutionListener` ([#57](https://github.com/camunda/zeebe-bpmn-moddle/pull/57))
Expand Down
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);
});

});

});
Loading