I have succeeded in creating a custom element + model extension by following the info here:
I’ve created an extension with a property like:
properties: [
{
name: "exampleString",
isAttr: true,
type: "String"
}
]
and I am able to update this custom property when left clicking on this element with the use of the following function:
initializeListener = () => {
this.modeler.on("element.contextmenu", 1200, event => {
event.originalEvent.preventDefault();
event.originalEvent.stopPropagation();
const { element } = event;
if (element.type === "bpmn:ServiceTask") {
const modeling = this.modeler.get("modeling");
modeling.updateProperties(element, {
exampleString: "hello world"
});
console.log("custom string added");
}
});
};
My question is, how to I gain the ability to inject a complex object or some expression?
Do I use a “field” in some way?
Documentation seems sparse in this area, so thank you very much for your help.