diff --git a/common/taskana-common-data/src/main/resources/sql/test-data/task-comment.sql b/common/taskana-common-data/src/main/resources/sql/test-data/task-comment.sql index 57eb4a37b..656782ff1 100644 --- a/common/taskana-common-data/src/main/resources/sql/test-data/task-comment.sql +++ b/common/taskana-common-data/src/main/resources/sql/test-data/task-comment.sql @@ -11,8 +11,8 @@ INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000005', 'TKI INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000006', 'TKI:000000000000000000000000000000000002', 'some text in textfield', 'user-1-1', '2018-01-29 15:55:00', '2018-01-30 15:55:00'); INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000007', 'TKI:000000000000000000000000000000000002', 'some other text in textfield', 'user-1-1', '2018-01-29 15:55:00', '2018-01-30 15:55:00'); -- TaskComments for CreateTaskCommentAccTest -INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000008', 'TKI:000000000000000000000000000000000026', 'some text in textfield', 'user_1_1', '2016-01-29 15:55:00', '2030-01-30 15:55:00'); -INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000009', 'TKI:000000000000000000000000000000000026', 'some other text in textfield', 'user_1_1', '2015-01-29 15:55:00', '2000-01-30 15:55:00'); -INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000010', 'TKI:000000000000000000000000000000000027', 'some text in textfield', 'user_1_1', '2020-01-29 15:55:00', '2024-01-30 15:55:00'); -INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000011', 'TKI:000000000000000000000000000000000027', 'some other text in textfield', 'user_1_1', '2018-01-29 15:55:00', '1988-01-30 15:55:00'); -INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000012', 'TKI:000000000000000000000000000000000004', 'some text in textfield', 'user_1_1', '2017-01-29 15:55:00', '2018-01-30 15:55:00'); +INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000008', 'TKI:000000000000000000000000000000000026', 'some text in textfield', 'user-b-1', '2016-01-29 15:55:00', '2030-01-30 15:55:00'); +INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000009', 'TKI:000000000000000000000000000000000026', 'some other text in textfield', 'user-1-1', '2015-01-29 15:55:00', '2000-01-30 15:55:00'); +INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000010', 'TKI:000000000000000000000000000000000027', 'some text in textfield', 'user-1-1', '2020-01-29 15:55:00', '2024-01-30 15:55:00'); +INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000011', 'TKI:000000000000000000000000000000000027', 'some other text in textfield', 'user-1-1', '2018-01-29 15:55:00', '1988-01-30 15:55:00'); +INSERT INTO TASK_COMMENT VALUES('TCI:000000000000000000000000000000000012', 'TKI:000000000000000000000000000000000004', 'some text in textfield', 'user-1-1', '2017-01-29 15:55:00', '2018-01-30 15:55:00'); diff --git a/common/taskana-common-data/src/main/resources/sql/test-data/task-history-event.sql b/common/taskana-common-data/src/main/resources/sql/test-data/task-history-event.sql index 00b5fa39b..3cf5cf81c 100644 --- a/common/taskana-common-data/src/main/resources/sql/test-data/task-history-event.sql +++ b/common/taskana-common-data/src/main/resources/sql/test-data/task-history-event.sql @@ -1,17 +1,18 @@ -INSERT INTO TASK_HISTORY_EVENT (ID,BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, TASK_ID, EVENT_TYPE, CREATED, USER_ID, DOMAIN, WORKBASKET_KEY, POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, TASK_CLASSIFICATION_KEY, +INSERT INTO TASK_HISTORY_EVENT (ID,BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, TASK_ID, EVENT_TYPE, CREATED, USER_ID, DOMAIN, WORKBASKET_KEY, POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, TASK_OWNER, TASK_CLASSIFICATION_KEY, TASK_CLASSIFICATION_CATEGORY, ATTACHMENT_CLASSIFICATION_KEY, OLD_VALUE, NEW_VALUE, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, DETAILS) VALUES -- BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, TASK_ID, EVENT_TYPE, CREATED, USER_ID, DOMAIN, WORKBASKET_KEY, POR_COMPANY , POR_SYSTEM, POR_INSTANCE , POR_TYPE , POR_VALUE , TASK_CLASSIFICATION_KEY, TASK_CLASSIFICATION_CATEGORY , ATTACHMENT_CLASSIFICATION_KEY , OLD_VALUE , NEW_VALUE , CUSTOM_1 , CUSTOM_2 , CUSTOM_3 , CUSTOM_4, details -('THI:000000000000000000000000000000000000','BPI:01' ,'' ,'TKI:000000000000000000000000000000000000', 'UPDATED', '2018-01-29 15:55:00' , 'admin', 'DOMAIN_B', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'L140101' , 'TASK' ,'' ,'old_val' ,'new_val' ,'custom1' ,'custom2' , 'custom3' ,'custom4', '{"changes":[{"newValue":"BPI:01","fieldName":"businessProcessId","oldValue":"BPI:02"},{"newValue":"admin","fieldName":"owner","oldValue":"owner1"}]}' ), -('THI:000000000000000000000000000000000001','BPI:02' ,'' ,'TKI:000000000000000000000000000000000000', 'CREATED', '2018-01-29 15:55:01','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000002','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000036','CREATED', '2018-01-29 15:55:02' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000003','BPI:02' ,'' ,'TKI:000000000000000000000000000000000036', 'CREATED', '2018-01-29 15:55:03','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000004','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000037','CREATED', '2018-01-29 15:55:04' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000005','BPI:02' ,'' ,'TKI:000000000000000000000000000000000038', 'CREATED', '2018-01-29 15:55:05','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000006','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000038','CREATED', '2018-01-29 15:55:06' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000007','BPI:02' ,'' ,'TKI:000000000000000000000000000000000039', 'CREATED', '2018-01-29 15:55:07','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000008','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000039','CREATED', '2018-01-29 15:55:08' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000009','BPI:02' ,'' ,'TKI:000000000000000000000000000000000040', 'CREATED', '2018-01-29 15:55:09','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000010','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000040','CREATED', '2018-01-29 15:55:10' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000011','BPI:02' ,'' ,'TKI:000000000000000000000000000000000066', 'CREATED', '2018-01-29 15:55:11','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), -('THI:000000000000000000000000000000000012','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000066','CREATED', '2018-01-29 15:55:12' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ) +('THI:000000000000000000000000000000000000','BPI:01' ,'' ,'TKI:000000000000000000000000000000000000', 'UPDATED', '2018-01-29 15:55:00' , 'user-1-1', 'DOMAIN_B', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-1', 'L140101' , 'TASK' ,'' ,'old_val' ,'new_val' ,'custom1' ,'custom2' , 'custom3' ,'custom4', '{"changes":[{"newValue":"BPI:01","fieldName":"businessProcessId","oldValue":"BPI:02"},{"newValue":"user-1-1","fieldName":"owner","oldValue":"owner1"}]}' ), +('THI:000000000000000000000000000000000001','BPI:02' ,'' ,'TKI:000000000000000000000000000000000000', 'CREATED', '2018-01-29 15:55:01','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-1', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000002','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000036','CREATED', '2018-01-29 15:55:02' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-2', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000003','BPI:02' ,'' ,'TKI:000000000000000000000000000000000036', 'CREATED', '2018-01-29 15:55:03','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-2', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000004','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000037','CREATED', '2018-01-29 15:55:04' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-2', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000005','BPI:02' ,'' ,'TKI:000000000000000000000000000000000038', 'CREATED', '2018-01-29 15:55:05','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-2', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000006','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000038','CREATED', '2018-01-29 15:55:06' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-2', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000007','BPI:02' ,'' ,'TKI:000000000000000000000000000000000039', 'CREATED', '2018-01-29 15:55:07','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-2', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000008','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000039','CREATED', '2018-01-29 15:55:08' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-2', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000009','BPI:02' ,'' ,'TKI:000000000000000000000000000000000040', 'CREATED', '2018-01-29 15:55:09','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-2', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000010','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000040','CREATED', '2018-01-29 15:55:10' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-2', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000011','BPI:02' ,'' ,'TKI:000000000000000000000000000000000066', 'CREATED', '2018-01-29 15:55:11','peter', 'DOMAIN_A', 'WBI:100000000000000000000000000000000001', '00' , 'PASystem', '00' , 'VNR' , '11223344', 'user-1-1', '' , '' ,'' ,'2old_val' ,'new_val2' ,'custom1' ,'' , 'custom2' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000012','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000066','CREATED', '2018-01-29 15:55:12' , 'admin', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-1', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ), +('THI:000000000000000000000000000000000013','BPI:03' ,'BPI:01','TKI:000000000000000000000000000000000000','CREATED', '2018-01-29 15:55:12' , 'user-1-2', 'DOMAIN_A', 'WBI:100000000000000000000000000000000002', '11' , '' , '22' , '' , '' , 'user-1-1', 'L140101' , 'TASK' ,'DOCTYPE_DEFAULT' ,'' ,'' ,'custom1' ,'' , 'custom3' ,'' ,'someDetails' ) ; diff --git a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/SimpleHistoryServiceImpl.java b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/SimpleHistoryServiceImpl.java index 8c0937656..b0772ef67 100644 --- a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/SimpleHistoryServiceImpl.java +++ b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/SimpleHistoryServiceImpl.java @@ -21,6 +21,8 @@ import pro.taskana.spi.history.api.events.classification.ClassificationHistoryEv import pro.taskana.spi.history.api.events.task.TaskHistoryEvent; import pro.taskana.spi.history.api.events.workbasket.WorkbasketHistoryEvent; import pro.taskana.spi.history.api.exceptions.TaskanaHistoryEventNotFoundException; +import pro.taskana.user.api.models.User; +import pro.taskana.user.internal.UserMapper; /** This is the implementation of TaskanaHistory. */ public class SimpleHistoryServiceImpl implements TaskanaHistory { @@ -30,6 +32,7 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory { private TaskHistoryEventMapper taskHistoryEventMapper; private WorkbasketHistoryEventMapper workbasketHistoryEventMapper; private ClassificationHistoryEventMapper classificationHistoryEventMapper; + private UserMapper userMapper; public void initialize(TaskanaEngine taskanaEngine) { @@ -47,6 +50,7 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory { this.taskanaHistoryEngine.getSqlSession().getMapper(WorkbasketHistoryEventMapper.class); this.classificationHistoryEventMapper = this.taskanaHistoryEngine.getSqlSession().getMapper(ClassificationHistoryEventMapper.class); + this.userMapper = taskanaHistoryEngine.getSqlSession().getMapper(UserMapper.class); } @Override @@ -127,6 +131,12 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory { throw new TaskanaHistoryEventNotFoundException(historyEventId); } + if (taskanaHistoryEngine.getConfiguration().getAddAdditionalUserInfo()) { + User user = userMapper.findById(resultEvent.getUserId()); + if (user != null) { + resultEvent.setUserLongName(user.getLongName()); + } + } return resultEvent; } catch (SQLException e) { diff --git a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskHistoryQueryImpl.java b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskHistoryQueryImpl.java index 00b931e06..64e49bf81 100644 --- a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskHistoryQueryImpl.java +++ b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskHistoryQueryImpl.java @@ -32,6 +32,7 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery { private final TaskanaHistoryEngineImpl taskanaHistoryEngine; private final List orderBy; private final List orderColumns; + private boolean joinWithUserInfo; @SuppressWarnings("unused") private TaskHistoryQueryColumnName columnName; @@ -59,7 +60,6 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery { private String[] custom2In; private String[] custom3In; private String[] custom4In; - private String[] businessProcessIdLike; private String[] parentBusinessProcessIdLike; private String[] taskIdLike; @@ -82,10 +82,12 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery { private String[] custom3Like; private String[] custom4Like; - public TaskHistoryQueryImpl(TaskanaHistoryEngineImpl taskanaHistoryEngine) { + public TaskHistoryQueryImpl( + TaskanaHistoryEngineImpl taskanaHistoryEngine) { this.taskanaHistoryEngine = taskanaHistoryEngine; this.orderBy = new ArrayList<>(); this.orderColumns = new ArrayList<>(); + this.joinWithUserInfo = taskanaHistoryEngine.getConfiguration().getAddAdditionalUserInfo(); } public String[] getIdIn() { @@ -264,6 +266,7 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery { return custom4Like; } + @Override public TaskHistoryQuery idIn(String... idIn) { this.idIn = toUpperCopy(idIn); @@ -664,6 +667,11 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery { this.orderBy.clear(); this.addOrderCriteria(columnName.toString(), sortDirection); + if (columnName == TaskHistoryQueryColumnName.USER_LONG_NAME + || columnName == TaskHistoryQueryColumnName.TASK_OWNER_LONG_NAME) { + joinWithUserInfo = true; + } + try { taskanaHistoryEngine.openConnection(); result = taskanaHistoryEngine.getSqlSession().selectList(LINK_TO_VALUE_MAPPER, this); diff --git a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskanaHistoryEngineImpl.java b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskanaHistoryEngineImpl.java index 8f81c159e..b2ffd1ac3 100644 --- a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskanaHistoryEngineImpl.java +++ b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/TaskanaHistoryEngineImpl.java @@ -35,6 +35,7 @@ import pro.taskana.simplehistory.impl.task.TaskHistoryQueryMapper; import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryEventMapper; import pro.taskana.simplehistory.impl.workbasket.WorkbasketHistoryQueryMapper; import pro.taskana.spi.history.api.TaskanaHistory; +import pro.taskana.user.internal.UserMapper; /** This is the implementation of TaskanaHistoryEngine. */ public class TaskanaHistoryEngineImpl implements TaskanaHistoryEngine { @@ -118,6 +119,7 @@ public class TaskanaHistoryEngineImpl implements TaskanaHistoryEngine { configuration.addMapper(WorkbasketHistoryQueryMapper.class); configuration.addMapper(ClassificationHistoryEventMapper.class); configuration.addMapper(ClassificationHistoryQueryMapper.class); + configuration.addMapper(UserMapper.class); SqlSessionFactory localSessionFactory = new SqlSessionFactoryBuilder().build(configuration); return SqlSessionManager.newInstance(localSessionFactory); diff --git a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryColumnName.java b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryColumnName.java index 65dad62ea..73074df27 100644 --- a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryColumnName.java +++ b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryColumnName.java @@ -10,7 +10,8 @@ public enum TaskHistoryQueryColumnName implements QueryColumnName { TASK_ID("task_id"), EVENT_TYPE("event_type"), CREATED("created"), - USER_ID("user_id"), + USER_ID("t.user_id"), + USER_LONG_NAME("u.long_name"), DOMAIN("domain"), WORKBASKET_KEY("workbasket_key"), POR_COMPANY("por_company"), @@ -18,6 +19,7 @@ public enum TaskHistoryQueryColumnName implements QueryColumnName { POR_INSTANCE("por_instance"), POR_TYPE("por_type"), POR_VALUE("por_value"), + TASK_OWNER_LONG_NAME("o.long_name"), TASK_CLASSIFICATION_KEY("task_classification_key"), TASK_CLASSIFICATION_CATEGORY("task_classification_category"), ATTACHMENT_CLASSIFICATION_KEY("attachment_classification_key"), diff --git a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryMapper.java b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryMapper.java index 953db912a..8f0ab9b1c 100644 --- a/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryMapper.java +++ b/history/taskana-simplehistory-provider/src/main/java/pro/taskana/simplehistory/impl/task/TaskHistoryQueryMapper.java @@ -13,10 +13,15 @@ public interface TaskHistoryQueryMapper { @Select( "") - @Result(property = "id", column = "ID") - @Result(property = "taskId", column = "TASK_ID") - @Result(property = "textField", column = "TEXT_FIELD") - @Result(property = "creator", column = "CREATOR") - @Result(property = "created", column = "CREATED") - @Result(property = "modified", column = "MODIFIED") - List findByTaskId(@Param("taskId") String taskId); - @Select( "