From ffc1d6d0d4d664b6576291afc9b510460548cf3f Mon Sep 17 00:00:00 2001 From: Valentin Serra Date: Wed, 19 Jan 2022 12:12:01 +0100 Subject: [PATCH] fix: adjusted DataAssociation model to match spec Revert "fix: adjusted DataAssociation model to match spec" This reverts commit e2f16be694dcc7c6aedb54c4cefab8c574c381d5. squash --- resources/bpmn/json/bpmn.json | 5 ++++ tasks/transforms/transformBPMN.js | 27 ++++++++++--------- ...tch-event-dataOutputAssociations.part.bpmn | 2 +- ...hrow-event-dataInputAssociations.part.bpmn | 2 +- test/spec/xml/read.js | 4 +-- 5 files changed, 24 insertions(+), 16 deletions(-) diff --git a/resources/bpmn/json/bpmn.json b/resources/bpmn/json/bpmn.json index 841fa3d..81bc917 100644 --- a/resources/bpmn/json/bpmn.json +++ b/resources/bpmn/json/bpmn.json @@ -945,6 +945,11 @@ "BaseElement" ], "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, { "name": "sourceRef", "type": "ItemAwareElement", diff --git a/tasks/transforms/transformBPMN.js b/tasks/transforms/transformBPMN.js index 1205dda..50fd6d7 100644 --- a/tasks/transforms/transformBPMN.js +++ b/tasks/transforms/transformBPMN.js @@ -140,16 +140,26 @@ module.exports = async function(results) { model ); + findProperty('DataAssociation#transformation', model).xml = { + serialize: 'property' + }; + + const dataAssociation = findType('DataAssociation', model); + + dataAssociation.properties.push({ + name: 'name', + isAttr: true, + type: 'String' + }); + model = orderProperties('DataAssociation', [ + 'name', 'sourceRef', 'targetRef', - 'transformation' + 'transformation', + 'assignment' ], model); - findProperty('DataAssociation#transformation', model).xml = { - serialize: 'property' - }; - findType('Choreography', model).superClass = [ 'Collaboration', 'FlowElementsContainer' ]; model = orderProperties('Activity', [ @@ -166,13 +176,6 @@ module.exports = async function(results) { 'loopCharacteristics' ], model); - model = orderProperties('DataAssociation', [ - 'sourceRef', - 'targetRef', - 'transformation', - 'assignment' - ], model); - findProperty('CallableElement#supportedInterfaceRefs', model).name = 'supportedInterfaceRef'; findProperty('Participant#interfaceRefs', model).name = 'interfaceRef'; diff --git a/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn b/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn index 083e7e6..073f9c3 100644 --- a/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn +++ b/test/fixtures/bpmn/catch-event-dataOutputAssociations.part.bpmn @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn b/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn index b6f294b..e85a2a3 100644 --- a/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn +++ b/test/fixtures/bpmn/throw-event-dataInputAssociations.part.bpmn @@ -1,5 +1,5 @@ - + diff --git a/test/spec/xml/read.js b/test/spec/xml/read.js index 5a562fa..63ed202 100644 --- a/test/spec/xml/read.js +++ b/test/spec/xml/read.js @@ -217,7 +217,7 @@ describe('bpmn-moddle - read', function() { id: 'EndEvent_1', dataInputAssociations: [ - { $type: 'bpmn:DataInputAssociation', id: 'DataInputAssociation_1' } + { $type: 'bpmn:DataInputAssociation', id: 'DataInputAssociation_1', name: 'DataInputAssociation_1n' } ] }; @@ -240,7 +240,7 @@ describe('bpmn-moddle - read', function() { id: 'StartEvent_1', dataOutputAssociations: [ - { $type: 'bpmn:DataOutputAssociation', id: 'DataOutputAssociation_1' } + { $type: 'bpmn:DataOutputAssociation', id: 'DataOutputAssociation_1', name: 'DataOutputAssociation_1n' } ] };