I follow this topic to add element template, but it’s not work. can you help me?
bpmnModeler = new BpmnModeler({
container: "#js-canvas",
propertiesPanel: {
parent: "#js-properties-panel",
},
additionalModules: [
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule,
CamundaPlatformPropertiesProviderModule,
camundaPlatformBehaviors,
magicPropertiesProviderModule,
],
moddleExtensions: {
camunda: camundaModdleDescriptors,
magic: magicModdleDescriptor,
},
elementTemplates: [
{
$schema:
"https://unpkg.com/@camunda/element-templates-json-schema/resources/schema.json",
name: "Mail Task",
id: "com.camunda.example.MailTask",
appliesTo: ["bpmn:ServiceTask"],
properties: [
{
label: "Implementation Type",
type: "String",
value: "com.mycompany.MailTaskImpl",
editable: false,
binding: {
type: "property",
name: "camunda:class",
},
},
{
label: "Sender",
type: "String",
binding: {
type: "camunda:inputParameter",
name: "sender",
},
constraints: {
notEmpty: true,
},
},
{
label: "Receivers",
type: "String",
binding: {
type: "camunda:inputParameter",
name: "receivers",
},
constraints: {
notEmpty: true,
},
},
{
label: "Template",
description:
"By the way, you can use freemarker templates ${...} here",
value: "Hello ${firstName}!",
type: "Text",
binding: {
type: "camunda:inputParameter",
name: "messageBody",
scriptFormat: "freemarker",
},
constraints: {
notEmpty: true,
},
},
{
label: "Result Status",
description:
"The process variable to which to assign the send result to",
type: "String",
value: "mailSendResult",
binding: {
type: "camunda:outputParameter",
source: "${ resultStatus }",
},
},
{
label: "Async before?",
type: "Boolean",
binding: {
type: "property",
name: "camunda:asyncBefore",
},
},
],
},
],
});
bpmnModeler.on("elementTemplates.errors", function (event) {
console.log("template load errors", event.errors);
});
bpmnModeler.createDiagram();