I develop my project from the extension property panel demo project, and I want to update an extension property into extension elements, it works fine on control, but it isn’t be updated into the xml, please someone make any suggesions here. Thanks
const getValue = () => {
var businessObject = getBusinessObject(element);
const extensionElements = businessObject.extensionElements || moddle.create('bpmn:ExtensionElements');
if (extensionElements) {
var gbsElement = extensionElements.groupBehaviours;
if (gbsElement) {
var priority = gbsElement.priority;
return priority;
}
else
return '';
}
else
return '';
}
const setValue = value => {
var businessObject = getBusinessObject(element);
const extensionElements = businessObject.extensionElements || moddle.create('bpmn:ExtensionElements');
var gbsElement = extensionElements.groupBehaviours;
if (!gbsElement) {
gbsElement = moddle.create('sfgb:GroupBehaviours');
extensionElements.groupBehaviours = gbsElement;
}
if (gbsElement) gbsElement.priority = value;
//update condition properties
return modeling.updateProperties(element, {
extensionElements
});
}
The descriptor file is below:
{
"name": "Transition",
"prefix": "sfgb",
"uri": "http://www.bpmnio.net/schema/sfgb",
"xml": {
"tagAlias": "lowerCase"
},
"associations": [],
"types": [
{
"name": "Transition Property",
"extends": [
"bpmn:SequenceFlow"
]
},
{
"name": "GroupBehaviours",
"properties": [
{
"name": "priority",
"isAttr": true,
"type": "String"
}
]
}
]
}
The xml content what I expected is here, the priority property should be saved into it:
<bpmn2:sequenceFlow id="Flow_196cbl1" name="days>=10" sourceRef="Gateway_1iahdo9" targetRef="Activity_1o2nyb1">
<bpmn2:extensionElements>
<sfgb:groupBehaviours priority="-1" />
</bpmn2:extensionElements>
<bpmn2:conditionExpression>days>=10</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>