Skip to content

Commit

Permalink
fix: do not mark job worker user task as incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Nov 22, 2024
1 parent dd3173e commit ce3f200
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
12 changes: 6 additions & 6 deletions rules/camunda-cloud/task-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ module.exports = skipInNonExecutableProcess(function() {
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;
}

let errors = hasExtensionElement(node, 'zeebe:UserTask');

if (errors && errors.length) {
reportErrors(node, reporter, errors);
}

const listeners = taskListeners.get('listeners');
errors = listeners.flatMap(listener => hasProperties(listener, {
type: {
Expand Down
14 changes: 13 additions & 1 deletion test/camunda-cloud/task-listener.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ const valid = [
</bpmn:extensionElements>
</bpmn:userTask>
`))
},
{
name: 'job worker user task without tasklisteners',
config: { version: '8.7' },
moddleElement: createModdle(createProcess(`
<bpmn:userTask id="UserTask_1"/>
`))
}
];

Expand All @@ -42,7 +49,12 @@ const invalid = [
report: {
id: 'UserTask_1',
message: 'Element of type <bpmn:UserTask> must have one extension element of type <zeebe:UserTask>',
path: [],
path: [
'rootElements',
0,
'flowElements',
0
],
data: {
type: ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED,
node: 'UserTask_1',
Expand Down

0 comments on commit ce3f200

Please sign in to comment.