Skip to content
Snippets Groups Projects
Commit 5c5bb640 authored by Florian Lambers's avatar Florian Lambers
Browse files

added flag to activity

parent 848c2c1a
No related branches found
No related tags found
No related merge requests found
......@@ -651,7 +651,12 @@ public class MatchingTestcollectionOld {
@Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"})
public void casetill1() {
ProcessInstance processInstance = runtimeService() //
.startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "123")); //
assertThat(processInstance) //
.isStarted() //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......@@ -691,6 +696,7 @@ public class MatchingTestcollectionOld {
complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0));
assertThat(processInstance) //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......@@ -727,6 +733,7 @@ public class MatchingTestcollectionOld {
complete(task(UserTasks.MANUELLE_PRUEFUNG));
assertThat(processInstance) //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......@@ -763,6 +770,7 @@ public class MatchingTestcollectionOld {
complete(task(UserTasks.PAKET_PACKEN));
assertThat(processInstance) //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......@@ -799,6 +807,7 @@ public class MatchingTestcollectionOld {
complete(task(UserTasks.PAKET_PRUEFEN));
assertThat(processInstance) //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......@@ -835,6 +844,7 @@ public class MatchingTestcollectionOld {
complete(task(UserTasks.PAKET_SENDEN));
assertThat(processInstance) //
.hasPassed(Events.RETOURE_START) //
.hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) //
.hasPassed(Gateways.GATEWAY_BESCHAEDIGT) //
.hasPassed(ManualTasks.WARE_EINSORTIEREN) //
......
......@@ -24,9 +24,11 @@ import de.fhmuenster.masterthesis.testgeneratorDSL.Flow;
import de.fhmuenster.masterthesis.testgeneratorDSL.FlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.FlowElementReference;
import de.fhmuenster.masterthesis.testgeneratorDSL.ManualTaskFlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.MockReference;
import de.fhmuenster.masterthesis.testgeneratorDSL.UserTaskFlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.SequenceFlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.ServiceTaskFlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.TestgeneratorDSLFactory;
import de.fhmuenster.masterthesis.testgeneratorDSL.BusinessRuleTaskFlowElement;
import de.fhmuenster.masterthesis.testgeneratorDSL.Flag;
import de.fhmuenster.masterthesis.utils.TestgeneratorDSLUtils;
......@@ -66,16 +68,29 @@ public class MigrationService {
+ " mit Status: " + fcw.getMigrationResult().getPriority());
try {
//"maximalen" Flag-Wert noch ermitteln, jetzt erstmal nur YELLOW als Standard
newDSL.getFlow(fcw.getFlow().getName()).setFlag(Flag.YELLOW);
List<FlowElementReference> fers = newDSL.getFlow(fcw.getFlow().getName()).getInclElements();
EList<FlowElementReference> inclElements = newDSL.getFlow(fcw.getFlow().getName()).getInclElements();
for(FlowElementReference fer : fers) {
fer.setFlag(Flag.GREEN);
System.out.println(fer.getRef().getName());
for(FlowElementReference elementReference : inclElements) {
if(elementReference.getRef().getName().equals(fcw.getFlowElement().getName())) {
elementReference.setFlag(this.convertMigrationResultToFlag(fcw.getMigrationResult().getStatus()));
}
}
//fers.clear();
//fers.addAll(fers);
//newDSL.updateInclElements(fers);
//fcw.getFlow().getInclElements().addAll(newDSL.updateInclElements(fers, fcw.getFlow().getName()));
//fcw.getFlow().getInclElements().addAll(newDSL.updateInclElements(fers, fcw.getFlow().getName()));
//newDSL.updateInclElements(fers, fcw.getFlow().getName());
//newDSL.getFlow(fcw.getFlow().getName()).getInclElements().clear();
//newDSL.getFlow(fcw.getFlow().getName()).getInclElements().replaceAll(fers);
......@@ -194,6 +209,19 @@ public class MigrationService {
}
}
private Flag convertMigrationResultToFlag(MigrationResultStatus status) {
switch(status) {
case GREEN:
return Flag.GREEN;
case YELLOW:
return Flag.YELLOW;
case RED:
return Flag.RED;
default:
return Flag.GREEN;
}
}
public MigrationResultWrapperDTO convertMigrationResultWrapper(MigrationResultWrapper wrapper) {
MigrationResultWrapperDTO dto = new MigrationResultWrapperDTO();
dto = wrapper.convertToDTO();
......
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