Skip to content
Snippets Groups Projects
Commit 918517ca authored by tfli's avatar tfli
Browse files

Added readvariables to expressions

parent 89d3e81e
No related branches found
No related tags found
No related merge requests found
package de.fhmuenster.masterthesis.Testgenerator.bpmn.data;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import ch.qos.logback.core.recovery.ResilientSyslogOutputStream;
import de.fhmuenster.masterthesis.serialization.TestgeneratorDSLObjectCreator;
import de.fhmuenster.masterthesis.testgeneratorDSL.BooleanVariable;
import de.fhmuenster.masterthesis.testgeneratorDSL.IntVariable;
......@@ -18,13 +21,18 @@ import de.fhmuenster.masterthesis.testgeneratorDSL.VariableReference;
public class BPMNIOParameters {
private HashMap<String, List<String>> inputVariables = new HashMap<String, List<String>>();
private HashMap<String, List<String>> readVariablesBoolean = new HashMap<String, List<String>>();
private HashMap<String, List<String>> readVariablesString = new HashMap<String, List<String>>();
private HashMap<String, List<String>> readVariablesInt = new HashMap<String, List<String>>();
private HashMap<String, List<String>> outputVariables = new HashMap<String, List<String>>();
private HashMap<String, List<String>> innerOutputVariables = new HashMap<String, List<String>>();
private HashMap<String, List<String>> removeVariables = new HashMap<String, List<String>>();
private HashMap<String, HashMap<String, Boolean>> inputVariablesBoolean = new HashMap<String, HashMap<String, Boolean>>();
private HashMap<String, HashMap<String, String>> inputVariablesString = new HashMap<String, HashMap<String, String>>();
private HashMap<String, HashMap<String, Integer>> inputVariablesLong = new HashMap<String, HashMap<String, Integer>>();
private HashMap<String, HashMap<String, Boolean>> outputVariablesBoolean = new HashMap<String, HashMap<String, Boolean>>();
private HashMap<String, HashMap<String, String>> outputVariablesString = new HashMap<String, HashMap<String, String>>();
private HashMap<String, HashMap<String, Integer>> outputVariablesLong = new HashMap<String, HashMap<String, Integer>>();
private HashMap<String, HashMap<String, String>> hardcodedInputParametersString = new HashMap<String, HashMap<String, String>>();
private HashMap<String, HashMap<String, Long>> hardcodedInputParametersLong = new HashMap<String, HashMap<String, Long>>();
......@@ -37,6 +45,30 @@ public class BPMNIOParameters {
return inputVariables;
}
public List<String> getReadVariablesBoolean(String taskId) {
return readVariablesBoolean.entrySet().stream() //
.filter(entry -> entry.getKey().equals(taskId)) //
.flatMap(entry -> entry.getValue().stream()) //
.distinct() //
.collect(Collectors.toList()); //
}
public List<String> getReadVariablesInt(String taskId) {
return readVariablesInt.entrySet().stream() //
.filter(entry -> entry.getKey().equals(taskId)) //
.flatMap(entry -> entry.getValue().stream()) //
.distinct() //
.collect(Collectors.toList()); //
}
public List<String> getReadVariablesString(String taskId) {
return readVariablesString.entrySet().stream() //
.filter(entry -> entry.getKey().equals(taskId)) //
.flatMap(entry -> entry.getValue().stream()) //
.distinct() //
.collect(Collectors.toList()); //
}
public List<String> getInputVariables(String taskId) {
return inputVariables.entrySet().stream() //
.filter(entry -> entry.getKey().equals(taskId)) //
......@@ -45,6 +77,31 @@ public class BPMNIOParameters {
.collect(Collectors.toList()); //
}
public List<String> getAllOutputVariableTypes() {
List<String> varList = new ArrayList<String>();
for(HashMap<String, Boolean> boolMap : outputVariablesBoolean.values()) {
for(Entry<String, Boolean> boolVar: boolMap.entrySet()) {
String test = boolVar.getKey();
varList.add(boolVar.getKey());
}
}
for(HashMap<String, Integer> longMap : outputVariablesLong.values()) {
for(Entry<String, Integer> longVar: longMap.entrySet()) {
String test = longVar.getKey();
varList.add(longVar.getKey());
}
}
for(HashMap<String, String> stringMap : outputVariablesString.values()) {
for(Entry<String, String> stringVar: stringMap.entrySet()) {
String test = stringVar.getKey();
varList.add(stringVar.getKey());
}
}
return varList;
}
public List<String> getOutputVariables(String taskId) {
return outputVariables.entrySet().stream() //
.filter(entry -> entry.getKey().equals(taskId)) //
......@@ -94,7 +151,7 @@ public class BPMNIOParameters {
// Check Variable Type and create Variable if needed
if(setVarValue instanceof Integer)
{
HashMap<String, Integer> existingVariables = this.inputVariablesLong.get(flowElementId);
HashMap<String, Integer> existingVariables = this.outputVariablesLong.get(flowElementId);
HashMap<String, Integer> variables = existingVariables != null ? existingVariables : new HashMap<>();
if(!variables.containsKey(setVarName))
{
......@@ -106,11 +163,11 @@ public class BPMNIOParameters {
}
this.inputVariablesLong.put(flowElementId, variables);
this.outputVariablesLong.put(flowElementId, variables);
}
else if(setVarValue instanceof Boolean)
{
HashMap<String, Boolean> existingVariables = this.inputVariablesBoolean.get(flowElementId);
HashMap<String, Boolean> existingVariables = this.outputVariablesBoolean.get(flowElementId);
HashMap<String, Boolean> variables = existingVariables != null ? existingVariables : new HashMap<>();
if(!variables.containsKey(setVarName))
......@@ -121,11 +178,11 @@ public class BPMNIOParameters {
variables.put(setVarName, (Boolean) setVarValue);
}
this.inputVariablesBoolean.put(flowElementId, variables);
this.outputVariablesBoolean.put(flowElementId, variables);
}
else if(setVarValue instanceof String)
{
HashMap<String, String> existingVariables = this.inputVariablesString.get(flowElementId);
HashMap<String, String> existingVariables = this.outputVariablesString.get(flowElementId);
HashMap<String, String> variables = existingVariables != null ? existingVariables : new HashMap<>();
if(!variables.containsKey(setVarName))
......@@ -136,7 +193,7 @@ public class BPMNIOParameters {
variables.put(setVarName, (String) setVarValue);
}
this.inputVariablesString.put(flowElementId, variables);
this.outputVariablesString.put(flowElementId, variables);
}
}
......@@ -152,34 +209,62 @@ public class BPMNIOParameters {
* @param taskId
*/
public void addGetVariable(String flowElementId, String getVarName) {
// setVartiable == readVariables/inputVariables
List<String> existingVariables = this.inputVariables.get(flowElementId);
List<String> variables = existingVariables != null ? existingVariables : new ArrayList<>();
if(variables.contains(getVarName))
{
variables.add(getVarName);
this.inputVariables.put(flowElementId, variables);
//Check if variable exists as a set Variable
List<String> existingOutputVars = this.getAllOutputVariableTypes();
List<String> boolVars = new ArrayList<String>();
List<String> intVars = new ArrayList<String>();
List<String> stringVars = new ArrayList<String>();
if(!existingVariables.contains(getVarName) && existingOutputVars.contains(getVarName)) {
for(String varName: existingOutputVars) {
for(HashMap<String, Boolean> boolMap : outputVariablesBoolean.values()) {
for(Entry<String, Boolean> boolVar: boolMap.entrySet()) {
String boolKey = boolVar.getKey();
if(boolKey.equals(varName)) {
boolVars.add(boolKey);
this.readVariablesBoolean.put(flowElementId, boolVars);
}
}
}
for(HashMap<String, Integer> intMap : outputVariablesLong.values()) {
for(Entry<String, Integer> intVar: intMap.entrySet()) {
String intKey = intVar.getKey();
if(intKey.equals(varName)) {
intVars.add(intKey);
this.readVariablesInt.put(flowElementId, intVars);
}
}
}
for(HashMap<String, String> stringMap : outputVariablesString.values()) {
for(Entry<String, String> stringVar: stringMap.entrySet()) {
String stringKey = stringVar.getKey();
if(stringKey.equals(varName)) {
stringVars.add(stringKey);
this.readVariablesString.put(flowElementId, stringVars);
}
}
}
}
} else {
System.out.println("Variable " + getVarName + " does not exist! You have to create it first.");
}
}
public void addInputVariable(String flowElementId, String inputVariableName) {
List<String> existingVariables = this.inputVariables.get(flowElementId);
List<String> variables = existingVariables != null ? existingVariables : new ArrayList<>();
variables.add(inputVariableName);
this.inputVariables.put(flowElementId, variables);
}
public void addInputVariables(String flowElementId, List<String> inputVariables) {
List<String> existingVariables = this.inputVariables.get(flowElementId);
List<String> variables = existingVariables != null ? existingVariables : new ArrayList<>();
variables.addAll(inputVariables);
this.inputVariables.put(flowElementId, variables);
for(String varName: inputVariables) {
if(variables.contains(varName) == false)
{
variables.add(varName);
this.inputVariables.put(flowElementId, variables);
}
}
}
public void addOutputVariable(String flowElementId, String outputVariable) {
List<String> existingVariables = this.outputVariables.get(flowElementId);
List<String> variables = existingVariables != null ? existingVariables : new ArrayList<>();
......@@ -212,12 +297,12 @@ public class BPMNIOParameters {
this.hardcodedInputParametersString.put(flowElementId, variables);
}
public void addinputVariablesString(String flowElementId, String inputVariable, String value) {
HashMap<String, String> existingVariables = this.inputVariablesString.get(flowElementId);
public void addoutputVariablesString(String flowElementId, String inputVariable, String value) {
HashMap<String, String> existingVariables = this.outputVariablesString.get(flowElementId);
HashMap<String, String> variables = existingVariables != null ? existingVariables : new HashMap<>();
variables.put(inputVariable, value);
this.inputVariablesString.put(flowElementId, variables);
this.outputVariablesString.put(flowElementId, variables);
}
public void addHardcodedInputParameterLong(String flowElementId, String inputVariable, Long value) {
......@@ -228,13 +313,12 @@ public class BPMNIOParameters {
this.hardcodedInputParametersLong.put(flowElementId, variables);
}
public void addinputVariablesLong(String flowElementId, String inputVariable, Integer value) {
System.out.println("INSIDE LONG WITH: " + inputVariable + " " + value);
HashMap<String, Integer> existingVariables = this.inputVariablesLong.get(flowElementId);
public void addoutputVariablesLong(String flowElementId, String inputVariable, Integer value) {
HashMap<String, Integer> existingVariables = this.outputVariablesLong.get(flowElementId);
HashMap<String, Integer> variables = existingVariables != null ? existingVariables : new HashMap<>();
variables.put(inputVariable, value);
this.inputVariablesLong.put(flowElementId, variables);
this.outputVariablesLong.put(flowElementId, variables);
}
public void addHardcodedInputParameterBoolean(String flowElementId, String inputVariable, Boolean value) {
......@@ -245,12 +329,12 @@ public class BPMNIOParameters {
this.hardcodedInputParametersBoolean.put(flowElementId, variables);
}
public void addinputVariablesBoolean(String flowElementId, String inputVariable, Boolean value) {
HashMap<String, Boolean> existingVariables = this.inputVariablesBoolean.get(flowElementId);
public void addoutputVariablesBoolean(String flowElementId, String inputVariable, Boolean value) {
HashMap<String, Boolean> existingVariables = this.outputVariablesBoolean.get(flowElementId);
HashMap<String, Boolean> variables = existingVariables != null ? existingVariables : new HashMap<>();
variables.put(inputVariable, value);
this.inputVariablesBoolean.put(flowElementId, variables);
this.outputVariablesBoolean.put(flowElementId, variables);
}
public List<String> getVariables() {
......@@ -264,29 +348,29 @@ public class BPMNIOParameters {
return hardcodedInputParametersString.get(flowElementId);
}
public HashMap<String, String> getInputVariablesString(String flowElementId) {
return inputVariablesString.get(flowElementId);
public HashMap<String, String> getWriteVariablesString(String flowElementId) {
return outputVariablesString.get(flowElementId);
}
public HashMap<String, Long> getHardcodedInputParametersLong(String flowElementId) {
return hardcodedInputParametersLong.get(flowElementId);
}
public HashMap<String, Integer> getInputVariablesLong(String flowElementId) {
return inputVariablesLong.get(flowElementId);
public HashMap<String, Integer> getWriteVariablesLong(String flowElementId) {
return outputVariablesLong.get(flowElementId);
}
public HashMap<String, Boolean> getHardcodedInputParametersBoolean(String flowElementId) {
return hardcodedInputParametersBoolean.get(flowElementId);
}
public HashMap<String, Boolean> getInputVariablesBoolean(String flowElementId) {
return inputVariablesBoolean.get(flowElementId);
public HashMap<String, Boolean> getWriteVariablesBoolean(String flowElementId) {
return outputVariablesBoolean.get(flowElementId);
}
public List<String> getExpressionInputVariables(String flowElementId) {
public List<String> getExpressionWriteVariables(String flowElementId) {
List<String> inputVariables = new ArrayList<String>();
for (Entry<String, HashMap<String, Boolean>> entry : inputVariablesBoolean.entrySet()) {
for (Entry<String, HashMap<String, Boolean>> entry : outputVariablesBoolean.entrySet()) {
if(flowElementId.equals(entry.getKey())) {
HashMap<String, Boolean> value = entry.getValue();
for (Entry<String, Boolean> boolEntry : value.entrySet()) {
......@@ -295,7 +379,7 @@ public class BPMNIOParameters {
}
}
for (Entry<String, HashMap<String, Integer>> entry : inputVariablesLong.entrySet()) {
for (Entry<String, HashMap<String, Integer>> entry : outputVariablesLong.entrySet()) {
if(flowElementId.equals(entry.getKey())) {
HashMap<String, Integer> value = entry.getValue();
for (Entry<String, Integer> intEntry : value.entrySet()) {
......@@ -304,7 +388,7 @@ public class BPMNIOParameters {
}
}
for (Entry<String, HashMap<String, String>> entry : inputVariablesString.entrySet()) {
for (Entry<String, HashMap<String, String>> entry : outputVariablesString.entrySet()) {
if(flowElementId.equals(entry.getKey())) {
HashMap<String, String> value = entry.getValue();
for (Entry<String, String> stringEntry : value.entrySet()) {
......@@ -322,8 +406,8 @@ public class BPMNIOParameters {
.collect(Collectors.toList()); //
}
public List<String> getInputVariablesString() {
return inputVariablesString.values().stream() //
public List<String> getWriteVariablesString() {
return outputVariablesString.values().stream() //
.flatMap(parameterValueMap -> parameterValueMap.keySet().stream()) //
.distinct() //
.collect(Collectors.toList()); //
......@@ -336,8 +420,8 @@ public class BPMNIOParameters {
.collect(Collectors.toList()); //
}
public List<String> getInputVariablesLong() {
return inputVariablesLong.values().stream() //
public List<String> getWriteVariablesLong() {
return outputVariablesLong.values().stream() //
.flatMap(parameterValueMap -> parameterValueMap.keySet().stream()) //
.distinct() //
.collect(Collectors.toList()); //
......@@ -350,8 +434,8 @@ public class BPMNIOParameters {
.collect(Collectors.toList()); //
}
public List<String> getInputVariablesBoolean() {
return inputVariablesBoolean.values().stream() //
public List<String> getWriteVariablesBoolean() {
return outputVariablesBoolean.values().stream() //
.flatMap(parameterValueMap -> parameterValueMap.keySet().stream()) //
.distinct() //
.collect(Collectors.toList()); //
......
......@@ -71,7 +71,7 @@ public class BPMNVariableBoundaryScanner {
private List<String> getStringVariables() {
List<String> stringVariables = new ArrayList<>();
stringVariables.addAll(formFields.getStringVariables());
stringVariables.addAll(bpmnIOParameters.getInputVariablesString());
stringVariables.addAll(bpmnIOParameters.getWriteVariablesString());
stringVariables.addAll(bpmnIOParameters.getVariables());
stringVariables.addAll(bpmnIOParameters.getHardcodedInputParametersString());
......@@ -81,7 +81,7 @@ public class BPMNVariableBoundaryScanner {
private List<String> getBooleanVariables() {
List<String> booleanVariables = new ArrayList<>();
booleanVariables.addAll(formFields.getBooleanVariables());
booleanVariables.addAll(bpmnIOParameters.getInputVariablesBoolean());
booleanVariables.addAll(bpmnIOParameters.getWriteVariablesBoolean());
booleanVariables.addAll(bpmnIOParameters.getHardcodedInputParametersBoolean());
return booleanVariables;
......@@ -90,7 +90,7 @@ public class BPMNVariableBoundaryScanner {
private List<String> getLongVariables() {
List<String> longVariables = new ArrayList<>();
longVariables.addAll(formFields.getLongVariables());
longVariables.addAll(bpmnIOParameters.getInputVariablesLong());
longVariables.addAll(bpmnIOParameters.getWriteVariablesLong());
longVariables.addAll(bpmnIOParameters.getHardcodedInputParametersLong());
return longVariables;
......
......@@ -220,10 +220,15 @@ public class BPMNVariableIOScanner {
break;
}
if(!removeVars.isEmpty() && removeVars!=null)
if(!setVars.isEmpty() && setVars!=null)
{
// add the removeVariables to BPMNIOParameters via. insertRemoveVariables
removeVars.forEach(var -> this.insertRemoveVariable(baseElement, var));
setVars.forEach((k, v ) -> {
this.insertSetVariable(baseElement, k, v);
});
setVars.forEach((k, v) -> {
System.out.println("[SET] " + k + " value " + v);
});
}
if(!getVars.isEmpty() && getVars!=null)
......@@ -237,15 +242,10 @@ public class BPMNVariableIOScanner {
});
}
if(!setVars.isEmpty() && setVars!=null)
if(!removeVars.isEmpty() && removeVars!=null)
{
setVars.forEach((k, v ) -> {
this.insertSetVariable(baseElement, k, v);
});
setVars.forEach((k, v) -> {
System.out.println("[SET] " + k + " value " + v);
});
// add the removeVariables to BPMNIOParameters via. insertRemoveVariables
removeVars.forEach(var -> this.insertRemoveVariable(baseElement, var));
}
}
catch(Exception e)
......
......@@ -165,33 +165,10 @@ public class ChangeController {
dto[0].setFlows(newFlowDtos);
dto[1].setFlows(oldFlowDtos);
// for (int i=0; i<newFlows.size();i++) {
// System.out.print(newFlowsList.get(i).getName()+" ---");
// try {
// System.out.print(oldFlowsList.get(i).getName()+" ---");
// } catch (Exception e) {
// System.out.print("kein passender Flow gefunden");
// if(oldFlowsList.get(i)==null){
// System.out.println(i);
// }
// }
// System.out.println("");
//
//
// }
} catch (IOException e1) {
e1.printStackTrace();
}
// for (int i=0; i<newFlows.size();i++) {
// System.out.println(matchingFlows[i][0]+" "+matchingFlows[i][1]);
//
// }
return dto;
}
......
......@@ -210,8 +210,7 @@ public class TestService {
HashMap<String, BPMNTestdata<?>> variableTestdata = boundaryScanner.getVariableTestdata();
List<Variable> variables = BPMNParseUtils.getVariables(formFields, variableTestdata, bpmnIOParameters);
if (LOGGER.isInfo()) {
if (LOGGER.isInfo()) {
millisDataEnd = System.currentTimeMillis();
LOGGER.info("Time needed for Data-Scan: " + (millisDataEnd - millisDataStart) + " ms");
}
......@@ -770,10 +769,9 @@ public class TestService {
if (delegate != null) {
List<Variable> readVariables = getReadVariables(flowElement.getId(), bpmnIOParameters, variables, formFields);
List<Variable> writeVariables = getWriteVariables(flowElement.getId(), bpmnIOParameters, variables);
List<Variable> removeVariables = getRemoveVariables(flowElement.getId(), bpmnIOParameters, variables);
// writeVariables.addAll(getSetVariables(flowElement.getId(), bpmnIOParameters, variables));
// System.out.println("Write Vars: " + writeVariables);
int dependencies = readVariables.size() + writeVariables.size();
return TestgeneratorDSLObjectCreator.createDelegateServiceTaskFlowElement(flowElement.getId(),
delegate, readVariables, writeVariables, flowElement.getName(), removeVariables);
......@@ -783,8 +781,6 @@ public class TestService {
List<Variable> inputVariables = getReadVariables(flowElement.getId(), bpmnIOParameters, variables, formFields);
List<Variable> outputVariables = getWriteVariables(flowElement.getId(), bpmnIOParameters, variables);
List<Variable> removeVariables = getRemoveVariables(flowElement.getId(), bpmnIOParameters, variables);
// outputVariables.addAll(getSetVariables(flowElement.getId(), bpmnIOParameters, variables));
// System.out.println("Write Vars: " + outputVariables);
int dependencies = inputVariables.size() + outputVariables.size();
return TestgeneratorDSLObjectCreator.createExternalServiceTaskFlowElement(flowElement.getId(),
externalTopic, hardcodedVariables, flowElement.getName(), inputVariables, outputVariables, removeVariables);
......@@ -843,30 +839,20 @@ public class TestService {
private List<Variable> getReadVariables(String flowElementId, BPMNIOParameters bpmnIOParameters, List<Variable> variables, BPMNFormFields formFields) {
List<String> inputVariableNames = new ArrayList<>();
inputVariableNames.addAll(bpmnIOParameters.getInputVariables(flowElementId));
/*
//Test Flo
inputVariableNames.addAll(formFields.getVariablesForTask(flowElementId));
*/
inputVariableNames.addAll(bpmnIOParameters.getReadVariablesBoolean(flowElementId));
inputVariableNames.addAll(bpmnIOParameters.getReadVariablesInt(flowElementId));
inputVariableNames.addAll(bpmnIOParameters.getReadVariablesString(flowElementId));
List<Variable> inputVariables = filterFlowElementVariables(variables, inputVariableNames);
return inputVariables;
}
private List<Variable> getSetVariables(String flowElementId, BPMNIOParameters bpmnIOParameters, List<Variable> variables) {
List<String> outputVariableNames = new ArrayList<>();
outputVariableNames.addAll(bpmnIOParameters.getOutputVariables(flowElementId));
List<Variable> outputVariables = filterFlowElementVariables(variables, outputVariableNames);
System.out.println("Set vars: " + outputVariables);
return outputVariables;
}
private List<Variable> getWriteVariables(String flowElementId, BPMNIOParameters bpmnIOParameters, List<Variable> variables) {
List<String> writeVariableNames = new ArrayList<>();
writeVariableNames.addAll(bpmnIOParameters.getOutputVariables(flowElementId));
writeVariableNames.addAll(bpmnIOParameters.getExpressionInputVariables(flowElementId));
writeVariableNames.addAll(bpmnIOParameters.getExpressionWriteVariables(flowElementId));
List<Variable> writeVariables = filterFlowElementVariables(variables, writeVariableNames);
return writeVariables;
}
......
......@@ -158,10 +158,9 @@ public class BPMNParseUtils {
HashMap<String, List<String>> outputList = bpmnIOParameters.getOutputParameters();
List<String> hardcodedList = bpmnIOParameters.getHardcodedInputParameters();
List<Variable> variables = new ArrayList<>();
List<StringVariable> stringVariables = Stream.concat(Stream.concat(Stream.concat(//
List<StringVariable> stringVariables = Stream.concat(Stream.concat(//
formFields.getStringVariables().stream(), //
bpmnIOParameters.getVariables().stream()), //
bpmnIOParameters.getInputVariablesString().stream()), //
bpmnIOParameters.getWriteVariablesString().stream()), //
bpmnIOParameters.getHardcodedInputParametersString().stream()) //
.distinct() //
.map(s -> TestgeneratorDSLObjectCreator.createStringVariable(s,
......@@ -174,7 +173,7 @@ public class BPMNParseUtils {
// .collect(Collectors.toList());
List<IntVariable> longVariables = Stream.concat(Stream.concat( //
formFields.getLongVariables().stream(), //
bpmnIOParameters.getInputVariablesLong().stream()),
bpmnIOParameters.getWriteVariablesLong().stream()),
bpmnIOParameters.getHardcodedInputParametersLong().stream() //
) //
.map(i -> TestgeneratorDSLObjectCreator.createIntVariable(i,
......@@ -183,7 +182,7 @@ public class BPMNParseUtils {
List<BooleanVariable> booleanVariables = Stream.concat(Stream.concat(//
formFields.getBooleanVariables().stream(), //
bpmnIOParameters.getHardcodedInputParametersBoolean().stream()),
bpmnIOParameters.getInputVariablesBoolean().stream()//
bpmnIOParameters.getWriteVariablesBoolean().stream()//
) //
.map(b -> TestgeneratorDSLObjectCreator.createBooleanVariable(b,
getProposals(b, variableTestdata.get(b), Boolean.class))) //
......@@ -251,8 +250,25 @@ public class BPMNParseUtils {
}
variables.addAll(stringVariables);
List<Variable> allVariables = bpmnIOParameters.getVariables().stream().distinct() //
.map(s -> TestgeneratorDSLObjectCreator.createStringVariable(s,
getProposals(s, variableTestdata.get(s), String.class))) //
.collect(Collectors.toList());
List<String> varNames = new ArrayList<String>();
for(Variable var: variables) {
varNames.add(var.getName());
}
for(Variable var: allVariables) {
if(!varNames.contains(var.getName())) {
variables.add(var);
}
}
variables.addAll(longVariables);
variables.addAll(booleanVariables);
return variables;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment