Repository navigation
Release v22.88.0
Summary
Reactors can handle the refusal of a command they invoke instead of failing the observer: they say which refusals they expect and what to record when one happens.
Added
Invoke.Command(command)returns a command invocation from a reactor, with.OnRefused(Refused.X, refusal => …)branches that append the returned events and.Acknowledge(Refused.X)to record that a refusal was handled. The first matching branch wins, and a handled refusal stops the remaining invocations of that reactor call (#3058)Refused.ByValidation,Refused.ByConstraint(name),Refused.ByAnyConstraint,Refused.ByAuthorizationandRefused.Anyselect refusals;Refused.Anycovers validation and constraint refusals but not authorization (#3058)CommandResult.GetRefusal()classifies a refused command as a validation, constraint (with all violated constraint names) or authorization refusal. Concurrency conflicts, exceptions, authorization configuration failures and framework failures are not refusals, so they still fail the observer and are retried (#3058)- Decision record https://github.com/Cratis/Arc/blob/main/decisions/0010-declarative-reactor-command-refusals.md describes the contract (#3058)
Changed
- Validation results that Arc composes itself after stream completion use the new reason
frameworkFailureinstead ofrule(#3058)