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 | 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 | 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 | 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, BR-BOLMIDDLEWARE-004, BR-BOLMIDDLEWARE-005, BR-BOLMIDDLEWARE-006 |
| Resolve web context | 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, BR-BOLMIDDLEWARE-003, BR-BOLMIDDLEWARE-020, BR-BOLMIDDLEWARE-021 |
| Capture external user information | 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, BR-BOLMIDDLEWARE-006 |
| Save web context | 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, BR-BOLMIDDLEWARE-003, BR-BOLMIDDLEWARE-004 |
| Navigate | 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 |
| Load menu and context value | 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, BR-BOLMIDDLEWARE-008, BR-BOLMIDDLEWARE-019 |
| Menu item click | Handle a menu link post and navigate to the chosen application page. | POST to the MenuItemClick handler. |
targetApp, targetPage |
Redirect result. | BR-BOLMIDDLEWARE-002 |
| Load policy header and validate access | 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, BR-BOLMIDDLEWARE-010, BR-BOLMIDDLEWARE-011, BR-BOLMIDDLEWARE-012 |
| Resolve policy header | 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, BR-BOLMIDDLEWARE-009 |
| Get policy header | 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, BR-BOLMIDDLEWARE-021 |
| Build policy dropdown | Build the ordered select list of associated policies. | BolPolicyHeader view rendering. |
PolicyHeader |
SelectList of policies. |
BR-BOLMIDDLEWARE-012, BR-BOLMIDDLEWARE-015 |
| Render view components | 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, BR-BOLMIDDLEWARE-017, BR-BOLMIDDLEWARE-018 |
| Authorization helpers | 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, BR-BOLMIDDLEWARE-009 |
| Cookie and session helpers | 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 |
| Client-side navigation | 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.
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).
- A failed policy access check sets an error message but does not stop the handler; consumer pages must check
AccessAllowed(BR-BOLMIDDLEWARE-009). - Duplicate policy numbers among associations throw while the policy dropdown is built (BR-BOLMIDDLEWARE-015).
- A null menu or an error message makes the view components return the shared error view (BR-BOLMIDDLEWARE-016, BR-BOLMIDDLEWARE-017).
- The ten-second
BolContextcookie expires quickly, so a slow navigation falls back to the form, query, or session context sources (BR-BOLMIDDLEWARE-004). 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
- Overview
- Architecture
- Dependencies
- Configuration
- Business rules
- Security and authorization
- Service registration
- API reference
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