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