Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates located in .camunda/element-templates directory are not listed #2012

Closed
szerie opened this issue Nov 12, 2020 · 1 comment · Fixed by #2015
Closed

Templates located in .camunda/element-templates directory are not listed #2012

szerie opened this issue Nov 12, 2020 · 1 comment · Fixed by #2015
Assignees
Labels
bug Something isn't working element templates
Milestone

Comments

@szerie
Copy link

szerie commented Nov 12, 2020

Describe the Bug

According to documentation (available at: https://github.com/camunda/camunda-modeler/tree/master/docs/element-templates):

Store element templates as .json file in the resources/element-templates folder, relative to the modelers executable or relative to the modelers data directory (see below). Alternatively, they can be stored in a .camunda/element-templates directory that resides, relative to the currently opened diagram, anywhere in the diagrams path hierarchy.

Unfortunately Camunda Modeler version 4.4.0 is displaying templates only from location: \resources\element-templates
CamundaModeler44OpenTemplate

If templates are located only in .camunda/element-templates then no template is available:
CamundaModeler44OpenTemplate2

But if templates will be located in both directories then logs contains templates conflicts so in this case modeler is loading templates from both location. For example:

[C:\Camunda\bugTest1.bpmn] template id <TestTask> already used
    at e.exports._logError (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:284:12)
    at _logError (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:107:18)
    at _validateTemplate (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:71:19)
    at Array.forEach (<anonymous>)
    at forEach (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/Validator.js:56:16)
    at addAll (webpack:///node_modules/bpmn-js-properties-panel/lib/provider/camunda/element-templates/ElementTemplatesLoader.js:74:34)
    at setTemplates (webpack:///src/app/tabs/bpmn/BpmnEditor.js:202:20)
    at async (webpack:///src/app/tabs/bpmn/BpmnEditor.js:135:4) [ error ]

Steps to Reproduce

  1. Insert any template to .camunda\element-templates location.
  2. Run Camunda Modeler 4.4.0, and create task with appropriate type (so the applicable template was created in previous step).
  3. Click "Open Catalog" to list templates - no template is visible.
  4. Copy .json file with template to resources\element-templates location.
  5. Click "Open Catalog" to list templates - template will be visible. Apply it on the task.
  6. Save the diagram and close Camunda Modeler.
  7. Open Camunda Modeler again and load previously saved .bpmn diagram.
  8. Observe logs containing errors caused by templates conflicts.

Expected Behavior

Camunda Modeler should always use declared templates locations. Templates located in .camunda\element-templates should be visible on the list displayed after "Open Catalog" button click.

Environment

  • OS: Windows 10
  • Camunda Modeler Version: 4.4.0
@szerie szerie added the bug Something isn't working label Nov 12, 2020
@nikku
Copy link
Member

nikku commented Nov 12, 2020

Thanks for your comprehensive bug report. This should continue to work in v4.4.0+. We'll investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working element templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants