Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Donald Oakes committed Feb 26, 2020
1 parent d3b7366 commit db768fc
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Milestone> getMilestones(Linked<ProcessInstance> instanceHierarchy)
throws ServiceException {
public List<Milestone> getMilestones(Linked<ProcessInstance> instanceHierarchy) throws ServiceException {
List<Milestone> milestones = new ArrayList<>();
Process process = ProcessCache.getProcess(instanceHierarchy.get().getProcessId());
if (process != null) {
Linked<Milestone> milestoneDefs = HierarchyCache.getMilestones(process.getId());
List<Milestone> uniqueDefs = new ArrayList();
for (Linked<Milestone> 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<ProcessInstance> subHierarchy = instanceHierarchy.find(pi -> pi.getProcessId().equals(processId));
if (subHierarchy != null) {
Expand Down

0 comments on commit db768fc

Please sign in to comment.