Interface AllMatchCombinator
- All Known Subinterfaces:
WorkflowExecutionOperations
- All Known Implementing Classes:
AllMatchCombinatorDelegate,WorkflowExecutionOperationsDelegation
- Since:
- 5.4.0
- Author:
- Stefan Dragisic
-
Method Summary
Modifier and TypeMethodDescriptionallMatch(Predicate<WorkflowStepResult> predicate, WorkflowStepResult... results) Guard combinator — ensures all completed results match the given predicate.
-
Method Details
-
allMatch
CombinatorWorkflowStepResult allMatch(Predicate<WorkflowStepResult> predicate, WorkflowStepResult... results) 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 returnstruewhen any completed result does not match the predicate or when all results have reached a terminal state.Cancellation
cancel()andcancel(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
Combinator Resolves when Cancels losers? allMatch All complete and all match, or short-circuit on first non-match No anyMatch First predicate match, or all complete No (by default) noneMatch All complete without a match, or short-circuit on first match No (by default) Result categorization
The returned
CombinatorWorkflowStepResultprovidesmatched()andunmatched()to access categorized sub-results. ForallMatch(WorkflowStepResult::success, successStep, failingStep, slowStep)where successStep succeeded, failingStep failed (short-circuits), and slowStep is still running:matched()→ [successStep] — results that satisfiedsuccess()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.
-