TSK-1390: Review findings

This commit is contained in:
Joerg Heffner 2020-09-22 15:07:44 +02:00 committed by gitgoodjhe
parent 198572b6b1
commit 0e83abd0fd
8 changed files with 16 additions and 14 deletions

View File

@ -5,7 +5,7 @@ import org.apache.ibatis.session.SqlSession;
import pro.taskana.common.api.TaskanaEngine;
import pro.taskana.spi.history.internal.HistoryEventManager;
import pro.taskana.spi.taskpreprocessing.internal.CreateTaskPreprocessorManager;
import pro.taskana.spi.task.internal.CreateTaskPreprocessorManager;
import pro.taskana.task.internal.TaskRoutingManager;
/**

View File

@ -50,7 +50,7 @@ import pro.taskana.monitor.api.MonitorService;
import pro.taskana.monitor.internal.MonitorMapper;
import pro.taskana.monitor.internal.MonitorServiceImpl;
import pro.taskana.spi.history.internal.HistoryEventManager;
import pro.taskana.spi.taskpreprocessing.internal.CreateTaskPreprocessorManager;
import pro.taskana.spi.task.internal.CreateTaskPreprocessorManager;
import pro.taskana.task.api.TaskService;
import pro.taskana.task.internal.AttachmentMapper;
import pro.taskana.task.internal.ObjectReferenceMapper;

View File

@ -1,4 +1,4 @@
package pro.taskana.spi.taskpreprocessing.api;
package pro.taskana.spi.task.api;
import pro.taskana.task.api.models.Task;

View File

@ -1,11 +1,11 @@
package pro.taskana.spi.taskpreprocessing.internal;
package pro.taskana.spi.task.internal;
import java.util.Objects;
import java.util.ServiceLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pro.taskana.spi.taskpreprocessing.api.CreateTaskPreprocessor;
import pro.taskana.spi.task.api.CreateTaskPreprocessor;
import pro.taskana.task.api.models.Task;
public class CreateTaskPreprocessorManager {

View File

@ -42,7 +42,7 @@ import pro.taskana.spi.history.api.events.task.TaskCreatedEvent;
import pro.taskana.spi.history.api.events.task.TaskTerminatedEvent;
import pro.taskana.spi.history.api.events.task.TaskUpdatedEvent;
import pro.taskana.spi.history.internal.HistoryEventManager;
import pro.taskana.spi.taskpreprocessing.internal.CreateTaskPreprocessorManager;
import pro.taskana.spi.task.internal.CreateTaskPreprocessorManager;
import pro.taskana.task.api.CallbackState;
import pro.taskana.task.api.TaskCustomField;
import pro.taskana.task.api.TaskQuery;
@ -176,7 +176,13 @@ public class TaskServiceImpl implements TaskService {
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
TaskAlreadyExistException, InvalidArgumentException {
LOGGER.debug("entry to createTask(task = {})", taskToCreate);
if (CreateTaskPreprocessorManager.isCreateTaskPreprocessorEnabled()) {
taskToCreate = createTaskPreprocessorManager.processTaskBeforeCreation(taskToCreate);
}
TaskImpl task = (TaskImpl) taskToCreate;
try {
taskanaEngine.openConnection();
@ -211,11 +217,7 @@ public class TaskServiceImpl implements TaskService {
workbasketService.checkAuthorization(
task.getWorkbasketSummary().getId(), WorkbasketPermission.APPEND);
if (CreateTaskPreprocessorManager.isCreateTaskPreprocessorEnabled()) {
task = (TaskImpl) createTaskPreprocessorManager.processTaskBeforeCreation(task);
}
// we do use the key and not the ID to make sure that we use the classification from the right
// domain.
// otherwise we would have to check the classification and its domain for validity.

View File

@ -1,6 +1,6 @@
package acceptance.taskpreprocessing;
import pro.taskana.spi.taskpreprocessing.api.CreateTaskPreprocessor;
import pro.taskana.spi.task.api.CreateTaskPreprocessor;
import pro.taskana.task.api.TaskCustomField;
import pro.taskana.task.api.models.Task;

View File

@ -46,8 +46,8 @@ class ArchitectureTest {
"pro.taskana.workbasket.api",
"pro.taskana.workbasket.internal",
"pro.taskana.spi.routing.api",
"pro.taskana.spi.taskpreprocessing.api",
"pro.taskana.spi.taskpreprocessing.internal"
"pro.taskana.spi.task.api",
"pro.taskana.spi.task.internal"
);
private static JavaClasses importedClasses;