camunda / camunda-modeler-custom-linter-rules-plugin

Add custom lint rules to the Camunda Modeler
8 stars 11 forks source link

This plugin adds lint rules to the built-in linting feature introduced in Camunda Modeler v5.0 and supporting plugins since v5.4.

To use this plugin with Camunda Modeler v5.2 and older check out the camunda-modeler-5-2 branch.

Custom Linter Rules Example Plugin

Compatible with Camunda Modeler version 5.4 and newer

This plug-in adds the bpmnlint recommended rules as well as custom made rules to the Camunda Desktop Modeler. Fork it to suit your needs.

Custom Linter rules in action in the Modeler

Configuring Rules

Use the local .bpmnlintrc file to configure active lint rules.

Checkout the bpmnlint documentation for more information regarding this file.

Creating Rules

This project ships with a bpmnlint extension with the custom namespace. Add or edit rules in the extension's rules directory. Activate the rules via the local .bpmnlintrc file, in order to use them, prefixed with the namespace:

{
  "extends": [
     "bpmnlint:recommended",
     "plugin:custom/recommended"
  ],
  "rules": {
    "custom/no-manual-task": "warn",
    "custom/your-other-rule": "error"
  }
}

Plug-in Discovery

The custom namespace used by the shipped bpmnlint extension is arbitrary, i.e. can be changed freely. However you'd need to take into account how the linting infrastructure discovers rules and configuration:

In the case of our custom plug-in custom/recommended reference the custom configuration, exported by our plug-ins entry point. The rule custom/no-manual-task on the other hand references plug-ins entry point.

Development

# initial setup
npm install

# rebuild in development mode
npm run dev

# build the plug-in
npm run all

To integrate with the Camunda Desktop Modeler move or link this plug-in into a folder under resources/plugins within the Modeler's plug-in search path. Reload the modeler to recognize plug-in changes.

Before you Publish

Additional Resources

Licence

MIT