Skip to content

Commit

Permalink
feat: support task listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
misiekhardcore committed Nov 18, 2024
1 parent 32f932c commit bc93919
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 74 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to [@camunda/linting](https://github.com/camunda/linting) ar

___Note:__ Yet to be released changes appear here._

* `FEAT`: support for task listeners ([#123](https://github.com/camunda/linting/pull/123))
* `DEPS`: update to `bpmnlint-plugin-camunda-compat@2.28.0`
* `DEPS`: update to `zeebe-bpmn-moddle@1.7.0`

## 3.28.0

* `FEAT`: add `zeebe-user-task` rule ([camunda/bpmnlint-plugin-camunda-compat#179](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/179))
Expand Down
78 changes: 44 additions & 34 deletions lib/compiled-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const rules = {
"camunda-compat/no-propagate-all-parent-variables": "error",
"camunda-compat/no-signal-event-sub-process": "error",
"camunda-compat/no-task-schedule": "error",
"camunda-compat/no-task-listeners": "error",
"camunda-compat/no-template": "error",
"camunda-compat/no-version-tag": "error",
"camunda-compat/no-zeebe-properties": "error",
Expand All @@ -68,6 +69,7 @@ const rules = {
"camunda-compat/signal-reference": "error",
"camunda-compat/start-event-form": "error",
"camunda-compat/subscription": "error",
"camunda-compat/task-listener": "error",
"camunda-compat/task-schedule": "error",
"camunda-compat/timer": "error",
"camunda-compat/user-task-definition": "warn",
Expand Down Expand Up @@ -206,70 +208,78 @@ import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-

cache['bpmnlint-plugin-camunda-compat/no-task-schedule'] = rule_28;

import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';
import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-task-listeners';

cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_29;
cache['bpmnlint-plugin-camunda-compat/no-task-listeners'] = rule_29;

import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-version-tag';
import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-template';

cache['bpmnlint-plugin-camunda-compat/no-version-tag'] = rule_30;
cache['bpmnlint-plugin-camunda-compat/no-template'] = rule_30;

import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';
import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-version-tag';

cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_31;
cache['bpmnlint-plugin-camunda-compat/no-version-tag'] = rule_31;

import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-properties';

cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_32;
cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_32;

import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority-definition';
import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';

cache['bpmnlint-plugin-camunda-compat/priority-definition'] = rule_33;
cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_33;

import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/priority-definition';

cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_34;
cache['bpmnlint-plugin-camunda-compat/priority-definition'] = rule_34;

import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';

cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_35;
cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_35;

import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
import rule_36 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';

cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_36;
cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_36;

import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
import rule_37 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';

cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_37;
cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_37;

import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
import rule_38 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';

cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_38;
cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_38;

import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
import rule_39 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';

cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_39;
cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_39;

import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
import rule_40 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-listener';

cache['bpmnlint-plugin-camunda-compat/timer'] = rule_40;
cache['bpmnlint-plugin-camunda-compat/task-listener'] = rule_40;

import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
import rule_41 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';

cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_41;
cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_41;

import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
import rule_42 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';

cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_42;
cache['bpmnlint-plugin-camunda-compat/timer'] = rule_42;

import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag';
import rule_43 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';

cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_43;
cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_43;

import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
import rule_44 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';

cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_44;
cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_44;

import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task';
import rule_45 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/version-tag';

cache['bpmnlint-plugin-camunda-compat/zeebe-user-task'] = rule_45;
cache['bpmnlint-plugin-camunda-compat/version-tag'] = rule_45;

import rule_46 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';

cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_46;

import rule_47 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/zeebe-user-task';

cache['bpmnlint-plugin-camunda-compat/zeebe-user-task'] = rule_47;
8 changes: 8 additions & 0 deletions lib/utils/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Execution listeners>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

if (is(extensionElement, 'zeebe:TaskListeners')) {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Task listeners>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

if (is(node, 'bpmn:Process') && is(extensionElement, 'zeebe:VersionTag')) {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Version tag>`, executionPlatform, executionPlatformVersion, allowedVersion);
}
Expand Down Expand Up @@ -536,6 +540,10 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
return 'An <Execution Listener> must have a defined <Type>';
}

if (is(node, 'zeebe:TaskListener') && requiredProperty === 'type') {
return 'A <Task Listener> must have a defined <Type>';
}

if (requiredProperty === 'errorRef') {

if (parentNode && is(parentNode, 'bpmn:CatchEvent')) {
Expand Down
10 changes: 10 additions & 0 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ export function getEntryIds(report) {
});
}

if (isPropertyError(data, 'type', 'zeebe:TaskListener')) {
const index = path[ path.length - 2 ];

return [ `${id}-taskListener-${index}-listenerType` ];
}

if (isPropertyError(data, 'bindingType')) {
return [ 'bindingType' ];
}
Expand Down Expand Up @@ -581,6 +587,10 @@ export function getErrorMessage(id, report) {
}
}

if (/^.+-taskListener-[0-9]+-listenerType$/.test(id)) {
return 'Must be defined.';
}

if (id === 'bindingType') {
return getNotSupportedMessage('', allowedVersion);
}
Expand Down
76 changes: 40 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
"@bpmn-io/diagram-js-ui": "^0.2.3",
"bpmn-moddle": "^9.0.1",
"bpmnlint": "^10.3.1",
"bpmnlint-plugin-camunda-compat": "^2.27.0",
"bpmnlint-plugin-camunda-compat": "^2.28.0",
"bpmnlint-utils": "^1.0.2",
"camunda-bpmn-moddle": "^7.0.1",
"clsx": "^2.0.0",
"min-dash": "^4.0.0",
"min-dom": "^5.1.1",
"modeler-moddle": "^0.2.0",
"semver-compare": "^1.0.0",
"zeebe-bpmn-moddle": "^1.6.0"
"zeebe-bpmn-moddle": "^1.7.0"
},
"devDependencies": {
"bpmn-js": "^17.11.1",
"bpmn-js-element-templates": "^2.2.1",
"bpmn-js-properties-panel": "^5.24.0",
"camunda-bpmn-js-behaviors": "^1.6.1",
"bpmn-js-properties-panel": "^5.27.0",
"camunda-bpmn-js-behaviors": "^1.7.1",
"chai": "^4.5.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.1",
Expand Down
Loading

0 comments on commit bc93919

Please sign in to comment.