When creating the service task, you can directly define properties. The properties panel is designed to simply reflect the current XML state. So if you want to create an external service task with a predefined topic, you will have to do something like
function createServiceTask(event) {
const shape = elementFactory.createShape({
type: "bpmn:ServiceTask"
});
shape.businessObject["type"] = "external";
shape.businessObject["topic"] = "foo";
create.start(event, shape);
}
Source: custom palette provider (external service task) - CodeSandbox.
Note that you have to have the camunda-bpmn-moddle
extensions included.
import CamundaModdlePackage from "camunda-bpmn-moddle/resources/camunda";
const modeler = new Modeler({
// ...
moddleExtensions: {
camunda: CamundaModdlePackage
}
});