diff --git a/resources/zeebe.json b/resources/zeebe.json
index 9216911..f368c3d 100644
--- a/resources/zeebe.json
+++ b/resources/zeebe.json
@@ -292,9 +292,26 @@
"name": "formId",
"type": "String",
"isAttr": true
+ },
+ {
+ "name": "externalReference",
+ "type": "String",
+ "isAttr": true
}
]
},
+ {
+ "name": "UserTask",
+ "superClass": [
+ "Element"
+ ],
+ "meta": {
+ "allowedIn": [
+ "bpmn:UserTask"
+ ]
+ },
+ "properties": []
+ },
{
"name": "CalledDecision",
"superClass": [
diff --git a/test/fixtures/xml/userTask-zeebe-formDefinition-externalReference.part.bpmn b/test/fixtures/xml/userTask-zeebe-formDefinition-externalReference.part.bpmn
new file mode 100644
index 0000000..522fe61
--- /dev/null
+++ b/test/fixtures/xml/userTask-zeebe-formDefinition-externalReference.part.bpmn
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/fixtures/xml/userTask-zeebe-formDefinition.bpmn b/test/fixtures/xml/userTask-zeebe-formDefinition.bpmn
new file mode 100644
index 0000000..34efb66
--- /dev/null
+++ b/test/fixtures/xml/userTask-zeebe-formDefinition.bpmn
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/fixtures/xml/userTask-zeebe-userTask.part.bpmn b/test/fixtures/xml/userTask-zeebe-userTask.part.bpmn
new file mode 100644
index 0000000..74ea34b
--- /dev/null
+++ b/test/fixtures/xml/userTask-zeebe-userTask.part.bpmn
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/test/spec/xml/read.js b/test/spec/xml/read.js
index 167f054..c50bcba 100644
--- a/test/spec/xml/read.js
+++ b/test/spec/xml/read.js
@@ -582,11 +582,66 @@ describe('read', function() {
});
});
+
+ it('zeebe:externalReference', async function() {
+
+ // given
+ var xml = readFile('test/fixtures/xml/userTask-zeebe-formDefinition-externalReference.part.bpmn');
+
+ // when
+ const {
+ rootElement: proc
+ } = await moddle.fromXML(xml, 'bpmn:UserTask');
+
+ // then
+ expect(proc).to.jsonEqual({
+ $type: 'bpmn:UserTask',
+ id: 'user-task-1',
+ extensionElements: {
+ $type: 'bpmn:ExtensionElements',
+ values: [
+ {
+ $type: 'zeebe:FormDefinition',
+ externalReference: 'form-1'
+ }
+ ]
+ }
+ });
+ });
});
});
+ describe('zeebe:userTask', function() {
+
+ it('should read', async function() {
+
+ // given
+ var xml = readFile('test/fixtures/xml/userTask-zeebe-userTask.part.bpmn');
+
+ // when
+ const {
+ rootElement: proc
+ } = await moddle.fromXML(xml, 'bpmn:UserTask');
+
+ // then
+ expect(proc).to.jsonEqual({
+ $type: 'bpmn:UserTask',
+ id: 'user-task-1',
+ extensionElements: {
+ $type: 'bpmn:ExtensionElements',
+ values: [
+ {
+ $type: 'zeebe:UserTask'
+ }
+ ]
+ }
+ });
+ });
+ });
+
+
describe('zeebe:calledDecision', function() {
it('on BusinessRuleTask', async function() {
diff --git a/test/spec/xml/roundtrip.js b/test/spec/xml/roundtrip.js
index 81cea6f..04583b8 100644
--- a/test/spec/xml/roundtrip.js
+++ b/test/spec/xml/roundtrip.js
@@ -54,4 +54,10 @@ describe('import -> export roundtrip', function() {
it('should keep zeebe:modelerTemplate', validateExport('test/fixtures/xml/rootElement.bpmn'));
+
+
+ describe('userTask', function() {
+
+ it('should keep zeebe:formDefinition properties', validateExport('test/fixtures/xml/userTask-zeebe-formDefinition.bpmn'));
+ });
});
diff --git a/test/spec/xml/write.js b/test/spec/xml/write.js
index 1994180..c0c6d89 100644
--- a/test/spec/xml/write.js
+++ b/test/spec/xml/write.js
@@ -281,6 +281,50 @@ describe('write', function() {
expect(xml).to.eql(expectedXML);
});
+
+ it('zeebe:externalReference', async function() {
+
+ // given
+ var proc = moddle.create('bpmn:UserTask', {
+ extensionElements: moddle.create('bpmn:ExtensionElements', {
+ values: [
+ moddle.create('zeebe:FormDefinition', {
+ externalReference: 'form-1'
+ })
+ ]
+ })
+ });
+
+ var expectedXML =
+ '' +
+ '' +
+ '' +
+ '' +
+ '';
+
+ // when
+ const xml = await write(proc);
+
+ // then
+ expect(xml).to.eql(expectedXML);
+ });
+ });
+
+
+ it('zeebe:userTask', async function() {
+
+ // given
+ var userTask = moddle.create('zeebe:UserTask', {});
+
+ var expectedXML = '';
+
+ // when
+ const xml = await write(userTask);
+
+ // then
+ expect(xml).to.eql(expectedXML);
});