-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
707 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,12 @@ All notable changes to [bpmnlint-plugin-camunda-compat](https://github.com/camun | |
|
||
___Note:__ Yet to be released changes appear here._ | ||
|
||
* `DEPS`: bump `[email protected]` | ||
* `FEAT`: support task listeners ([#181](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/181)) | ||
* `FEAT`: add `no-duplicate-task-listeners` rule | ||
* `FEAT`: add `no-task-listeners` rule | ||
* `FEAT`: add `task-listener` rule | ||
|
||
# 2.27.0 | ||
|
||
* `FEAT`: add `zeebe-user-task` rule ([#179](https://github.com/camunda/bpmnlint-plugin-camunda-compat/pull/179)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { | ||
findExtensionElement, | ||
hasDuplicatedPropertiesValues | ||
} = require('../utils/element'); | ||
|
||
const { reportErrors } = require('../utils/reporter'); | ||
|
||
const { skipInNonExecutableProcess } = require('../utils/rule'); | ||
|
||
module.exports = skipInNonExecutableProcess(function() { | ||
function check(node, reporter) { | ||
const taskListeners = findExtensionElement(node, 'zeebe:TaskListeners'); | ||
|
||
if (!taskListeners) { | ||
return; | ||
} | ||
|
||
const errors = hasDuplicatedTaskListeners(taskListeners, node); | ||
|
||
if (errors && errors.length) { | ||
reportErrors(node, reporter, errors); | ||
} | ||
} | ||
|
||
return { | ||
check | ||
}; | ||
}); | ||
|
||
// helpers ////////// | ||
function hasDuplicatedTaskListeners(taskListeners, parentNode = null) { | ||
return hasDuplicatedPropertiesValues(taskListeners, 'listeners', [ 'eventType', 'type' ], parentNode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const { reportErrors } = require('../utils/reporter'); | ||
|
||
const { skipInNonExecutableProcess } = require('../utils/rule'); | ||
|
||
const { hasNoExtensionElement } = require('../utils/element'); | ||
|
||
const ALLOWED_VERSION = '8.7'; | ||
|
||
module.exports = skipInNonExecutableProcess(function() { | ||
function check(node, reporter) { | ||
const errors = hasNoExtensionElement(node, 'zeebe:TaskListeners', node, ALLOWED_VERSION); | ||
|
||
if (errors && errors.length) { | ||
reportErrors(node, reporter, errors); | ||
} | ||
} | ||
|
||
return { | ||
check | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const { is } = require('bpmnlint-utils'); | ||
|
||
const { | ||
findExtensionElement, | ||
hasProperties, | ||
hasExtensionElement | ||
} = require('../utils/element'); | ||
|
||
const { reportErrors } = require('../utils/reporter'); | ||
|
||
const { skipInNonExecutableProcess } = require('../utils/rule'); | ||
|
||
|
||
module.exports = skipInNonExecutableProcess(function() { | ||
function check(node, reporter) { | ||
if (!is(node, 'bpmn:UserTask')) { | ||
return; | ||
} | ||
|
||
let errors = hasExtensionElement(node, 'zeebe:UserTask', node); | ||
|
||
if (errors && errors.length) { | ||
reportErrors(node, reporter, errors); | ||
} | ||
|
||
const taskListeners = findExtensionElement(node, 'zeebe:TaskListeners'); | ||
|
||
if (!taskListeners) { | ||
return; | ||
} | ||
|
||
const listeners = taskListeners.get('listeners'); | ||
errors = listeners.flatMap(listener => hasProperties(listener, { | ||
type: { | ||
required: true | ||
} | ||
}, node)); | ||
|
||
if (errors.length) { | ||
reportErrors(node, reporter, errors); | ||
} | ||
} | ||
|
||
return { | ||
check | ||
}; | ||
}); |
Oops, something went wrong.