Checkbox in a Camunda 8 connector template

It should appear as an input variable? If checked then it is true, if not checked then it is false?

In this case you want an input mapping (zeebe:input), because that is what will bind to a variable at run-time. However binding zeebe:input to Boolean / checkbox is currently not supported (Support Boolean conditions in templates · Issue #768 · bpmn-io/bpmn-js-properties-panel · GitHub).

Cf.

{
  "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
  "name": "BooleanBindingTemplate",
  "id": "boolean-binding-template",
  "version": 1,
  "description": "Configure boolean value for input binding",
  "category": {
    "id": "connectors",
    "name": "Connectors"
  },
  "appliesTo": [
    "bpmn:Task"
  ],
  "elementType": {
    "value": "bpmn:ServiceTask"
  },
  "properties": [
    {
      "type": "Boolean",
      "value": "= true",
      "binding": {
        "type": "zeebe:input",
        "name": "someVariable"
      }
    }
  ]
}

To validate the direction we’d like to pursue as we pick up this topic:

  • We want to allow you to bind any value if the user checked the box and provide no binding if they did not.
  • That allows us to support a large amount of use cases, including but not limited to binding basic boolean (true or not defined), expressions (set discountedPrice to = 0.9*price if discount is desired), but also static values (SOME_STATIC_STRING).
1 Like