Element Templates in the Camunda Modeler

  • Blog
  • >
  • Element Templates in the Camunda Modeler
TOPICS

30 Day Free Trial

Bring together legacy systems, RPA bots, microservices and more with Camunda

Join the Camunda Developer Newsletter

Get the latest events, release notes, and product updates straight to your mailbox.

TRENDING CONTENT

Element templates for BPMN diagrams is one of the exciting features shipped with the latest release of our Camunda Modeler.
They allow developers to extend the modeler with custom controls for certain BPMN elements.

A template, once selected for a diagram element, provides custom fields with domain specific validation of user input.


Camunda Modeler Element Templates Screenshot

Element Templates in a Nutshell

In essence, element templates define custom inputs, custom validation and a technical mapping for the entered data into the Camunda world.

Once selected from the properties panel they are offered to the user as Custom Fields.
Custom fields can be dropdowns, check boxes, input and text areas.
On input, the modeler applies domain specific validation and maps the input data to BPMN 2.0 XML and the world of the process engine.

Element Templates in Code

Element templates are read from JSON files situated in resources/element-templates relative to the modelers installation directory.

The example MailTask shown in the screenshot above may be defined like that:

[
  {
    "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:javaDelegate"
        }
      },
      ...
      {
        "label": "Template",
        "description": "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": "Process variable 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"
        }
      }
    ]
  }
]

The actual details on the template definition go beyond a simple blog post.
Consider checking out our in-depth element templates documentation or any of the other resources listed below.

More on Element Templates

Would you like to try out element templates?
These resources help you to learn more:

Feedback Wanted

Element templates add powerful options to extend the Camunda Modeler with pre-defined user, service tasks as well as other BPMN elements.

Do you find these extensions useful?
Is there anything you are missing?
We are happy to hear your feedback in the Camunda Modeler forum.

Try All Features of Camunda Platform

Related Content

What does your organization need to do to achieve Level 3 of the Process Orchestration Maturity Model? Learn how in the third post in our series on process orchestration maturity.
Conveying the business value of process orchestration is critical to ensuring it will be properly understood and adopted.
What does your organization need to do to achieve Level 2 of the Process Orchestration Maturity Model? The second blog post in our series on process orchestration maturity.