Element-template - External task selection with dropdown topic

Hi,

I am trying to create an element template which selects “External” implementation and provide dropdown for selecting pre-defined topic. Below is the JSON, where it selects the External implementation but it also creates a customer Text field as external.

Can you get me an example for selecting “External” implementation and assigning values to the topic?

{
“name”: “External Task Template”,
“id”: “com.externalTaskTemplate”,
“appliesTo”: [
“bpmn:ServiceTask”
],
“properties”: [
{
“type”:“Text”,
“value”: “external”,
“binding”: {
“type”: “property”,
“name”: “camunda:type”
}
}
],
“entriesVisible”: {
“_all”: true,
“implementation”: true,
“externalTopic”: true
}
},

-Vishnu

Hi @vishnukumar_gr,

i guess you are looking for something like the following. The template sets the implementation type for a Service Task to external and in the Dropdown list you can select which topic you want to use:

{
  "name": "External Task Test",
  "id": "com.example.ExternalTaskTest",
  "appliesTo": [
    "bpmn:ServiceTask"
  ],
  "properties": [
    {
      "label": "Implementation Type",
      "type": "String",
      "value": "external",
      "editable": false,
      "binding": {
        "type": "property",
        "name": "camunda:type"
      }
    },
	{
	  "label": "Topic",
	  "type": "Dropdown",
	  "choices": [
	    { "name": "Topic 1", "value": "nameOfTopic1" },
		{ "name": "Topic 2", "value": "nameOfTopic2" }
	  ],
	  "binding": {
	    "type": "property",
		"name": "camunda:topic"
	  }
	}
  ]
}

Hope this helps

Regards
Michael

4 Likes

@MichiDahm im using camunda modeler(windows installer), i want to create element template. So i want to know where to place these template configurations.

My windows installation of modeler directory looks like:

image

Hi @aravindhrs

the Element Templates are .json-files. They need to be located in a specific directory inside the directory of the Modeler. Inside the folder “resources” you need to create a folder called “element-templates”. And inside this folder you have to place your template files.
E.g.: Your template “myTemplate.json” needs to be placed in:

$CamundaModelerHome\resources\element-templates\myTemplate.json

After adding new templates or changing existing ones you should restart the Modeler, so that it notices all changes correctly.

More information can be found here.

Regards
Michael