From 9afa58257faa37e9c90ddebf066049b250d1a451 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 22 Aug 2022 18:31:35 -0400 Subject: [PATCH] use xml element body rather than attribute for business rule task since that is more conventional --- .../propertiesPanel/SpiffExtensionCalledDecision.js | 2 +- app/spiffworkflow/moddle/spiffworkflow.json | 2 +- package-lock.json | 5 +++-- test/spec/BusinessRulePropsSpec.js | 13 +++++++++++++ test/spec/bpmn/diagram.bpmn | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/spiffworkflow/extensions/propertiesPanel/SpiffExtensionCalledDecision.js b/app/spiffworkflow/extensions/propertiesPanel/SpiffExtensionCalledDecision.js index 7c7096e..d82e357 100644 --- a/app/spiffworkflow/extensions/propertiesPanel/SpiffExtensionCalledDecision.js +++ b/app/spiffworkflow/extensions/propertiesPanel/SpiffExtensionCalledDecision.js @@ -12,7 +12,7 @@ const SPIFF_PROP = "spiffworkflow:calledDecision" * - + my_id * diff --git a/app/spiffworkflow/moddle/spiffworkflow.json b/app/spiffworkflow/moddle/spiffworkflow.json index 449faf5..9110d2d 100644 --- a/app/spiffworkflow/moddle/spiffworkflow.json +++ b/app/spiffworkflow/moddle/spiffworkflow.json @@ -32,7 +32,7 @@ "properties": [ { "name": "decisionId", - "isAttr": true, + "isBody": true, "type": "String" } ] diff --git a/package-lock.json b/package-lock.json index f104ae6..0cdc289 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "bpmn-js-spiffworkflow", - "version": "0.0.7", + "version": "0.0.8", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.0.7", + "name": "bpmn-js-spiffworkflow", + "version": "0.0.8", "license": "MIT", "dependencies": { "bpmn-js": "^9.2.2", diff --git a/test/spec/BusinessRulePropsSpec.js b/test/spec/BusinessRulePropsSpec.js index 246fc38..79b6009 100644 --- a/test/spec/BusinessRulePropsSpec.js +++ b/test/spec/BusinessRulePropsSpec.js @@ -54,4 +54,17 @@ describe('Business Rule Properties Panel', function() { expect(element.decisionId).to.equal('wonderful'); }); + it('should load up the xml and the value for the called decision should match the xml', async function() { + const businessRuleTask = await expectSelected('business_rule_task'); + let entry = findEntry('extension_called_decision', getPropertiesPanel()); + const textInput = domQuery('input', entry); + expect(textInput.value).to.equal('test_decision'); + + // THEN - the script tag in the BPMN Business object / XML is updated as well. + let businessObject = getBusinessObject(businessRuleTask); + expect(businessObject.extensionElements).to.exist; + let element = businessObject.extensionElements.values[0]; + expect(element.decisionId).to.equal('test_decision'); + }); + }); diff --git a/test/spec/bpmn/diagram.bpmn b/test/spec/bpmn/diagram.bpmn index 03d0df5..22d416a 100644 --- a/test/spec/bpmn/diagram.bpmn +++ b/test/spec/bpmn/diagram.bpmn @@ -65,7 +65,7 @@ - + test_decision Flow_132laxn Flow_1lu1qyz