Setting a class-based execution listener in element templates


recently I tried to create element templates for our most common use cases to speed up development of new workflows. Following the documentation this was pretty straight forward for most of my use cases. The only remaining ones were elements which attempt to set an execution listener automatically. Sadly, I was not able to figure out how to do this for class-based execution listener. I only found the option to configure the value as script as well as the scriptFormat.

What I need:

<camunda:executionListener class="" event="start" />

What I was able to achieve:

<camunda:executionListener event="start">
    <camunda:script scriptFormat="JavaScript">const someVariable;</camunda:script>

I appreciate any idea on this, because I would prefer to not refactor my execution listeners.

Kind regards

Hello again,

I just had some time to look into it in more detail myself.

I discovered that per json schema there is a parameter called “name” for property bindings. Also I was not able to find any restrictions on this parameter. So, in theory, I should be able to use following template to achieve my goal. (Obviously I shortened it for the sake of simplicity)

  "$schema": "",
  "name": "Name",
  "id": "id",
  "version": 1,
  "appliesTo": [
  "elementType": {
    "value": "bpmn:ServiceTask"
  "properties": [
      "label": "Implementation Type",
      "type": "Hidden",
      "value": "",
      "binding": {
        "type": "camunda:executionListener",
        "event": "start",
        "name": "class"

The result is the following:

<camunda:executionListener event="start" value=">

By debugging I now discovered there is only special handling for inline scripts. If that is not the case, as in my example, the value will always be set as “value” property. Thus, the configured “name” attribute for the binding is not respected.

Should I create an issue at bpmn-js or which repo would be the correct one? Also, I would be happy to contribute with a pull request for this issue if possible.

Kind regards

PS.: A good entry point for this issue is the editor action called “applyElementTemplate”.

I was able to identify the bpmn-io/bpmn-js-element-templates repo as responsible for the described behaviour and created an issue over there: Property bindings of type “camunda:executionListener” ignores name property · Issue #13.

In consequence this thread seems solved. A solution will be provided trough the github issue.

Kind regards

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.