fixing a bug in SpiffScript Group

This commit is contained in:
Dan 2022-11-02 12:40:47 -04:00
parent 7b4ca1919b
commit e12e27ed5f
1 changed files with 4 additions and 2 deletions

View File

@ -103,8 +103,10 @@ function getScriptObject(element, scriptType) {
}
function updateScript(commandStack, moddle, element, scriptType, newValue) {
console.log(`Update ${scriptType} to ${newValue}`);
const { businessObject } = element;
let scriptObj = getScriptObject(element, scriptType);
console.log("Script Object", scriptObj)
// Create the script object if needed.
if (!scriptObj) {
scriptObj = moddle.create(scriptType);
@ -113,7 +115,7 @@ function updateScript(commandStack, moddle, element, scriptType, newValue) {
if (!extensionElements) {
extensionElements = moddle.create('bpmn:ExtensionElements');
}
scriptObj.script = newValue;
scriptObj.value = newValue;
extensionElements.get('values').push(scriptObj);
commandStack.execute('element.updateModdleProperties', {
element,
@ -128,7 +130,7 @@ function updateScript(commandStack, moddle, element, scriptType, newValue) {
element,
moddleElement: scriptObj,
properties: {
script: newValue,
value: newValue,
},
});
}