diff --git a/resources/zeebe.json b/resources/zeebe.json
index a99a53e..9974bf3 100644
--- a/resources/zeebe.json
+++ b/resources/zeebe.json
@@ -548,6 +548,52 @@
}
]
},
+ {
+ "name": "TaskListeners",
+ "superClass": [
+ "Element"
+ ],
+ "meta": {
+ "allowedIn": [
+ "bpmn:UserTask"
+ ]
+ },
+ "properties": [
+ {
+ "name": "listeners",
+ "type": "TaskListener",
+ "isMany": true
+ }
+ ]
+ },
+ {
+ "name": "TaskListener",
+ "superClass": [
+ "Element"
+ ],
+ "meta": {
+ "allowedIn": [
+ "zeebe:TaskListeners"
+ ]
+ },
+ "properties": [
+ {
+ "name": "eventType",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "retries",
+ "type": "String",
+ "isAttr": true
+ },
+ {
+ "name": "type",
+ "type": "String",
+ "isAttr": true
+ }
+ ]
+ },
{
"name": "VersionTag",
"superClass": [
diff --git a/test/fixtures/xml/userTask-zeebe-taskListener.part.bpmn b/test/fixtures/xml/userTask-zeebe-taskListener.part.bpmn
new file mode 100644
index 0000000..42504fe
--- /dev/null
+++ b/test/fixtures/xml/userTask-zeebe-taskListener.part.bpmn
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/test/fixtures/xml/zeebe-taskListeners.bpmn b/test/fixtures/xml/zeebe-taskListeners.bpmn
new file mode 100644
index 0000000..e33088a
--- /dev/null
+++ b/test/fixtures/xml/zeebe-taskListeners.bpmn
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/spec/xml/read.js b/test/spec/xml/read.js
index 5438d67..5971b45 100644
--- a/test/spec/xml/read.js
+++ b/test/spec/xml/read.js
@@ -1231,6 +1231,44 @@ describe('read', function() {
});
+
+ describe('zeebe:TaskListener', function() {
+
+ it('on UserTask', async function() {
+
+ // given
+ var xml = readFile('test/fixtures/xml/userTask-zeebe-taskListener.part.bpmn');
+
+ // when
+ const {
+ rootElement: task
+ } = await moddle.fromXML(xml, 'bpmn:UserTask');
+
+ // then
+ expect(task).to.jsonEqual({
+ $type: 'bpmn:UserTask',
+ id: 'task-1',
+ extensionElements: {
+ $type: 'bpmn:ExtensionElements',
+ values: [
+ {
+ $type: 'zeebe:TaskListeners',
+ listeners: [
+ {
+ $type: 'zeebe:TaskListener',
+ eventType: 'complete',
+ retries: '3',
+ type: 'complete_listener'
+ }
+ ]
+ }
+ ]
+ }
+ });
+ });
+
+ });
+
});
});
diff --git a/test/spec/xml/roundtrip.js b/test/spec/xml/roundtrip.js
index f4a79b4..8fc8a70 100644
--- a/test/spec/xml/roundtrip.js
+++ b/test/spec/xml/roundtrip.js
@@ -82,4 +82,11 @@ describe('import -> export roundtrip', function() {
});
+
+ describe('zeebe:TaskListeners', function() {
+
+ it('should keep zeebe:taskListeners', validateExport('test/fixtures/xml/zeebe-taskListeners.bpmn'));
+
+ });
+
});
diff --git a/test/spec/xml/write.js b/test/spec/xml/write.js
index 2181576..d550cee 100644
--- a/test/spec/xml/write.js
+++ b/test/spec/xml/write.js
@@ -686,6 +686,32 @@ describe('write', function() {
});
+
+ it('zeebe:TaskListeners', async function() {
+
+ // given
+ const moddleElement = moddle.create('zeebe:TaskListeners', {
+ listeners: [
+ moddle.create('zeebe:TaskListener', {
+ eventType: 'complete',
+ retries: '1',
+ type: 'complete_listener'
+ })
+ ]
+ });
+
+ const expectedXML = '' +
+ '' +
+ '';
+
+ // when
+ const xml = await write(moddleElement);
+
+ // then
+ expect(xml).to.eql(expectedXML);
+ });
+
});
});