From 87de70f022f03cd533cdabd2a824a9cc463c51b2 Mon Sep 17 00:00:00 2001 From: Joerg Heffner <56156750+gitgoodjhe@users.noreply.github.com> Date: Thu, 17 Sep 2020 12:59:17 +0200 Subject: [PATCH] TSK-1385: Custom1-4 of TaskHistoryEvents is not filled with the custom fields of the tasks anymore --- .../api/events/task/TaskHistoryEvent.java | 94 ++++++++++--------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/events/task/TaskHistoryEvent.java b/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/events/task/TaskHistoryEvent.java index 7c9150567..beaaab955 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/events/task/TaskHistoryEvent.java +++ b/lib/taskana-core/src/main/java/pro/taskana/spi/history/api/events/task/TaskHistoryEvent.java @@ -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