Signal a view/context failure¶
Signal a presentation-layer routing failure with a target view and optional model, triggered when a consuming presentation layer detects a missing, invalid, unauthorized-for-user, or disabled context*.
| Field | Value |
|---|---|
| Operation ID | OP-020 |
| Trigger | A consuming presentation layer detects a missing, invalid, unauthorized-for-user, or disabled context* |
| Inputs | none / targetView / model |
| Outputs | An exception carrying TargetView and optionally Model |
| Primary components | ContextException` and subclasses `NoContextException`, `InvalidContextException`, `InvalidContextForUserException`, `DisabledViewException |
| Entry point | Common/SAIF.Common/Classes/ContextException.cs |
Steps¶
- The caller selects the subclass matching the failure condition. (BR-048)
- The parameterless (or
model) constructor stamps a defaultTargetViewequal to the condition name:"NoContext","InvalidContext","InvalidContextForUser","DisabledView". (BR-048) - The
(string targetView)overload on every subclass overrides that default with a caller-supplied view name. OnDisabledViewExceptionthis overload does not setModel. (BR-048) DisabledViewException(object model)additionally attaches the model payload for redisplay. (BR-048)- The consuming layer catches
ContextExceptionand routes toTargetView, passingModel.* (BR-048)
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["Presentation layer detects<br>a context failure"]) --> Select["Select ContextException subclass<br>matching the failure condition"]
Select --> Default["Ctor stamps default TargetView<br>equal to condition name"]
Default --> Override{"targetView overload used?"}
Override -->|Yes| SetView["Override default with<br>caller-supplied view name"]
Override -->|No| ModelCheck
SetView --> ModelCheck{"DisabledViewException(model)<br>constructor used?"}
ModelCheck -->|Yes| AttachModel["Attach model payload<br>for redisplay"]
ModelCheck -->|No| Throw
AttachModel --> Throw["Exception thrown"]
Throw --> Catch["Consuming layer catches<br>ContextException"]
Catch --> End(["Route to TargetView,<br>passing Model"])
Related documentation¶
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Common/SAIF.Common/Classes/ContextException.cs