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() {