---
title: Seed a default context value on cross-application arrival
summary: Set an initial context value when the user arrives from a different application.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-09-17
library: SAIF.Framework.Web.Mvc
reference_type: package
operation_id: OP-27
trigger: Consuming application calling the helper after context resolution*
---

# Seed a default context value on cross-application arrival

Set an initial context value when the user arrives from a different application. Trigger: Consuming application calling the helper after context resolution*.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-27 |
| **Trigger** | Consuming application calling the helper after context resolution* |
| **Inputs** | Request referrer and URL, candidate values |
| **Outputs** | `context.CurrentValue` possibly set |
| **Primary components** | `IWebContextExtensions.SetDefaultCurrentValue(IWebContext, HttpRequestBase, params string[] values)` |
| **Entry point** | `src/Web/WebContextService.cs` |

## Steps

1. Proceed only when `request.UrlReferrer` is non-null ([BR-62](../business-rules.md#br-62-default-context-value-only-seeded-when-a-referrer-exists)).
2. Compare the referrer's application name with the current URL's application name.
3. When they differ and at least one candidate value is non-empty, set `context.CurrentValue` to the first non-empty candidate ([BR-63](../business-rules.md#br-63-default-context-value-seeded-from-the-first-non-empty-candidate)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Helper called after context resolution])
	Ref{UrlReferrer non-null?}
	NoChange([No change])
	Compare[Compare referrer vs current app]
	Diff{Apps differ and a value non-empty?}
	Set[Set CurrentValue to first non-empty candidate]
	EndOk([Done])
	Start --> Ref
	Ref -->|No| NoChange
	Ref -->|Yes| Compare
	Compare --> Diff
	Diff -->|Yes| Set
	Diff -->|No| EndOk
	Set --> EndOk
	NoChange --> EndOk
```

## Failure and edge-case behavior

- No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for this operation.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts. Statements marked with `**` could not be confirmed; treat
> as unknown until verified.


## Sources
- `src/Web/WebContextService.cs`
