Skip to content

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

  1. The caller selects the subclass matching the failure condition. (BR-048)
  2. The parameterless (or model) constructor stamps a default TargetView equal to the condition name: "NoContext", "InvalidContext", "InvalidContextForUser", "DisabledView". (BR-048)
  3. The (string targetView) overload on every subclass overrides that default with a caller-supplied view name. On DisabledViewException this overload does not set Model. (BR-048)
  4. DisabledViewException(object model) additionally attaches the model payload for redisplay. (BR-048)
  5. The consuming layer catches ContextException and routes to TargetView, passing Model.* (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"])

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