Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// ensure zeebe:calledElement
let calledElement = getCalledElement(businessObject);
if (!calledElement) {
calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ calledElement ],
[]
));
}
// update properties
commands.push(cmdHelper.updateBusinessObject(element, calledElement, values));
return commands;
}
// create taskDefinition
let taskDefinition = getTaskDefinition(element);
if (!taskDefinition) {
taskDefinition = elementHelper.createElement('zeebe:TaskDefinition', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ taskDefinition ],
[]
));
}
commands.push(cmdHelper.updateBusinessObject(element, taskDefinition, values));
return commands;
}
function setProperties(element, values) {
const businessObject = getBusinessObject(element),
commands = [];
// ensure extensionElements
let extensionElements = businessObject.get('extensionElements');
if (!extensionElements) {
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, businessObject, bpmnFactory);
commands.push(cmdHelper.updateBusinessObject(element, businessObject, { extensionElements: extensionElements }));
}
// ensure zeebe:calledElement
let calledElement = getCalledElement(businessObject);
if (!calledElement) {
calledElement = elementHelper.createElement('zeebe:CalledElement', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ calledElement ],
[]
));
}
function setProperties(element, values) {
const loopCharacteristics = getLoopCharacteristics(element),
commands = [];
// ensure extensionElements
let extensionElements = loopCharacteristics.get('extensionElements');
if (!extensionElements) {
extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, loopCharacteristics, bpmnFactory);
commands.push(cmdHelper.updateBusinessObject(element, loopCharacteristics, { extensionElements: extensionElements }));
}
// ensure zeebe:LoopCharacteristics
let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
if (!zeebeLoopCharacteristics) {
zeebeLoopCharacteristics = elementHelper.createElement('zeebe:LoopCharacteristics', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ zeebeLoopCharacteristics ],
[]
));
}
// ensure zeebe:LoopCharacteristics
let zeebeLoopCharacteristics = getZeebeLoopCharacteristics(loopCharacteristics);
if (!zeebeLoopCharacteristics) {
zeebeLoopCharacteristics = elementHelper.createElement('zeebe:LoopCharacteristics', { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ zeebeLoopCharacteristics ],
[]
));
}
commands.push(cmdHelper.updateBusinessObject(element, zeebeLoopCharacteristics, values));
return commands;
}
createParent: function(element, bo) {
const parent = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
const cmd = cmdHelper.updateBusinessObject(element, bo, { extensionElements: parent });
return {
cmd: cmd,
parent: parent
};
}
});
let extensionElement = getExtensionElement(reference);
if (!extensionElement) {
extensionElement = elementHelper.createElement(extensionElementKey, { }, extensionElements, bpmnFactory);
commands.push(cmdHelper.addAndRemoveElementsFromList(
element,
extensionElements,
'values',
'extensionElements',
[ extensionElement ],
[]
));
}
commands.push(cmdHelper.updateBusinessObject(element, extensionElement, values));
return commands;
},
set: function(element, values) {
const type = getTimerDefinitionType(timerEventDefinition);
const definition = type && timerEventDefinition.get(type);
if (definition) {
return cmdHelper.updateBusinessObject(element, definition, {
body: values.timerDefinition || undefined
});
}
},