TSK-1385: Custom1-4 of TaskHistoryEvents is not filled with the custom fields of the tasks anymore

This commit is contained in:
Joerg Heffner 2020-09-17 12:59:17 +02:00 committed by gitgoodjhe
parent 220a64462f
commit 87de70f022
1 changed files with 52 additions and 42 deletions

View File

@ -4,7 +4,6 @@ import java.time.Instant;
import java.util.Objects;
import pro.taskana.common.api.exceptions.SystemException;
import pro.taskana.task.api.TaskCustomField;
import pro.taskana.task.api.models.TaskSummary;
/** Super class for all task related events. */
@ -61,10 +60,6 @@ public class TaskHistoryEvent {
porType = task.getPrimaryObjRef().getType();
porValue = task.getPrimaryObjRef().getValue();
}
custom1 = task.getCustomAttribute(TaskCustomField.CUSTOM_1);
custom2 = task.getCustomAttribute(TaskCustomField.CUSTOM_2);
custom3 = task.getCustomAttribute(TaskCustomField.CUSTOM_3);
custom4 = task.getCustomAttribute(TaskCustomField.CUSTOM_4);
}
public void setCustomAttribute(TaskHistoryCustomField customField, String value) {
@ -261,6 +256,35 @@ public class TaskHistoryEvent {
this.details = details;
}
@Override
public int hashCode() {
return Objects.hash(
getId(),
getBusinessProcessId(),
getParentBusinessProcessId(),
getTaskId(),
getEventType(),
getCreated(),
getUserId(),
getDomain(),
getWorkbasketKey(),
getPorCompany(),
getPorSystem(),
getPorInstance(),
getPorType(),
getPorValue(),
getTaskClassificationKey(),
getTaskClassificationCategory(),
getAttachmentClassificationKey(),
getOldValue(),
getNewValue(),
custom1,
custom2,
custom3,
custom4,
getDetails());
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
@ -271,43 +295,29 @@ public class TaskHistoryEvent {
}
TaskHistoryEvent other = (TaskHistoryEvent) obj;
return Objects.equals(getId(), other.getId())
&& Objects.equals(getBusinessProcessId(), other.getBusinessProcessId())
&& Objects
.equals(getParentBusinessProcessId(), other.getParentBusinessProcessId())
&& Objects.equals(getTaskId(), other.getTaskId())
&& Objects.equals(getEventType(), other.getEventType())
&& Objects.equals(getCreated(), other.getCreated())
&& Objects.equals(getUserId(), other.getUserId())
&& Objects.equals(getDomain(), other.getDomain())
&& Objects.equals(getWorkbasketKey(), other.getWorkbasketKey())
&& Objects.equals(getPorCompany(), other.getPorCompany())
&& Objects.equals(getPorSystem(), other.getPorSystem())
&& Objects.equals(getPorInstance(), other.getPorInstance())
&& Objects.equals(getPorType(), other.getPorType())
&& Objects.equals(getPorValue(), other.getPorValue())
&& Objects
.equals(getTaskClassificationKey(), other.getTaskClassificationKey())
&& Objects
.equals(getTaskClassificationCategory(),
other.getTaskClassificationCategory())
&& Objects.equals(getAttachmentClassificationKey(),
other.getAttachmentClassificationKey())
&& Objects.equals(getOldValue(), other.getOldValue())
&& Objects.equals(getNewValue(), other.getNewValue())
&& Objects.equals(custom1, other.custom1)
&& Objects.equals(custom2, other.custom2)
&& Objects.equals(custom3, other.custom3)
&& Objects.equals(custom4, other.custom4)
&& Objects.equals(getDetails(), other.getDetails());
}
@Override
public int hashCode() {
return Objects.hash(getId(), getBusinessProcessId(), getParentBusinessProcessId(), getTaskId(),
getEventType(), getCreated(), getUserId(), getDomain(), getWorkbasketKey(), getPorCompany(),
getPorSystem(), getPorInstance(), getPorType(), getPorValue(), getTaskClassificationKey(),
getTaskClassificationCategory(), getAttachmentClassificationKey(), getOldValue(),
getNewValue(), custom1, custom2, custom3, custom4, getDetails());
&& Objects.equals(getBusinessProcessId(), other.getBusinessProcessId())
&& Objects.equals(getParentBusinessProcessId(), other.getParentBusinessProcessId())
&& Objects.equals(getTaskId(), other.getTaskId())
&& Objects.equals(getEventType(), other.getEventType())
&& Objects.equals(getCreated(), other.getCreated())
&& Objects.equals(getUserId(), other.getUserId())
&& Objects.equals(getDomain(), other.getDomain())
&& Objects.equals(getWorkbasketKey(), other.getWorkbasketKey())
&& Objects.equals(getPorCompany(), other.getPorCompany())
&& Objects.equals(getPorSystem(), other.getPorSystem())
&& Objects.equals(getPorInstance(), other.getPorInstance())
&& Objects.equals(getPorType(), other.getPorType())
&& Objects.equals(getPorValue(), other.getPorValue())
&& Objects.equals(getTaskClassificationKey(), other.getTaskClassificationKey())
&& Objects.equals(getTaskClassificationCategory(), other.getTaskClassificationCategory())
&& Objects.equals(getAttachmentClassificationKey(), other.getAttachmentClassificationKey())
&& Objects.equals(getOldValue(), other.getOldValue())
&& Objects.equals(getNewValue(), other.getNewValue())
&& Objects.equals(custom1, other.custom1)
&& Objects.equals(custom2, other.custom2)
&& Objects.equals(custom3, other.custom3)
&& Objects.equals(custom4, other.custom4)
&& Objects.equals(getDetails(), other.getDetails());
}
@Override