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

fixed activityChangeOrder

parent 89d3e81e
No related branches found
No related tags found
No related merge requests found
......@@ -1216,12 +1216,18 @@ public class MigrationService {
int index = 0;
for(FlowElement oe : cleanedOldFlow) {
if(cleanedNewFlow.get(index) != null) {
if(!cleanedNewFlow.get(index).getName().equals(oe.getName())) {
//Reihenfolge passt nicht mehr
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_ORDER, oe));
try {
if(cleanedNewFlow.get(index) != null) {
if(!cleanedNewFlow.get(index).getName().equals(oe.getName())) {
//Reihenfolge passt nicht mehr
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_ORDER, oe));
}
}
}
catch(IndexOutOfBoundsException e) {
}
index++;
}
......@@ -1419,47 +1425,53 @@ public class MigrationService {
int index = 0;
for(FlowElement oe : cleanedOldFlow) {
if((cleanedNewFlow.get(index) != null) && cleanedNewFlow.get(index).getName().equals(oe.getName())) {
//Fall: Änderung von X nach X
if(!(oe instanceof UserTaskFlowElement) && !(cleanedNewFlow.get(index) instanceof UserTaskFlowElement)) {
//ManualTaskFlowElement | ScriptTaskFlowElement | ServiceTaskFlowElement | BusinessRuleTaskFlowElement
boolean foundChangedType = false;
if((oe instanceof ManualTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ManualTaskFlowElement)) ||
(oe instanceof ScriptTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ScriptTaskFlowElement)) ||
(oe instanceof ServiceTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ServiceTaskFlowElement)) ||
(oe instanceof BusinessRuleTaskFlowElement && !(cleanedNewFlow.get(index) instanceof BusinessRuleTaskFlowElement))) {
foundChangedType = true;
try {
if((cleanedNewFlow.get(index) != null) && cleanedNewFlow.get(index).getName().equals(oe.getName())) {
//Fall: Änderung von X nach X
if(!(oe instanceof UserTaskFlowElement) && !(cleanedNewFlow.get(index) instanceof UserTaskFlowElement)) {
//ManualTaskFlowElement | ScriptTaskFlowElement | ServiceTaskFlowElement | BusinessRuleTaskFlowElement
boolean foundChangedType = false;
if((oe instanceof ManualTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ManualTaskFlowElement)) ||
(oe instanceof ScriptTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ScriptTaskFlowElement)) ||
(oe instanceof ServiceTaskFlowElement && !(cleanedNewFlow.get(index) instanceof ServiceTaskFlowElement)) ||
(oe instanceof BusinessRuleTaskFlowElement && !(cleanedNewFlow.get(index) instanceof BusinessRuleTaskFlowElement))) {
foundChangedType = true;
}
if(foundChangedType) {
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_XTASK,
oe));
}
}
if(foundChangedType) {
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_XTASK,
//Fall: Änderung von UserTask nach X
if(oe instanceof UserTaskFlowElement && !(cleanedNewFlow.get(index) instanceof UserTaskFlowElement)) {
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_TYPE_FROM_USERTASK_TO_XTASK,
oe));
}
}
//Fall: Änderung von UserTask nach X
if(oe instanceof UserTaskFlowElement && !(cleanedNewFlow.get(index) instanceof UserTaskFlowElement)) {
result.add(this.prepareFlowChangeWrapper(flowNew, ActionType.ACTIVITY_CHANGE_TYPE_FROM_USERTASK_TO_XTASK,
oe));
}
//Fall: Änderung von X nach UserTask
if(!(oe instanceof UserTaskFlowElement) && cleanedNewFlow.get(index) instanceof UserTaskFlowElement) {
FlowElement newElement = cleanedNewFlow.get(index);
boolean hasRequiredField = this.checkIfElementHasRequiredFields(newElement);
if(hasRequiredField) {
result.add(this.prepareFlowChangeWrapper(flowNew,
ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_USERTASK_REQUIRED,
newElement));
}
else {
result.add(this.prepareFlowChangeWrapper(flowNew,
ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_USERTASK_NOT_REQUIRED,
newElement));
}
//Fall: Änderung von X nach UserTask
if(!(oe instanceof UserTaskFlowElement) && cleanedNewFlow.get(index) instanceof UserTaskFlowElement) {
FlowElement newElement = cleanedNewFlow.get(index);
boolean hasRequiredField = this.checkIfElementHasRequiredFields(newElement);
if(hasRequiredField) {
result.add(this.prepareFlowChangeWrapper(flowNew,
ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_USERTASK_REQUIRED,
newElement));
}
else {
result.add(this.prepareFlowChangeWrapper(flowNew,
ActionType.ACTIVITY_CHANGE_TYPE_FROM_XTASK_TO_USERTASK_NOT_REQUIRED,
newElement));
}
}
}
}
catch(IndexOutOfBoundsException e) {
}
index++;
}
......
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