Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit ab076fc

Browse files
authored
Merge pull request #137 from viadee/development
Development, new release version 3.0.1
2 parents 9765de6 + 696b683 commit ab076fc

File tree

69 files changed

+5284
-5156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5284
-5156
lines changed

docs/ProcessVariablesModelChecker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The Process Variables Model Checker processes BPMN models and checks a model for
55
- DD (Overwritten)
66
- DU (Defined-Deleted)
77
- UR (Undefined-Reference)
8+
- UU (Undefined-Undefined)
89
```
910
U – Deletion of a value (undefine)
1011
D – Value assignment (define)

docs/ReleaseNotes.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,76 @@
11
# Release notes
22

3+
## 3.0.1
4+
5+
### Features
6+
[**Issue 133**](https://github.com/viadee/vPAV/issues/133) Added scope information to data flow analysis
7+
8+
### Fixes
9+
10+
### Misc
11+
[**Issue 130**](https://github.com/viadee/vPAV/issues/130) Redefined anomalies and improved calculations
12+
313
## 3.0.0
414

515
### Features
6-
[**Issue 103**](https://github.com/viadee/vPAV/issues/103) & [**Issue 109**](https://github.com/viadee/vPAV/issues/109) Reworked ProcessVariableModelChecker with drastic gains in accuracy
7-
[**Issue 80**](https://github.com/viadee/vPAV/issues/80) Location of BPMN files is not static anymore and can be configured
8-
[**Issue 199**](https://github.com/viadee/vPAV/issues/199) Properties are excluded from rule set and can now be defined in a properties file
9-
[**Issue 121**](https://github.com/viadee/vPAV/issues/121) Element checkers can define whether only one instance/rule or multiple instances/rules are allowed
16+
[**Issue 103**](https://github.com/viadee/vPAV/issues/103) Reworked entire ProcessVariableModelChecker to improve accuracy of data flow analysis
17+
[**Issue 109**](https://github.com/viadee/vPAV/issues/109) Created unique (global) identification mechanism for proper access to process variable operations
18+
[**Issue 119**](https://github.com/viadee/vPAV/issues/119) Separation of properties (introduction of a properties file) and rules
19+
[**Issue 121**](https://github.com/viadee/vPAV/issues/121) Multiple instances of checkers are now allowed (see [#59](https://github.com/viadee/vPAV/issues/59))
20+
21+
### Fixes
22+
23+
### Misc
24+
25+
## 2.8.3
26+
27+
### Features
28+
[**Issue 59**](https://github.com/viadee/vPAV/issues/59) Multiple instances of checkers are now allowed
29+
[**Issue 80**](https://github.com/viadee/vPAV/issues/80) Location of BPMN files now configurable
30+
31+
### Fixes
32+
[**Issue 120**](https://github.com/viadee/vPAV/issues/120) Fixed CheckerFactory warning
33+
34+
### Misc
35+
[**Issue 115**](https://github.com/viadee/vPAV/issues/115) Improved documentation for inheritance of ruleSets
36+
[**Issue 113**](https://github.com/viadee/vPAV/issues/113) Adjusted SonarQube rules
37+
38+
## 2.8.2
39+
40+
### Features
41+
[**Issue 106**](https://github.com/viadee/vPAV/issues/106) Make bean mapping passable as argument to ProcessApplicationvalidator
42+
### Fixes
43+
44+
### Misc
45+
[**Issue 116**](https://github.com/viadee/vPAV/issues/16) Clean up of unit tests
46+
47+
## 2.8.1
48+
49+
### Features
50+
[**Issue 60**](https://github.com/viadee/vPAV/issues/60) Support of transitive interface implementation
51+
[**Issue 94**](https://github.com/viadee/vPAV/issues/94) Added MessageChecker
52+
53+
### Fixes
54+
[**Issue 104**](https://github.com/viadee/vPAV/issues/104) Resolved dependencies
55+
56+
### Misc
57+
[**Issue 102**](https://github.com/viadee/vPAV/issues/102) Improved discovery of intermediate injection of process variables
58+
59+
## 2.8.0
60+
61+
### Features
62+
[**Issue 95**](https://github.com/viadee/vPAV/issues/95) Refactoring of process variable discovery (adapted to Camunda injection order)
63+
64+
### Fixes
65+
66+
### Misc
67+
68+
## 2.7.3
69+
70+
### Features
1071

1172
### Fixes
12-
[**Issue 120**](https://github.com/viadee/vPAV/issues/120) Checker factory does not fail on instantiating some checkers twice
73+
[**Issue 93**](https://github.com/viadee/vPAV/issues/93) Fixed endless recursion and StackOverflow
1374

1475
### Misc
1576

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>de.viadee</groupId>
66
<artifactId>viadeeProcessApplicationValidator</artifactId>
77

8-
<version>3.0.0</version>
8+
<version>3.0.1</version>
99

1010
<name>viadee Process Application Validator</name>
1111

src/main/java/de/viadee/bpm/vPAV/BpmnScanner.java

Lines changed: 92 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
/**
22
* BSD 3-Clause License
3-
* <p>
3+
*
44
* Copyright © 2019, viadee Unternehmensberatung AG
55
* All rights reserved.
6-
* <p>
6+
*
77
* Redistribution and use in source and binary forms, with or without
88
* modification, are permitted provided that the following conditions are met:
9-
* <p>
9+
*
1010
* * Redistributions of source code must retain the above copyright notice, this
11-
* list of conditions and the following disclaimer.
12-
* <p>
11+
* list of conditions and the following disclaimer.
12+
*
1313
* * Redistributions in binary form must reproduce the above copyright notice,
14-
* this list of conditions and the following disclaimer in the documentation
15-
* and/or other materials provided with the distribution.
16-
* <p>
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
1717
* * Neither the name of the copyright holder nor the names of its
18-
* contributors may be used to endorse or promote products derived from
19-
* this software without specific prior written permission.
20-
* <p>
18+
* contributors may be used to endorse or promote products derived from
19+
* this software without specific prior written permission.
20+
*
2121
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2222
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2323
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -67,7 +67,7 @@ private enum ModelVersionEnum {
6767
* Implementation, so the we have to scan the xml of the model for the
6868
* implementation
6969
* <p>
70-
* * @param path
70+
* @param path
7171
* path to model
7272
*/
7373
public BpmnScanner(String path) {
@@ -334,7 +334,7 @@ public String getEventImplementation(String id) {
334334
public ArrayList<String> getListener(String id, String listType, String extType) {
335335

336336
// list to hold return values
337-
ArrayList<String> returnAttrList = new ArrayList<String>();
337+
ArrayList<String> returnAttrList = new ArrayList<>();
338338

339339
// List for all Task elements
340340
NodeList nodeListExtensionElements;
@@ -395,7 +395,7 @@ private String checkAttributesOfNode(Node node, String listType) {
395395
*/
396396
public ArrayList<String> getScriptTypes(String id) {
397397
// bool to hold return values
398-
ArrayList<String> returnScriptType = new ArrayList<String>();
398+
ArrayList<String> returnScriptType = new ArrayList<>();
399399

400400
// List for all Task elements
401401
NodeList nodeList;
@@ -440,10 +440,12 @@ public boolean checkStartEvent(String id) {
440440
nodeList = null;
441441
}
442442

443-
for (int i = 0; i < nodeList.getLength(); i++) {
444-
Element startEvent = (Element) nodeList.item(i);
445-
if (id.equals(startEvent.getAttribute(BpmnConstants.ATTR_ID))) {
446-
return isSubprocess(startEvent);
443+
if (nodeList != null) {
444+
for (int i = 0; i < nodeList.getLength(); i++) {
445+
Element startEvent = (Element) nodeList.item(i);
446+
if (id.equals(startEvent.getAttribute(BpmnConstants.ATTR_ID))) {
447+
return isSubprocess(startEvent);
448+
}
447449
}
448450
}
449451

@@ -520,10 +522,12 @@ public boolean hasScriptInCondExp(String id) {
520522
break;
521523
}
522524

523-
for (int i = 0; i < nodeList.getLength(); i++) {
524-
Element sequenceElement = (Element) nodeList.item(i);
525-
if (sequenceElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
526-
return hasCondExp(sequenceElement);
525+
if (nodeList != null) {
526+
for (int i = 0; i < nodeList.getLength(); i++) {
527+
Element sequenceElement = (Element) nodeList.item(i);
528+
if (sequenceElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
529+
return hasCondExp(sequenceElement);
530+
}
527531
}
528532
}
529533

@@ -648,16 +652,19 @@ public ArrayList<String> getSequenceFlowDef(String id) {
648652

649653
NodeList nodeList = getNodeListByVersion();
650654

651-
for (int i = 0; i < nodeList.getLength(); i++) {
652-
Element taskElement = (Element) nodeList.item(i);
655+
if (nodeList != null) {
656+
for (int i = 0; i < nodeList.getLength(); i++) {
657+
Element taskElement = (Element) nodeList.item(i);
653658

654-
// check if the ids are corresponding and retrieve the attributes for target and
655-
// source reference
656-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
657-
references.add(taskElement.getAttribute(BpmnConstants.SOURCE_REF));
658-
references.add(taskElement.getAttribute(BpmnConstants.TARGET_REF));
659+
// check if the ids are corresponding and retrieve the attributes for target and
660+
// source reference
661+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
662+
references.add(taskElement.getAttribute(BpmnConstants.SOURCE_REF));
663+
references.add(taskElement.getAttribute(BpmnConstants.TARGET_REF));
664+
}
659665
}
660666
}
667+
661668
return references;
662669
}
663670

@@ -689,20 +696,23 @@ public ArrayList<Node> getOutgoingEdges(String id) {
689696
break;
690697
}
691698

692-
for (int i = 0; i < nodeList.getLength(); i++) {
693-
Element taskElement = (Element) nodeList.item(i);
699+
if (nodeList != null) {
700+
for (int i = 0; i < nodeList.getLength(); i++) {
701+
Element taskElement = (Element) nodeList.item(i);
694702

695-
// check if the ids are corresponding and retrieve the outgoing edges of the xor
696-
// gateway
697-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
698-
NodeList children = taskElement.getChildNodes();
699-
for (int j = 0; j < children.getLength(); j++) {
700-
if (children.item(j).getNodeName().equals(out)) {
701-
outgoingEdges.add(checkNamingOfEdges(children.item(j).getTextContent()));
703+
// check if the ids are corresponding and retrieve the outgoing edges of the xor
704+
// gateway
705+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
706+
NodeList children = taskElement.getChildNodes();
707+
for (int j = 0; j < children.getLength(); j++) {
708+
if (children.item(j).getNodeName().equals(out)) {
709+
outgoingEdges.add(checkNamingOfEdges(children.item(j).getTextContent()));
710+
}
702711
}
703712
}
704713
}
705714
}
715+
706716
return outgoingEdges;
707717
}
708718

@@ -717,12 +727,15 @@ public Node checkNamingOfEdges(String id) {
717727
Node edge = null;
718728
NodeList nodeList = getNodeListByVersion();
719729

720-
for (int i = 0; i < nodeList.getLength(); i++) {
721-
Element taskElement = (Element) nodeList.item(i);
722-
if (taskElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
723-
edge = taskElement;
730+
if (nodeList != null) {
731+
for (int i = 0; i < nodeList.getLength(); i++) {
732+
Element taskElement = (Element) nodeList.item(i);
733+
if (taskElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
734+
edge = taskElement;
735+
}
724736
}
725737
}
738+
726739
return edge;
727740
}
728741

@@ -1084,18 +1097,21 @@ public Map<String, String> getErrorDef(String id) {
10841097
break;
10851098
}
10861099

1087-
final Map<String, String> errorDef = new HashMap<String, String>();
1100+
final Map<String, String> errorDef = new HashMap<>();
10881101

1089-
// iterate over list and check each item
1090-
for (int i = 0; i < nodeList.getLength(); i++) {
1091-
Element taskElement = (Element) nodeList.item(i);
1102+
if (nodeList != null) {
1103+
// iterate over list and check each item
1104+
for (int i = 0; i < nodeList.getLength(); i++) {
1105+
Element taskElement = (Element) nodeList.item(i);
10921106

1093-
// check if the ids are corresponding
1094-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1095-
errorDef.put(taskElement.getAttribute(BpmnConstants.ATTR_NAME),
1096-
taskElement.getAttribute(BpmnConstants.ATTR_ERROR_CODE));
1107+
// check if the ids are corresponding
1108+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1109+
errorDef.put(taskElement.getAttribute(BpmnConstants.ATTR_NAME),
1110+
taskElement.getAttribute(BpmnConstants.ATTR_ERROR_CODE));
1111+
}
10971112
}
10981113
}
1114+
10991115
return errorDef;
11001116
}
11011117

@@ -1173,13 +1189,15 @@ public String getErrorEventMapping(String id) {
11731189
break;
11741190
}
11751191

1176-
// iterate over list and check each item
1177-
for (int i = 0; i < nodeList.getLength(); i++) {
1178-
Element taskElement = (Element) nodeList.item(i);
1192+
if (nodeList != null) {
1193+
// iterate over list and check each item
1194+
for (int i = 0; i < nodeList.getLength(); i++) {
1195+
Element taskElement = (Element) nodeList.item(i);
11791196

1180-
// check if the ids are corresponding
1181-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1182-
attachedToTask = taskElement.getAttribute(BpmnConstants.ATTACHED_TO_REF);
1197+
// check if the ids are corresponding
1198+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1199+
attachedToTask = taskElement.getAttribute(BpmnConstants.ATTACHED_TO_REF);
1200+
}
11831201
}
11841202
}
11851203

@@ -1227,7 +1245,7 @@ public ArrayList<String> getMessageRefs(String id) {
12271245
}
12281246

12291247
private ArrayList<String> getMessageRefFromReceiveTask(String id) {
1230-
ArrayList<String> messageRefs = new ArrayList<String>();
1248+
ArrayList<String> messageRefs = new ArrayList<>();
12311249
NodeList nodeList = null;
12321250

12331251
switch (modelVersion) {
@@ -1244,12 +1262,15 @@ private ArrayList<String> getMessageRefFromReceiveTask(String id) {
12441262
break;
12451263
}
12461264

1247-
// iterate over list and check each item
1248-
for (int i = 0; i < nodeList.getLength(); i++) {
1249-
Element taskElement = (Element) nodeList.item(i);
1250-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID)))
1251-
messageRefs.add(taskElement.getAttribute(BpmnConstants.ATTR_MESSAGE_REF));
1265+
if (nodeList != null) {
1266+
// iterate over list and check each item
1267+
for (int i = 0; i < nodeList.getLength(); i++) {
1268+
Element taskElement = (Element) nodeList.item(i);
1269+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID)))
1270+
messageRefs.add(taskElement.getAttribute(BpmnConstants.ATTR_MESSAGE_REF));
1271+
}
12521272
}
1273+
12531274
return messageRefs;
12541275
}
12551276

@@ -1367,15 +1388,18 @@ public String getSignalName(String signalRef) {
13671388
private String getName(NodeList nodeList, String id) {
13681389
String name = "";
13691390

1370-
// iterate over list and check each item
1371-
for (int i = 0; i < nodeList.getLength(); i++) {
1372-
Element taskElement = (Element) nodeList.item(i);
1391+
if (nodeList != null) {
1392+
// iterate over list and check each item
1393+
for (int i = 0; i < nodeList.getLength(); i++) {
1394+
Element taskElement = (Element) nodeList.item(i);
13731395

1374-
// check if the ids are corresponding
1375-
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1376-
name = taskElement.getAttribute(BpmnConstants.ATTR_NAME);
1396+
// check if the ids are corresponding
1397+
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
1398+
name = taskElement.getAttribute(BpmnConstants.ATTR_NAME);
1399+
}
13771400
}
13781401
}
1402+
13791403
return name;
13801404
}
13811405
}

0 commit comments

Comments
 (0)