Interface AllMatchCombinator

All Known Subinterfaces:
WorkflowExecutionOperations
All Known Implementing Classes:
AllMatchCombinatorDelegate, WorkflowExecutionOperationsDelegation

public interface AllMatchCombinator
Guard combinator that succeeds when all completed results match the predicate.
Since:
5.4.0
Author:
Stefan Dragisic
  • Method Details

    • allMatch

      Guard combinator — ensures all completed results match the given predicate. Short-circuits on the first non-match.

      Short-circuit (non-match found)

      When a completed result does not match the predicate, it becomes the "violator". The composite delegates all state queries to the violating result. Remaining results are not automatically cancelled — the caller is responsible for cancelling if desired.

      Success (all complete, all matched)

      When all results complete and all match the predicate: isSuccess()=true, result()=empty, isFailure()=false.

      Completion

      isCompleted() is non-blocking and returns true when any completed result does not match the predicate or when all results have reached a terminal state.

      Cancellation

      cancel() and cancel(reason) propagate to all results.

      Summary

      The structural inverse of .noneMatch(): succeeds when all match, but short-circuits on first non-match to avoid cascading errors.

      Comparison with other combinators

      CombinatorResolves whenCancels losers?
      allMatchAll complete and all match, or short-circuit on first non-matchNo
      anyMatchFirst predicate match, or all completeNo (by default)
      noneMatchAll complete without a match, or short-circuit on first matchNo (by default)

      Result categorization

      The returned CombinatorWorkflowStepResult provides matched() and unmatched() to access categorized sub-results. For allMatch(WorkflowStepResult::success, successStep, failingStep, slowStep) where successStep succeeded, failingStep failed (short-circuits), and slowStep is still running:

      • matched() → [successStep] — results that satisfied success()
      • unmatched() → [failingStep, slowStep] — all other results, including violators and not-yet-completed
      Parameters:
      predicate - the predicate that all results should match.
      results - the step results to guard.
      Returns:
      a composite result which succeeds when all results match, or short-circuits on the first non-match.