As I have understood, when using the bpmn-js modeler, the events contain elements that among other things, refer to an underlying businessObThis text will be hiddenject structure. Yet this isn’t intended to be interacted with directly, but through the modeler. Changing root properties works, but how about categories of properties? Specifically, in a ‘bpmn:SequenceFlow’ element, I would like to give it a ‘conditionExpression’ and set the ‘conditionExpression:body’ property programatically. How would I go about doing this?
This appears to fail due to conditionExpression being undefined:
var modeling = bpmnModeler.get('modeling');
bpmnModeler.on('selection.changed',e => {
if (e.newSelection && e.newSelection.length === 1) {
var element = e.newSelection[0];
if (element.businessObject.$type === 'bpmn:SequenceFlow') {
modeling.updateProperties(element, {
'conditionExpression:type': 'bpmn:FormalExpression'
});
}
}
});
Preferably I would want to check what the source element is also, but that’s a different question