Class CycleDetector

java.lang.Object
com.uc4.api.objects.CycleDetector

public class CycleDetector extends Object
Utility class for detecting cycles in workflow task dependencies using topological sort. This provides a common implementation used by both the editor (WorkflowTasks) and monitor (ModifyProcessFlowMonitor) to ensure consistent cycle detection behavior.
  • Method Details

    • validateNoCycles

      public static <T> void validateNoCycles(Iterable<T> tasks, CycleDetector.PredecessorProvider<T> predecessorProvider, CycleDetector.LnrProvider<T> lnrProvider)
      Validates that a collection of tasks with their dependencies does not contain cycles. Uses Kahn's algorithm for topological sort.
      Type Parameters:
      T - The task type
      Parameters:
      tasks - Iterable of tasks to validate
      predecessorProvider - Function to get predecessors for a task
      lnrProvider - Function to get the LNR (line number) for a task
      Throws:
      CyclicException - if a cycle is detected