From 4786b004b26741de5f3f4baa0b1d54812fd288fe Mon Sep 17 00:00:00 2001 From: Thai Phan <117443490+pvthai-axonivy@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:05:59 +0700 Subject: [PATCH] IVYPORTAL-17522: fix performance due to hide systemtask (#1003) --- .../ivy/addon/portalkit/ivydata/service/impl/TaskService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java index 265572b1884..4f628f95901 100644 --- a/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java +++ b/AxonIvyPortal/portal/src/ch/ivy/addon/portalkit/ivydata/service/impl/TaskService.java @@ -39,7 +39,7 @@ import ch.ivyteam.ivy.scripting.objects.Record; import ch.ivyteam.ivy.scripting.objects.Recordset; import ch.ivyteam.ivy.security.IRole; -import ch.ivyteam.ivy.security.ISecurityConstants; +import ch.ivyteam.ivy.security.ISecurityContext; import ch.ivyteam.ivy.security.IUser; import ch.ivyteam.ivy.security.exec.Sudo; import ch.ivyteam.ivy.workflow.ITask; @@ -96,7 +96,7 @@ protected long countTasks(TaskQuery query) { } protected TaskQuery queryExcludeSystemTasks() { - return TaskQuery.create().where().workerUserName().isNotEqual(ISecurityConstants.SYSTEM_USER_NAME); + return TaskQuery.create().where().workerId().isNotEqual(ISecurityContext.current().users().system().getSecurityMemberId()); } protected TaskQuery queryExcludeHiddenTasks() {