Overriding existing input in Camunda Modeler using Template Elements

I’d appreciate if someone told me how can I override existing input. I have to replace text field (Service Task -> Implementation -> Delegate Expression) with select input. I’ve been searching here: https://github.com/camunda/camunda-modeler/tree/master/docs/element-templates

Regards.

Guys, can you help mi with this?

Hi,

you could create a template for a DelegateServiceTask, bind the “Select Input” to the delegateExpression and hide the implementation.

{
    "name": "Delegate Task",
    "id": "com.camunda.example.DelegateTask",
    "appliesTo": [
      "bpmn:ServiceTask"
    ],
    "properties": [
      {
        "label": "Select Input",
        "type": "String",
        "binding": {
          "type": "property",
          "name": "camunda:delegateExpression"
        }
      }
     ],
     "entriesVisible": {
      "_all": true,
      "implementation": false
        }
}

regards,
Dominik

Sorry - I understood you completely wrong.

With Element templates you could do the following:

{
    "name": "Delegate Task",
    "id": "com.camunda.example.DelegateTask",
    "appliesTo": [
      "bpmn:ServiceTask"
    ],
    "properties": [
    {
        "label": "Delegate Expression",
        "type": "Dropdown",
        "value": "",
        "choices": [
          { "name": "Delegate1", "value": "${someExpression1}" },
          { "name": "Delegate2", "value": "${someExpression2}" },
          { "name": "Delegate3", "value": "${someExpression3}" }
        ],
        "binding": {
          "type": "property",
          "name": "camunda:delegateExpression"
        }
      }
     ],
     "entriesVisible": {
      "_all": true,
      "implementation": false,
      "delegate":false
    }
  }

You can’t touch the “normal” behavior of the delegateExpression Input with element templates. If this is the only way to implement a ServiceTask for you, you could set it to default by adding “isDefault”: true

{
    "name": "Delegate Task",
    "id": "com.camunda.example.DelegateTask",
    "isDefault": true,
    "appliesTo": [
      "bpmn:ServiceTask"
    ],
    "properties": [
    {
        "label": "Delegate Expression",
        "type": "Dropdown",
        "value": "50",
        "choices": [
          { "name": "Delegate1", "value": "${someExpression1}" },
          { "name": "Delegate2", "value": "${someExpression2}" },
          { "name": "Delegate3", "value": "${someExpression3}" }
        ],
        "binding": {
          "type": "property",
          "name": "camunda:delegateExpression"
        }
      }
     ],
     "entriesVisible": {
      "_all": true,
      "implementation": false,
      "delegate":false
    }

Is that what you are looking for?

1 Like

This is exactly I was looking for. Thanks!

you are welcome :slight_smile: