Home

Awesome

Want to try out modeling in domain-specific, reusable building blocks? Check out our demo.

Element Templates

The tool that powers declarative, domain specific modeling at bpmn.io.

About

Element templates allow you to define re-usable, domain specific building blocks to supported bpmn.io toolkits. Through a set of utilities they deeply integrate into the modeling experience.

Element Templates application demo

Features

Through a JSON document you define different aspects of a re-usable building block.

General Configuration

Property Configuration

Editor Integration

Through a set of utilities element templates get deeply integrated into our editor tooling.

Create/Append Anything

Provided through an extension.

Configuration

Provided through the properties panel and a template chooser component.

Upgrading/Migration/Replacement

Provided through the properties panel as well as an extension.

Templates come with two built-in ways of migration: Upgrading to a newer (compatible) version or deprecation (with the ability to display a custom message).

The user can trigger the actual upgrade/migration/replacement operation in two ways:

To learn more about element template evolution checkout the life-cycle documentation.

Basic Setup

The basic setup requires a BPMN modeler as well as properties panel and element template provider modules:

import BpmnModeler from 'bpmn-js/lib/Modeler';

import {
  BpmnPropertiesPanelModule,
  BpmnPropertiesProviderModule,
  ZeebePropertiesProviderModule,
  CloudElementTemplatesPropertiesProviderModule
} from 'bpmn-js-properties-panel';

It allows you to pass element templates to the modeler during instantiation via the elementTemplate configuration:

const elementTemplates = [ ... ];

const modeler = new BpmnModeler({
  container: '#canvas',
  additionalModules: [
    BpmnPropertiesPanelModule,
    BpmnPropertiesProviderModule,
    ZeebePropertiesProviderModule,
    CloudElementTemplatesPropertiesProviderModule
  ],
  elementTemplates
});

Checkout API for advanced use-cases driven via additional APIs.

Supported Toolkits

Right now element templates are supported in bpmn-js.

Creating an Element Template Provider

Refer to the create a provider guide.

Related Utilities