How to create `camunda:class` when you create element templates?

index.js

{
  "name": "Mail_Task_2",
  "id": "com.camunda.example.MailTask_2",
  "createdBy": "sh529u",
  "users": [],
  "groups": [],
  "properties": [
    {
      "binding": {
        "name": "camunda:class",
        "type": "property"
      },
      "editable": false,
      "value": "com.mycompany.MailTaskImpl",
      "type": "String",
      "label": "Implementation Type"
    },
    {
      "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": "Send Async?",
      "type": "Boolean",
      "value": true,
      "binding": {
        "type": "property",
        "name": "camunda:asyncBefore"
      }
    }
  ],
  "appliesTo": [
    "bpmn:ServiceTask"
  ]
}

ERROR

org.camunda.bpm.engine.ProcessEngineException: ENGINE-09008 Exception while instantiating class 'com.mycompany.MailTaskImpl': ENGINE-09017 Cannot load class 'com.mycompany.MailTaskImpl': com.mycompany.MailTaskImpl
	at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionWhileInstantiatingClass(EngineUtilLogger.java:78)

Answer

This question is off-topic for this forum.

Please refer to the Camunda documentation or the Camunda Forum to get help on how to bundle your class with your process application / deployment.

Where u put the above code in Full coding…let me know i am newbie to this forum…

This question is off-topic in this forum, as you’re basically asking how to provide a Java class with an engine deployment.

As seen from the engine error, the class is configured correctly in element template camunda:class. However, the template does not magically package your classes with you; it just configures the BPMN 2.0 XML in a certain way.

Please refer to the Camunda documentation or the Camunda Forum to get help on how to bundle your class with your process application / deployment.