Hello,
currently the following code is executed by right-mouse-click.
bpmnModeler.on('element.contextmenu', (event) => {
event.originalEvent.preventDefault();
event.originalEvent.stopPropagation();
({ element } = event);
// ignore root element
if (!element.parent) {
return;
}
const businessObject = getBusinessObject(element);
const { bpmnType } = businessObject;
const { BusinessContext } = businessObject;
const { TaskName } = businessObject;
const { BusinessContext_Id } = businessObject;
const { TaskId } = businessObject;
if(bpmnType == "bpmn:SemanticTask") {
if(BusinessContext !== undefined) {
bc.text = BusinessContext;
bc.value = BusinessContext_Id;
ti.text = TaskName;
ti.value = TaskId;
}
ST.classList.remove('hidden');
}
});
formST.addEventListener('submit', (event) => {
event.preventDefault();
event.stopPropagation();
modeling.updateProperties(element, {
BusinessContext_Id: bc.value,
BusinessContext: bc.options[bc.selectedIndex].text,
TaskName: ti.options[ti.selectedIndex].text,
TaskId: ti.value
});
ST.classList.add('hidden');
});
Is it possible to run this code via the ContextPad? If possible, how can I do that?