use xml element body rather than attribute for business rule task since that is more conventional

This commit is contained in:
burnettk 2022-08-22 18:31:35 -04:00
parent c73cff8a63
commit 9afa58257f
5 changed files with 19 additions and 5 deletions

View File

@ -12,7 +12,7 @@ const SPIFF_PROP = "spiffworkflow:calledDecision"
*
<bpmn:businessRuleTask id="Activity_0t218za">
<bpmn:extensionElements>
<spiffworkflow:calledDecision decisionId="my_id" />
<spiffworkflow:calledDecision>my_id</spiffworkflow:calledDecision>
</bpmn:extensionElements>
</bpmn:businessRuleTask>
*

View File

@ -32,7 +32,7 @@
"properties": [
{
"name": "decisionId",
"isAttr": true,
"isBody": true,
"type": "String"
}
]

5
package-lock.json generated
View File

@ -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",

View File

@ -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');
});
});

View File

@ -65,7 +65,7 @@
<bpmn:sequenceFlow id="Flow_1lu1qyz" sourceRef="business_rule_task" targetRef="Event_14wzv4j" />
<bpmn:businessRuleTask id="business_rule_task">
<bpmn:extensionElements>
<spiffworkflow:calledDecision decisionId="test_decision" />
<spiffworkflow:calledDecision>test_decision</spiffworkflow:calledDecision>
</bpmn:extensionElements>
<bpmn:incoming>Flow_132laxn</bpmn:incoming>
<bpmn:outgoing>Flow_1lu1qyz</bpmn:outgoing>