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(zeebe): add modelerTemplate and modelerTemplateVersion #20

Merged
merged 1 commit into from
Jan 25, 2022
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
21 changes: 21 additions & 0 deletions resources/zeebe.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
]
}
3 changes: 3 additions & 0 deletions test/fixtures/xml/task-modelerTemplate.part.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Task xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
zeebe:modelerTemplate="foo" />
4 changes: 4 additions & 0 deletions test/fixtures/xml/task-modelerTemplateVersion.part.bpmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Task xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:zeebe="http://camunda.org/schema/zeebe/1.0"
zeebe:modelerTemplate="foo"
zeebe:modelerTemplateVersion="1" />
49 changes: 49 additions & 0 deletions test/spec/xml/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
});

});

});

});

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

// 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 = '<zeebe:zeebeServiceTask ' +
'xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" ' +
'modelerTemplateVersion="12" />';

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

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

});

});