bpmnlint 10.2.2 → 10.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bpmnlint",
3
3
  "description": "Validate your BPMN diagrams based on configurable lint rules",
4
- "version": "10.2.2",
4
+ "version": "10.2.3",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
7
7
  "bpmnlint",
@@ -60,24 +60,29 @@ module.exports = function() {
60
60
  */
61
61
  function checkProcess(node, elementsToReport, elementsOutsideToReport, diObjects, parentDi) {
62
62
 
63
- // check child elements for overlap
64
63
  const flowElements = node.flowElements || [];
65
- checkElementsArray(flowElements, elementsToReport, diObjects);
66
64
 
67
- // check child elements outside parent boundary
68
- // TODO: Skipped DataSoreReferences for now
69
- flowElements.filter(element => !is(element, 'bpmn:DataStoreReference')).forEach(element => {
65
+ const flowElementsWithDi = flowElements.filter(element => diObjects.has(element));
70
66
 
71
- if (!diObjects.has(element)) {
72
- return;
73
- }
67
+ // check child elements for overlap
68
+ checkElementsArray(flowElementsWithDi, elementsToReport, diObjects);
74
69
 
75
- if (isOutsideParentBoundary(diObjects.get(element).bounds, parentDi.bounds)) {
70
+ // check child elements outside parent boundary
71
+ //
72
+ // * data objects do not have a visual representation
73
+ // * for historical reasons data store references may be
74
+ // outside of parent boundaries
75
+ //
76
+ flowElementsWithDi.forEach(element => {
77
+ if (
78
+ !is(element, 'bpmn:DataStoreReference') &&
79
+ isOutsideParentBoundary(diObjects.get(element).bounds, parentDi.bounds)
80
+ ) {
76
81
  elementsOutsideToReport.add(element);
77
82
  }
78
83
  });
79
84
 
80
- // check subprocesses
85
+ // recurse into subprocesses
81
86
  const subProcesses = flowElements.filter(element => is(element, 'bpmn:SubProcess'));
82
87
  subProcesses.forEach(subProcess => {
83
88
  const subProcessDi = diObjects.get(subProcess) || {};
@@ -93,13 +98,10 @@ function checkProcess(node, elementsToReport, elementsOutsideToReport, diObjects
93
98
  function checkElementsArray(elements, elementsToReport, diObjects) {
94
99
  for (let i = 0; i < elements.length - 1; i++) {
95
100
  const element = elements[i];
101
+
96
102
  for (let j = i + 1; j < elements.length; j++) {
97
103
  const element2 = elements[j];
98
104
 
99
- if (!diObjects.has(element) || !diObjects.has(element2)) {
100
- continue;
101
- }
102
-
103
105
  // ignore if Boundary events overlap their host
104
106
  // but still check if they overlap other elements
105
107
  if (element.attachedToRef === element2 || element2.attachedToRef === element) {