---
title: BolMiddleware operations and processes
summary: Business and technical operations supported by BolMiddleware.
status: draft
owner: SAIF IT Core Services
last_reviewed: 2026-10-12
library: BolMiddleware
reference_type: package
---

# BolMiddleware operations and processes

This page is the operation catalog and cross-operation hub for BolMiddleware. Each operation's detailed, step-by-step logic lives in its own page under `operations/`. The library runs inside consumer Razor Pages applications and has no database interactions, so the catalog has no table or SQL columns.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules |
| --- | --- | --- | --- | --- | --- |
| [Register BOL services](operations/register-bol-services.md) | Register the BOL services, API clients, and session support in the dependency injection container. | Application startup calling `RegisterBolServices`. | `IServiceCollection` | The same collection with BOL registrations added. | None |
| [Host startup](operations/host-startup.md) | Give consumers a startup base class that enables legacy BOL authentication, registers services, and binds menu options. | Consumer startup inheriting `BolRazorLayoutStartup`. | `IConfiguration`, `BasicAppMap` section | Registered services and bound `IOptions<BasicAppMap>`. | None |
| [Page handler selection initialization](operations/page-handler-selection-init.md) | Prepare the request helper, application name, cookie state, and web context before a handler runs. | Razor Pages handler selection on a `BolContextModel` page. | HTTP request, cookies, session | Populated `WebContext`, `contextCookie`, `Services`. | [BR-BOLMIDDLEWARE-001](business-rules.md#br-bolmiddleware-001-web-context-resolution-precedence), [BR-BOLMIDDLEWARE-004](business-rules.md#br-bolmiddleware-004-context-cookie-lifetime-and-flags), [BR-BOLMIDDLEWARE-005](business-rules.md#br-bolmiddleware-005-external-user-detection), [BR-BOLMIDDLEWARE-006](business-rules.md#br-bolmiddleware-006-external-user-information-lookup-once) |
| [Resolve web context](operations/resolve-web-context.md) | Find the current BOL web context from the best available source. | Page handler selection. | Cookie, referrer, `WebContextId` or `cid`, session | A `ContextHelper` for the request. | [BR-BOLMIDDLEWARE-001](business-rules.md#br-bolmiddleware-001-web-context-resolution-precedence), [BR-BOLMIDDLEWARE-003](business-rules.md#br-bolmiddleware-003-context-content-detection), [BR-BOLMIDDLEWARE-020](business-rules.md#br-bolmiddleware-020-session-identifier-source-selection), [BR-BOLMIDDLEWARE-021](business-rules.md#br-bolmiddleware-021-silent-failure-degradation) |
| [Capture external user information](operations/capture-external-user-information.md) | Look up the external user's type once and remember it in the context cookie. | External user request with cookie state New. | Authenticated identity | Updated `userType` and `userState`. | [BR-BOLMIDDLEWARE-005](business-rules.md#br-bolmiddleware-005-external-user-detection), [BR-BOLMIDDLEWARE-006](business-rules.md#br-bolmiddleware-006-external-user-information-lookup-once) |
| [Save web context](operations/save-web-context.md) | Persist the context to the cookie, the remote BOL Context API, and the session. | `SaveContext` call from a page or navigation. | `forceSave` flag, current context | Updated cookie, session, and optionally remote record. | [BR-BOLMIDDLEWARE-002](business-rules.md#br-bolmiddleware-002-context-save-condition), [BR-BOLMIDDLEWARE-003](business-rules.md#br-bolmiddleware-003-context-content-detection), [BR-BOLMIDDLEWARE-004](business-rules.md#br-bolmiddleware-004-context-cookie-lifetime-and-flags) |
| [Navigate](operations/navigate.md) | Save the context and redirect to another BOL application page. | `Navigate` call with `NavigationOptions`. | Target application, target page | Redirect result with a `cid` query value. | [BR-BOLMIDDLEWARE-002](business-rules.md#br-bolmiddleware-002-context-save-condition) |
| [Load menu and context value](operations/load-menu-and-context-value.md) | Load the menu and apply a submitted policy or claim number. | Handler execution on a `BolMenuModel` page. | Session menu, user id, `ContextValue` | `MenuData`, updated context. | [BR-BOLMIDDLEWARE-007](business-rules.md#br-bolmiddleware-007-menu-source-selection), [BR-BOLMIDDLEWARE-008](business-rules.md#br-bolmiddleware-008-context-value-classification), [BR-BOLMIDDLEWARE-019](business-rules.md#br-bolmiddleware-019-context-textbox-visibility) |
| [Menu item click](operations/menu-item-click.md) | Handle a menu link post and navigate to the chosen application page. | POST to the `MenuItemClick` handler. | `targetApp`, `targetPage` | Redirect result. | [BR-BOLMIDDLEWARE-002](business-rules.md#br-bolmiddleware-002-context-save-condition) |
| [Load policy header and validate access](operations/load-policy-header-and-validate-access.md) | Resolve the policy header, derive the parent account, and decide dropdown visibility. | Handler execution on a `BolPolicyModel` page. | Context policy number, user | `Header`, `AccessAllowed`, `ParentAccount`, `ShowPolicyDropdown`. | [BR-BOLMIDDLEWARE-009](business-rules.md#br-bolmiddleware-009-policy-access-validation), [BR-BOLMIDDLEWARE-010](business-rules.md#br-bolmiddleware-010-parent-account-reset), [BR-BOLMIDDLEWARE-011](business-rules.md#br-bolmiddleware-011-parent-account-derivation), [BR-BOLMIDDLEWARE-012](business-rules.md#br-bolmiddleware-012-policy-dropdown-visibility) |
| [Resolve policy header](operations/resolve-policy-header.md) | Reuse the session header or request a new one for the selected policy. | `TryGetPolicyHeader` during policy page handling. | Policy number, session | `Header` stored in session. | [BR-BOLMIDDLEWARE-014](business-rules.md#br-bolmiddleware-014-session-policy-header-reuse), [BR-BOLMIDDLEWARE-009](business-rules.md#br-bolmiddleware-009-policy-access-validation) |
| [Get policy header](operations/get-policy-header.md) | Fetch the policy header from the Policy Header API and filter associations for external users. | `IPolicyHeaderService.GetHeader` call. | Policy number, customer id, user type code | `PolicyHeader`. | [BR-BOLMIDDLEWARE-013](business-rules.md#br-bolmiddleware-013-external-association-filtering), [BR-BOLMIDDLEWARE-021](business-rules.md#br-bolmiddleware-021-silent-failure-degradation) |
| [Build policy dropdown](operations/build-policy-dropdown.md) | Build the ordered select list of associated policies. | `BolPolicyHeader` view rendering. | `PolicyHeader` | `SelectList` of policies. | [BR-BOLMIDDLEWARE-012](business-rules.md#br-bolmiddleware-012-policy-dropdown-visibility), [BR-BOLMIDDLEWARE-015](business-rules.md#br-bolmiddleware-015-policy-dropdown-ordering) |
| [Render view components](operations/render-view-components.md) | Render the side menu, top menu, and policy header, or the error view. | Layout rendering. | Menu, current page, policy model | HTML fragments. | [BR-BOLMIDDLEWARE-016](business-rules.md#br-bolmiddleware-016-null-menu-error-view), [BR-BOLMIDDLEWARE-017](business-rules.md#br-bolmiddleware-017-error-message-error-view), [BR-BOLMIDDLEWARE-018](business-rules.md#br-bolmiddleware-018-external-profile-and-logoff-links) |
| [Authorization helpers](operations/authorization-helpers.md) | Answer user type, role, and policy access questions through `ISecurityClient` and Policy Core API. | Calls from page models. | Role name, policy number | Booleans and `ExternalUser`. | [BR-BOLMIDDLEWARE-005](business-rules.md#br-bolmiddleware-005-external-user-detection), [BR-BOLMIDDLEWARE-009](business-rules.md#br-bolmiddleware-009-policy-access-validation) |
| [Cookie and session helpers](operations/cookie-and-session-helpers.md) | Read and write cookies, user settings, and typed session objects. | Calls from page models and services. | Keys, values, timeout | Stored or retrieved values. | [BR-BOLMIDDLEWARE-004](business-rules.md#br-bolmiddleware-004-context-cookie-lifetime-and-flags) |
| [Client-side navigation](operations/client-side-navigation.md) | Submit a hidden form from the browser to navigate between BOL applications. | Menu item or script call in the browser. | Target application and page | Form post. | None |

## Process flow diagram
The following diagram visualizes the primary request flow across operations.

```mermaid
flowchart TD
	Start([Razor Page request]) --> Select[Handler selection initialization]
	Select --> Ctx[Resolve web context]
	Ctx --> Ext{External user and state New?}
	Ext -->|Yes| Cap[Capture external user information]
	Ext -->|No| Menu[Load menu and context value]
	Cap --> Menu
	Menu --> Pol{Policy page?}
	Pol -->|Yes| Hdr[Load policy header and validate access]
	Pol -->|No| Exec([Run consumer handler])
	Hdr --> Exec
	Exec --> Render[Render view components]
	Render --> Nav{Navigation requested?}
	Nav -->|Yes| Save[Save web context and redirect]
	Nav -->|No| EndOk([Response sent])
	Save --> EndOk
```

## Failure and edge-case behavior
- Remote API failures in the context, menu, and policy header facades are logged and replaced by empty results, so pages continue with a missing menu or context ([BR-BOLMIDDLEWARE-021](business-rules.md#br-bolmiddleware-021-silent-failure-degradation)).
- A failed policy access check sets an error message but does not stop the handler; consumer pages must check `AccessAllowed` ([BR-BOLMIDDLEWARE-009](business-rules.md#br-bolmiddleware-009-policy-access-validation)).
- Duplicate policy numbers among associations throw while the policy dropdown is built ([BR-BOLMIDDLEWARE-015](business-rules.md#br-bolmiddleware-015-policy-dropdown-ordering)).
- A null menu or an error message makes the view components return the shared error view ([BR-BOLMIDDLEWARE-016](business-rules.md#br-bolmiddleware-016-null-menu-error-view), [BR-BOLMIDDLEWARE-017](business-rules.md#br-bolmiddleware-017-error-message-error-view)).
- The ten-second `BolContext` cookie expires quickly, so a slow navigation falls back to the form, query, or session context sources ([BR-BOLMIDDLEWARE-004](business-rules.md#br-bolmiddleware-004-context-cookie-lifetime-and-flags)).
- `ShowLoading()` in the client script is provided by the consuming application; its absence is unknown**.

> **Note:** Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Business rules](business-rules.md)
- [Security and authorization](security-authorization.md)
- [Service registration](service-registration.md)
- [API reference](api/index.md)

## Sources
- src/BolMiddleware/Extensions/BolMiddlewareExtensions.cs
- src/BolMiddleware/BolRazorLayoutStartup.cs
- src/BolMiddleware/Models/BolContextModel.cs
- src/BolMiddleware/Models/BolMenuModel.cs
- src/BolMiddleware/Models/BolPolicyModel.cs
- src/BolMiddleware/Contracts/NavigationOptions.cs
- src/BolMiddleware/Services/Context/WebContextService.cs
- src/BolMiddleware/Services/Headers/Policy/PolicyHeaderService.cs
- src/BolMiddleware/Services/Security/SecurityService.cs
- src/BolMiddleware/Services/CookieService/CookieService.cs
- src/BolMiddleware/Extensions/HeaderExtensions.cs
- src/BolMiddleware/ViewComponents/BolPolicyHeaderViewComponent.cs
- src/BolMiddleware/wwwroot/js/MenuNavigation.js
