Skip to content

Commit

Permalink
feat: support zeebe:priority
Browse files Browse the repository at this point in the history
Closes #62
  • Loading branch information
Skaiir committed Aug 4, 2024
1 parent d403352 commit dff4c92
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
18 changes: 18 additions & 0 deletions resources/zeebe.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,24 @@
}
]
},
{
"name": "Priority",
"superClass": [
"Element"
],
"meta": {
"allowedIn": [
"bpmn:UserTask"
]
},
"properties": [
{
"name": "value",
"type": "String",
"isAttr": true
}
]
},
{
"name": "TaskSchedule",
"superClass": [
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/xml/userTask-zeebe-priority.part.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<bpmn:userTask
id="user-task-1"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
>
<bpmn:extensionElements>
<zeebe:priority value="75" />
</bpmn:extensionElements>
</bpmn:userTask>
31 changes: 31 additions & 0 deletions test/spec/xml/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,37 @@ describe('read', function() {
});


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

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

// given
var xml = readFile('test/fixtures/xml/userTask-zeebe-priority.part.bpmn');

// when
const {
rootElement: task
} = await moddle.fromXML(xml, 'bpmn:UserTask');

// then
expect(task).to.jsonEqual({
$type: 'bpmn:UserTask',
id: 'user-task-1',
extensionElements: {
$type: 'bpmn:ExtensionElements',
values: [
{
$type: 'zeebe:Priority',
value: '75'
}
]
}
});
});

});


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

it('on UserTask', async function() {
Expand Down
20 changes: 20 additions & 0 deletions test/spec/xml/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,26 @@ describe('write', function() {
});


it('zeebe:Priority', async function() {

// given
var priority = moddle.create('zeebe:Priority', {
value: '100'
});

var expectedXML = '<zeebe:priority ' +
'xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" ' +
'value="100" />';

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

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

});


it('zeebe:TaskSchedule', async function() {

// given
Expand Down

0 comments on commit dff4c92

Please sign in to comment.