From db768fcb9d763de2a81c778300ea927f90c3ba58 Mon Sep 17 00:00:00 2001 From: Donald Oakes Date: Wed, 26 Feb 2020 15:22:01 -0700 Subject: [PATCH] #811 --- .../mdw/services/workflow/WorkflowServicesImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mdw-services/src/com/centurylink/mdw/services/workflow/WorkflowServicesImpl.java b/mdw-services/src/com/centurylink/mdw/services/workflow/WorkflowServicesImpl.java index 3de1ec56e1..0b4648c19c 100644 --- a/mdw-services/src/com/centurylink/mdw/services/workflow/WorkflowServicesImpl.java +++ b/mdw-services/src/com/centurylink/mdw/services/workflow/WorkflowServicesImpl.java @@ -1705,14 +1705,19 @@ private boolean isIgnored(ProcessInstance processInstance) { * TODO use WorkflowServices method when available in 6.1.32 * Retrieve milestones for a process instance hierarchy */ - public List getMilestones(Linked instanceHierarchy) - throws ServiceException { + public List getMilestones(Linked instanceHierarchy) throws ServiceException { List milestones = new ArrayList<>(); Process process = ProcessCache.getProcess(instanceHierarchy.get().getProcessId()); if (process != null) { Linked milestoneDefs = HierarchyCache.getMilestones(process.getId()); + List uniqueDefs = new ArrayList(); for (Linked milestoneDef : milestoneDefs) { - Milestone milestone = milestoneDef.get(); + Milestone def = milestoneDef.get(); + if (!uniqueDefs.contains(def)) + uniqueDefs.add(def); + } + for (Milestone uniqueDef : uniqueDefs) { + Milestone milestone = uniqueDef; Long processId = milestone.getProcess().getId(); Linked subHierarchy = instanceHierarchy.find(pi -> pi.getProcessId().equals(processId)); if (subHierarchy != null) {