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

Support zeebe:VersionTag and zeebe:versionTag errors #115

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 31 additions & 26 deletions lib/compiled-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const rules = {
"camunda-compat/no-signal-event-sub-process": "error",
"camunda-compat/no-task-schedule": "error",
"camunda-compat/no-template": "error",
"camunda-compat/no-version-tag": "error",
"camunda-compat/no-zeebe-properties": "error",
"camunda-compat/no-zeebe-user-task": "error",
"camunda-compat/priority-definition": "error",
Expand Down Expand Up @@ -207,54 +208,58 @@ import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-templ

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_43;
24 changes: 22 additions & 2 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(node, 'bpmn:Process') && is(extensionElement, 'zeebe:VersionTag')) {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Version tag>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

return message;
}

Expand Down Expand Up @@ -438,7 +442,7 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
}

if (is(node, 'zeebe:AssignmentDefinition') && property === 'candidateUsers') {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with defined <Candidate users>`, executionPlatform, executionPlatformVersion, allowedVersion);
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Candidate users>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

if (is(node, 'bpmn:SequenceFlow') && property === 'conditionExpression') {
Expand All @@ -453,6 +457,14 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Camunda form (linked)>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

if (isAny(node, [
'zeebe:CalledDecision',
'zeebe:CalledElement',
'zeebe:FormDefinition'
]) && property === 'versionTag') {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Version tag>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

return message;
}

Expand Down Expand Up @@ -723,7 +735,15 @@ function getPropertyValueNotAllowedErrorMessage(report, executionPlatform, execu
'zeebe:CalledElement',
'zeebe:FormDefinition'
]) && property === 'bindingType') {
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Binding: deployment>`, executionPlatform, executionPlatformVersion, allowedVersion);
const bindingType = node.get('bindingType');

let bindingTypeString = bindingType;

if (bindingType === 'versionTag') {
bindingTypeString = 'version tag';
}

return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Binding: ${ bindingTypeString }>`, executionPlatform, executionPlatformVersion, allowedVersion);
}

return message;
Expand Down
8 changes: 8 additions & 0 deletions lib/utils/properties-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ export function getEntryIds(report) {
return [ 'bindingType' ];
}

if (isPropertyError(data, 'versionTag') || isExtensionElementNotAllowedError(data, 'zeebe:VersionTag')) {
return [ 'versionTag' ];
}

return [];
}

Expand Down Expand Up @@ -576,6 +580,10 @@ export function getErrorMessage(id, report) {
if (id === 'bindingType') {
return getNotSupportedMessage('', allowedVersion);
}

if (id === 'versionTag') {
return getNotSupportedMessage('', allowedVersion);
}
}

function isExtensionElementNotAllowedError(data, extensionElement, type) {
Expand Down
Loading
Loading