diff --git a/lib/taskana-core/src/main/java/pro/taskana/Task.java b/lib/taskana-core/src/main/java/pro/taskana/Task.java index 66bd6adf0..1e5abf3fe 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/Task.java +++ b/lib/taskana-core/src/main/java/pro/taskana/Task.java @@ -216,20 +216,35 @@ public interface Task { boolean isTransferred(); /** - * Returns a collection of customAttributes with a max. amount of 10 entries. + * Returns a Map of custom Attributes. * * @return customAttributes as {@link Map} */ Map getCustomAttributes(); /** - * Sets a collection of customAttributes. + * Sets a Map of custom Attributes. * * @param customAttributes * a {@link Map} that contains the custom attributes */ void setCustomAttributes(Map customAttributes); + /** + * Returns a Map of Callback info. + * + * @return callbackInfo as {@link Map} + */ + Map getCallbackInfo(); + + /** + * Sets a Map of callback info. + * + * @param callbackInfo + * a {@link Map} that contains the callback info + */ + void setCallbackInfo(Map callbackInfo); + /** * Return the value for custom Attribute number num. * diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationServiceImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationServiceImpl.java index 6a803e760..9ebb2c177 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationServiceImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/ClassificationServiceImpl.java @@ -1,5 +1,6 @@ package pro.taskana.impl; +import java.sql.SQLIntegrityConstraintViolationException; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -364,7 +365,8 @@ public class ClassificationServiceImpl implements ClassificationService { if (classification.getDomain().equals("")) { // master mode - delete all associated classifications in every domain. List classificationsInDomain = createClassificationQuery() - .keyIn(classification.getKey()).list(); + .keyIn(classification.getKey()) + .list(); for (ClassificationSummary classificationInDomain : classificationsInDomain) { if (!"".equals(classificationInDomain.getDomain())) { deleteClassification(classificationInDomain.getId()); @@ -393,9 +395,10 @@ public class ClassificationServiceImpl implements ClassificationService { } private boolean isReferentialIntegrityConstraintViolation(PersistenceException e) { - // DB2 check missing - return (e.getCause().getClass().getName().equals("org.h2.jdbc.JdbcSQLException") - && e.getMessage().contains("23503")); + return ((e.getCause().getClass().getName().equals("org.h2.jdbc.JdbcSQLException") + && e.getMessage().contains("23503")) + || (e.getCause() instanceof SQLIntegrityConstraintViolationException + && e.getMessage().contains("-532"))); } } diff --git a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskImpl.java b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskImpl.java index 011475e2c..de7a09e25 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/impl/TaskImpl.java +++ b/lib/taskana-core/src/main/java/pro/taskana/impl/TaskImpl.java @@ -44,6 +44,7 @@ public class TaskImpl implements Task { private boolean isTransferred; // All objects have to be serializable private Map customAttributes = Collections.emptyMap(); + private Map callbackInfo = Collections.emptyMap(); private List attachments = new ArrayList<>(); private String custom1; private String custom2; @@ -311,6 +312,16 @@ public class TaskImpl implements Task { this.customAttributes = customAttributes; } + @Override + public Map getCallbackInfo() { + return callbackInfo; + } + + @Override + public void setCallbackInfo(Map callbackInfo) { + this.callbackInfo = callbackInfo; + } + @Override public String getCustomAttribute(String number) throws InvalidArgumentException { int num = 0; @@ -718,6 +729,8 @@ public class TaskImpl implements Task { builder.append(isTransferred); builder.append(", customAttributes="); builder.append(customAttributes); + builder.append(", callbackInfo="); + builder.append(callbackInfo); builder.append(", attachments="); builder.append(attachments); builder.append(", custom1="); @@ -784,6 +797,7 @@ public class TaskImpl implements Task { result = prime * result + ((custom8 == null) ? 0 : custom8.hashCode()); result = prime * result + ((custom9 == null) ? 0 : custom9.hashCode()); result = prime * result + ((customAttributes == null) ? 0 : customAttributes.hashCode()); + result = prime * result + ((callbackInfo == null) ? 0 : callbackInfo.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((due == null) ? 0 : due.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); @@ -982,6 +996,13 @@ public class TaskImpl implements Task { } else if (!customAttributes.equals(other.customAttributes)) { return false; } + if (callbackInfo == null) { + if (other.callbackInfo != null) { + return false; + } + } else if (!callbackInfo.equals(other.callbackInfo)) { + return false; + } if (description == null) { if (other.description != null) { return false; diff --git a/lib/taskana-core/src/main/java/pro/taskana/mappings/TaskMapper.java b/lib/taskana-core/src/main/java/pro/taskana/mappings/TaskMapper.java index 392eabc76..1b152889a 100644 --- a/lib/taskana-core/src/main/java/pro/taskana/mappings/TaskMapper.java +++ b/lib/taskana-core/src/main/java/pro/taskana/mappings/TaskMapper.java @@ -13,7 +13,6 @@ import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.apache.ibatis.type.JdbcType; -import pro.taskana.TaskState; import pro.taskana.impl.MinimalTaskSummary; import pro.taskana.impl.TaskImpl; import pro.taskana.impl.TaskSummaryImpl; @@ -24,7 +23,7 @@ import pro.taskana.impl.persistence.MapTypeHandler; */ public interface TaskMapper { - @Select("") void deleteMultiple(@Param("ids") List ids); - @Select("") - @Results(value = { - @Result(property = "taskId", column = "ID"), - @Result(property = "created", column = "CREATED"), - @Result(property = "claimed", column = "CLAIMED"), - @Result(property = "completed", column = "COMPLETED"), - @Result(property = "modified", column = "MODIFIED"), - @Result(property = "planned", column = "PLANNED"), - @Result(property = "due", column = "DUE"), - @Result(property = "name", column = "NAME"), - @Result(property = "creator", column = "CREATOR"), - @Result(property = "note", column = "NOTE"), - @Result(property = "priority", column = "PRIORITY"), - @Result(property = "state", column = "STATE"), - @Result(property = "classificationSummaryImpl.category", column = "CLASSIFICATION_CATEGORY"), - @Result(property = "classificationSummaryImpl.key", column = "CLASSIFICATION_KEY"), - @Result(property = "classificationSummaryImpl.id", column = "CLASSIFICATION_ID"), - @Result(property = "workbasketSummaryImpl.id", column = "WORKBASKET_ID"), - @Result(property = "workbasketSummaryImpl.key", column = "WORKBASKET_KEY"), - @Result(property = "workbasketSummaryImpl.domain", column = "DOMAIN"), - @Result(property = "domain", column = "DOMAIN"), - @Result(property = "businessProcessId", column = "BUSINESS_PROCESS_ID"), - @Result(property = "parentBusinessProcessId", column = "PARENT_BUSINESS_PROCESS_ID"), - @Result(property = "owner", column = "OWNER"), - @Result(property = "primaryObjRef.company", column = "POR_COMPANY"), - @Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), - @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), - @Result(property = "primaryObjRef.type", column = "POR_TYPE"), - @Result(property = "primaryObjRef.value", column = "POR_VALUE"), - @Result(property = "isRead", column = "IS_READ"), - @Result(property = "isTransferred", column = "IS_TRANSFERRED"), - @Result(property = "custom1", column = "CUSTOM_1"), - @Result(property = "custom2", column = "CUSTOM_2"), - @Result(property = "custom3", column = "CUSTOM_3"), - @Result(property = "custom4", column = "CUSTOM_4"), - @Result(property = "custom5", column = "CUSTOM_5"), - @Result(property = "custom6", column = "CUSTOM_6"), - @Result(property = "custom7", column = "CUSTOM_7"), - @Result(property = "custom8", column = "CUSTOM_8"), - @Result(property = "custom9", column = "CUSTOM_9"), - @Result(property = "custom10", column = "CUSTOM_10"), - @Result(property = "custom11", column = "CUSTOM_11"), - @Result(property = "custom12", column = "CUSTOM_12"), - @Result(property = "custom13", column = "CUSTOM_13"), - @Result(property = "custom14", column = "CUSTOM_14"), - @Result(property = "custom15", column = "CUSTOM_15"), - @Result(property = "custom16", column = "CUSTOM_16")}) - List findTasksByWorkbasketIdAndState(@Param("workbasketKey") String workbasketKey, - @Param("taskState") TaskState taskState); - @Select("