Element Templates

Element templates allow teams to define reusable configurations for BPMN elements. Once applied to a task or event, a template pre-fills its properties with curated defaults, reducing repetition and enforcing standards.

What Are Element Templates?

An element template is a JSON descriptor that maps a set of pre-configured properties to a specific BPMN element type. Examples include:

  • A “Send Email” Service Task pre-configured with connector type, input/output variables, and documentation
  • A “REST Call” connector template for external HTTP integrations
  • A company-specific “Approval Task” User Task with standard form and listeners

CIB seven Modeler loads its element templates from the modeler database, where the webclient keeps them in the mod_element_templates table.

Using an Element Template

  1. Select a BPMN element on the canvas (e.g., a Service Task)
  2. In the Properties Panel, click the Template section
  3. Browse the available templates and click one to preview its properties
  4. Click Apply to bind the template to the element

After applying, the element’s properties are populated from the template. Some fields may be editable, others locked per the template definition.

Template Sources

The webclient serves the templates stored in the modeler database at {basePath}/modeler/element-templates (by default /services/v1/modeler/element-templates); there is nothing to implement. Templates get into the database in three ways:

  • From files at startup — the files matched by cibseven.webclient.modeler.templates.paths, see Auto-Loading Templates from Files
  • Through the REST API — create, import, change and deactivate templates, see REST API
  • In the user interface (Enterprise Edition) — Manage templates on the modeler start page lists the templates and lets you add them, also from files, and edit, hide, show and export them, see Template Management

Only active templates are offered in the modeler; Manage templates calls them visible, and a hidden template is an inactive one.

Excluding Templates

excludeTemplates in the modeler section of the frontend config.json leaves templates out of the modeler without touching the database, for example the ones meant for another installation:

"modeler": {
  "excludeTemplates": ["com.example.legacy-task", "com.example.test-*", "Email"]
}

An entry matches a template by its id, exactly or with * at the start, at the end or at both: com.example.test-* matches every ID that starts with com.example.test-. An entry without * also matches the templates whose name starts with it followed by -, ignoring case: Email matches Email - Send. Entries that consist only of * are ignored. The list is empty by default.

Custom Templates

To provide organisation-specific element templates, write them in the Camunda 7 element templates format and add them in one of the ways above: put their JSON files where templates.paths points, import them through the REST API, or add them with Manage templates.

Template JSON Format

[
  {
    "id": "com.example.my-template",
    "name": "My Custom Task",
    "description": "Calls the internal approval service",
    "version": 1,
    "appliesTo": ["bpmn:ServiceTask"],
    "elementType": { "value": "bpmn:ServiceTask" },
    "properties": [
      {
        "label": "Service URL",
        "type": "String",
        "binding": { "type": "camunda:inputParameter", "name": "serviceUrl" }
      }
    ]
  }
]

Template Filtering

In the template browser you can:

  • Search by name or description
  • Filter by element type (service task, user task, etc.)
  • Preview the full property list before applying

Template Icons

A template can declare an icon that is displayed in two places:

  • Diagram canvas — the icon is rendered on the element itself, making it easy to identify templated elements at a glance
  • Template chooser modal — the icon appears next to the template name and id:version in the selection list

To add an icon, include an icon object in the template JSON:

{
  "id": "com.example.my-template",
  "name": "My Custom Task",
  "icon": {
    "contents": "data:image/svg+xml;base64,..."
  },
  ...
}

The contents field accepts a data URI (SVG or raster image encoded as base64).

Property Groups in Scopes

When a template uses a <camunda:Connector> or another scope, properties inside that scope can be organised into named sub-groups using the group field. The sub-group labels are taken from the template’s top-level groups definition.

{
  "groups": [
    { "id": "endpoint", "label": "Endpoint" },
    { "id": "auth",     "label": "Authentication" }
  ],
  "properties": [
    {
      "label": "URL",
      "group": "endpoint",
      "binding": { "type": "camunda:inputParameter", "name": "url" }
    },
    {
      "label": "Token",
      "group": "auth",
      "binding": { "type": "camunda:inputParameter", "name": "token" }
    }
  ]
}

Properties without a recognised group are displayed under the scope’s default label.

Auto-Loading Templates from Files

The backend can seed the element templates database at startup from JSON files on the classpath or filesystem. This is useful for bundling a standard set of templates with your deployment.

Configure one or more Spring Resource patterns under cibseven.webclient.modeler.templates.paths:

cibseven:
  webclient:
    modeler:
      templates:
        paths:
          - classpath:/element-templates/*.json
          - file:/opt/cibseven/templates/*.json

On startup, every JSON file matched by these patterns is read and its templates are upserted into the database — existing templates with the same ID are updated, new ones are inserted. A file holds one template or an array of them. Requires cibseven.webclient.modeler.enabled: true.

Because the files are read at every start, they win: a template changed or hidden through the REST API or Manage templates is stored from its file again at the next start, and a hidden one is offered again. To change such a template for good, change its file.

The tables may not exist yet when the webclient starts, for instance while the engine is still creating its schema. The loader then tries again: cibseven.webclient.modeler.templates.schemaReadyMaxAttempts times (default 30), waiting cibseven.webclient.modeler.templates.schemaReadyRetryDelayMs milliseconds (default 2000) between attempts, before it gives up and logs an error.

On this Page: