camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.5k stars 481 forks source link

Template applies to CallActivity is not displaying in BPMN Camunda Platform 8.0 #3000

Closed Cruiser79 closed 2 years ago

Cruiser79 commented 2 years ago

Describe the bug

If i use the following template example from the sample.json and create a BPMN Camunda Plaform 7 document it will show me the template chooser, if i create a task and switch it to CallActivity. If i do the same with a BPMN Camunda Platform 8 document, no template chooser is displayed.

[
  {
    "$schema": "https://unpkg.com/@camunda/element-templates-json-schema/resources/schema.json",
    "name": "Caller All IO",
    "id": "com.camunda.example.CallerAllIO",
    "appliesTo": [
      "bpmn:CallActivity"
    ],
    "properties": [
      {
        "label": "Called Process",
        "type": "String",
        "editable": false,
        "value": "calledProcess",
        "binding": {
          "type": "property",
          "name": "calledElement"
        }
      },
      {
        "label": "Input all",
        "type": "Hidden",
        "binding": {
          "type": "camunda:in",
          "variables": "all"
        }
      },
      {
        "label": "Output all",
        "type": "Hidden",
        "binding": {
          "type": "camunda:out",
          "variables": "all"
        }
      }
    ]
  }
]

Steps to reproduce

  1. Create a sample.json with the sourcode above
  2. Open Modeler 5.0.0
  3. Create a BPM Camunda Platform 8.0 document
  4. Create a task
  5. Switch task type to CallActivity

Expected behavior

The template chooser will be displayed

Environment

Additional context

No response

smbea commented 2 years ago

The problem doesn't seem to be the appliesTo type but with the validity of the JSON.

For Camunda Platform 8, the $schema should be "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json".

Also the binding of the input/output is invalid for Camunda Platform 8. Instead of camunda:in and camunda:out, you should use zeebe:input and zeebe:output. And the structure should be the following:

"binding": {
     "type": "zeebe:input",
     "name": "name"
 }

Please check the documentation under "Camunda Platform 8" for further information: https://docs.camunda.io/docs/components/modeler/desktop-modeler/element-templates/defining-templates/.

Feel free to re-open this if you are still experiencing issues.