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

Commit

Permalink
Merge pull request #137 from viadee/development
Browse files Browse the repository at this point in the history
Development, new release version 3.0.1
  • Loading branch information
TamaraGunkel committed Jun 17, 2019
2 parents 9765de6 + 696b683 commit ab076fc
Show file tree
Hide file tree
Showing 69 changed files with 5,284 additions and 5,156 deletions.
1 change: 1 addition & 0 deletions docs/ProcessVariablesModelChecker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The Process Variables Model Checker processes BPMN models and checks a model for
- DD (Overwritten)
- DU (Defined-Deleted)
- UR (Undefined-Reference)
- UU (Undefined-Undefined)
```
U – Deletion of a value (undefine)
D – Value assignment (define)
Expand Down
71 changes: 66 additions & 5 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,76 @@
# Release notes

## 3.0.1

### Features
[**Issue 133**](https://github.com/viadee/vPAV/issues/133) Added scope information to data flow analysis

### Fixes

### Misc
[**Issue 130**](https://github.com/viadee/vPAV/issues/130) Redefined anomalies and improved calculations

## 3.0.0

### Features
[**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
[**Issue 80**](https://github.com/viadee/vPAV/issues/80) Location of BPMN files is not static anymore and can be configured
[**Issue 199**](https://github.com/viadee/vPAV/issues/199) Properties are excluded from rule set and can now be defined in a properties file
[**Issue 121**](https://github.com/viadee/vPAV/issues/121) Element checkers can define whether only one instance/rule or multiple instances/rules are allowed
[**Issue 103**](https://github.com/viadee/vPAV/issues/103) Reworked entire ProcessVariableModelChecker to improve accuracy of data flow analysis
[**Issue 109**](https://github.com/viadee/vPAV/issues/109) Created unique (global) identification mechanism for proper access to process variable operations
[**Issue 119**](https://github.com/viadee/vPAV/issues/119) Separation of properties (introduction of a properties file) and rules
[**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))

### Fixes

### Misc

## 2.8.3

### Features
[**Issue 59**](https://github.com/viadee/vPAV/issues/59) Multiple instances of checkers are now allowed
[**Issue 80**](https://github.com/viadee/vPAV/issues/80) Location of BPMN files now configurable

### Fixes
[**Issue 120**](https://github.com/viadee/vPAV/issues/120) Fixed CheckerFactory warning

### Misc
[**Issue 115**](https://github.com/viadee/vPAV/issues/115) Improved documentation for inheritance of ruleSets
[**Issue 113**](https://github.com/viadee/vPAV/issues/113) Adjusted SonarQube rules

## 2.8.2

### Features
[**Issue 106**](https://github.com/viadee/vPAV/issues/106) Make bean mapping passable as argument to ProcessApplicationvalidator
### Fixes

### Misc
[**Issue 116**](https://github.com/viadee/vPAV/issues/16) Clean up of unit tests

## 2.8.1

### Features
[**Issue 60**](https://github.com/viadee/vPAV/issues/60) Support of transitive interface implementation
[**Issue 94**](https://github.com/viadee/vPAV/issues/94) Added MessageChecker

### Fixes
[**Issue 104**](https://github.com/viadee/vPAV/issues/104) Resolved dependencies

### Misc
[**Issue 102**](https://github.com/viadee/vPAV/issues/102) Improved discovery of intermediate injection of process variables

## 2.8.0

### Features
[**Issue 95**](https://github.com/viadee/vPAV/issues/95) Refactoring of process variable discovery (adapted to Camunda injection order)

### Fixes

### Misc

## 2.7.3

### Features

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

### Misc

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>de.viadee</groupId>
<artifactId>viadeeProcessApplicationValidator</artifactId>

<version>3.0.0</version>
<version>3.0.1</version>

<name>viadee Process Application Validator</name>

Expand Down
160 changes: 92 additions & 68 deletions src/main/java/de/viadee/bpm/vPAV/BpmnScanner.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
/**
* BSD 3-Clause License
* <p>
*
* Copyright © 2019, viadee Unternehmensberatung AG
* All rights reserved.
* <p>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* <p>
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* <p>
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* <p>
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* <p>
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down Expand Up @@ -67,7 +67,7 @@ private enum ModelVersionEnum {
* Implementation, so the we have to scan the xml of the model for the
* implementation
* <p>
* * @param path
* @param path
* path to model
*/
public BpmnScanner(String path) {
Expand Down Expand Up @@ -334,7 +334,7 @@ public String getEventImplementation(String id) {
public ArrayList<String> getListener(String id, String listType, String extType) {

// list to hold return values
ArrayList<String> returnAttrList = new ArrayList<String>();
ArrayList<String> returnAttrList = new ArrayList<>();

// List for all Task elements
NodeList nodeListExtensionElements;
Expand Down Expand Up @@ -395,7 +395,7 @@ private String checkAttributesOfNode(Node node, String listType) {
*/
public ArrayList<String> getScriptTypes(String id) {
// bool to hold return values
ArrayList<String> returnScriptType = new ArrayList<String>();
ArrayList<String> returnScriptType = new ArrayList<>();

// List for all Task elements
NodeList nodeList;
Expand Down Expand Up @@ -440,10 +440,12 @@ public boolean checkStartEvent(String id) {
nodeList = null;
}

for (int i = 0; i < nodeList.getLength(); i++) {
Element startEvent = (Element) nodeList.item(i);
if (id.equals(startEvent.getAttribute(BpmnConstants.ATTR_ID))) {
return isSubprocess(startEvent);
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Element startEvent = (Element) nodeList.item(i);
if (id.equals(startEvent.getAttribute(BpmnConstants.ATTR_ID))) {
return isSubprocess(startEvent);
}
}
}

Expand Down Expand Up @@ -520,10 +522,12 @@ public boolean hasScriptInCondExp(String id) {
break;
}

for (int i = 0; i < nodeList.getLength(); i++) {
Element sequenceElement = (Element) nodeList.item(i);
if (sequenceElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
return hasCondExp(sequenceElement);
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Element sequenceElement = (Element) nodeList.item(i);
if (sequenceElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
return hasCondExp(sequenceElement);
}
}
}

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

NodeList nodeList = getNodeListByVersion();

for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);

// check if the ids are corresponding and retrieve the attributes for target and
// source reference
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
references.add(taskElement.getAttribute(BpmnConstants.SOURCE_REF));
references.add(taskElement.getAttribute(BpmnConstants.TARGET_REF));
// check if the ids are corresponding and retrieve the attributes for target and
// source reference
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
references.add(taskElement.getAttribute(BpmnConstants.SOURCE_REF));
references.add(taskElement.getAttribute(BpmnConstants.TARGET_REF));
}
}
}

return references;
}

Expand Down Expand Up @@ -689,20 +696,23 @@ public ArrayList<Node> getOutgoingEdges(String id) {
break;
}

for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);

// check if the ids are corresponding and retrieve the outgoing edges of the xor
// gateway
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
NodeList children = taskElement.getChildNodes();
for (int j = 0; j < children.getLength(); j++) {
if (children.item(j).getNodeName().equals(out)) {
outgoingEdges.add(checkNamingOfEdges(children.item(j).getTextContent()));
// check if the ids are corresponding and retrieve the outgoing edges of the xor
// gateway
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
NodeList children = taskElement.getChildNodes();
for (int j = 0; j < children.getLength(); j++) {
if (children.item(j).getNodeName().equals(out)) {
outgoingEdges.add(checkNamingOfEdges(children.item(j).getTextContent()));
}
}
}
}
}

return outgoingEdges;
}

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

for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (taskElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
edge = taskElement;
if (nodeList != null) {
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (taskElement.getAttribute(BpmnConstants.ATTR_ID).equals(id)) {
edge = taskElement;
}
}
}

return edge;
}

Expand Down Expand Up @@ -1084,18 +1097,21 @@ public Map<String, String> getErrorDef(String id) {
break;
}

final Map<String, String> errorDef = new HashMap<String, String>();
final Map<String, String> errorDef = new HashMap<>();

// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (nodeList != null) {
// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);

// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
errorDef.put(taskElement.getAttribute(BpmnConstants.ATTR_NAME),
taskElement.getAttribute(BpmnConstants.ATTR_ERROR_CODE));
// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
errorDef.put(taskElement.getAttribute(BpmnConstants.ATTR_NAME),
taskElement.getAttribute(BpmnConstants.ATTR_ERROR_CODE));
}
}
}

return errorDef;
}

Expand Down Expand Up @@ -1173,13 +1189,15 @@ public String getErrorEventMapping(String id) {
break;
}

// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (nodeList != null) {
// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);

// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
attachedToTask = taskElement.getAttribute(BpmnConstants.ATTACHED_TO_REF);
// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
attachedToTask = taskElement.getAttribute(BpmnConstants.ATTACHED_TO_REF);
}
}
}

Expand Down Expand Up @@ -1227,7 +1245,7 @@ public ArrayList<String> getMessageRefs(String id) {
}

private ArrayList<String> getMessageRefFromReceiveTask(String id) {
ArrayList<String> messageRefs = new ArrayList<String>();
ArrayList<String> messageRefs = new ArrayList<>();
NodeList nodeList = null;

switch (modelVersion) {
Expand All @@ -1244,12 +1262,15 @@ private ArrayList<String> getMessageRefFromReceiveTask(String id) {
break;
}

// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID)))
messageRefs.add(taskElement.getAttribute(BpmnConstants.ATTR_MESSAGE_REF));
if (nodeList != null) {
// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID)))
messageRefs.add(taskElement.getAttribute(BpmnConstants.ATTR_MESSAGE_REF));
}
}

return messageRefs;
}

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

// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);
if (nodeList != null) {
// iterate over list and check each item
for (int i = 0; i < nodeList.getLength(); i++) {
Element taskElement = (Element) nodeList.item(i);

// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
name = taskElement.getAttribute(BpmnConstants.ATTR_NAME);
// check if the ids are corresponding
if (id.equals(taskElement.getAttribute(BpmnConstants.ATTR_ID))) {
name = taskElement.getAttribute(BpmnConstants.ATTR_NAME);
}
}
}

return name;
}
}
Loading

0 comments on commit ab076fc

Please sign in to comment.