Element Templates in the Camunda Modeler

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

30 Day Free Trial

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

Sign Up for Camunda Content

Get the latest on Camunda features, events, top trends, and more.

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

Related Content

See how Funding Societies is taking advantage of process orchestration to automate their lending process, greatly improving outcomes for their customers.
Process blueprints can now be found on Camunda marketplace! Read on to learn how they can help you and how you can contribute.
Achieve operational superiority with the intelligent backbone of service orchestration. Learn how and why you should orchestrate your services.