Request pipeline and composition¶
The application composes its dependencies once at start. Each request is then authenticated and routed to a controller; only non-AJAX requests on controllers derived from BaseController are given the web context, and only full-view responses render the _Bootstrap3 layout.
Trigger and screens¶
| Item | Detail |
|---|---|
| Trigger | Application start (composition) and each HTTP request to the application |
| Screens | Bill entry, Inbox, Search |
| Tables | Not traced** |
Steps¶
Application start (once per application domain, not per request)
Application_Startregisters areas, Web API routes, global filters (HandleErrorAttribute), MVC routes, AutoMapper maps, bundles and FluentValidation, and replaces the view engines with the Razor engine. It also binds the JSON date binder forDateTimeandDateTime?.Application_StartcallsDependencyMap.Configureto build the Autofac container (see Architecture).
Each request
- IIS authenticates the caller with Windows authentication; anonymous access is off.
- The default route
{controller}/{action}/{id}selects the controller and action. - Authorization depends on the controller.
SaifAuthorizerequiresCBPEnterBillon the Entry, Inbox and Search controllers, for full-view and AJAX requests alike.- The other hosted controllers require only an authenticated user.
HomeControllerderives fromWebContextControllerBase, not fromBaseController;Home.Indexredirects toEntry/IndexandHome.Navigatehandles the web-context change.- For the controllers derived from
BaseController,OnActionExecutingruns its logic only whenRequest.IsAjaxRequest()is false. - For a non-AJAX request it calls the inherited
OnActionExecutingand thenSetDefaultCurrentValueso the web context defaults to the claim number.CheckSecurityreturnsHasConflictAccessfor the web-context claim. - For an AJAX request the override does nothing, so neither the inherited call nor the web-context default runs.
- The action runs and the response takes one of three paths.
- A full view, such as
Entry.Index,Inbox.IndexandSearch.Index, renders the_Bootstrap3layout with the web-context control, top menu and side menu. - A JSON or grid response, such as
GetBill,GetInboxBillsand the grid read actions, returns data and does not render the layout. - A redirect, such as
Home.Index, returns a redirect response and does not render the layout.
Origin: Steps 5.1 and 6.1 rely on
SaifAuthorizeAttributeand the web-context extensions (WebContextExtensions,TempDataExtensions) inSAIF.Framework.Web.Mvc†. Per the Legends CLI RAG service,SaifAuthorizeAttributeis a sealed authorization filter that grants access when the current user satisfies any one of its declared roles, otherwise logging aSecurityExceptionand redirecting to a fixed error URL, using property-injectedIUserProfileService,ILogServiceandIEnvironmentService;WebContextExtensions/TempDataExtensionsrender and persist theWebContextIdhandoff value between requests.ClaimControllerBaseinSAIF.SAIFCode.Web.Mvccould not be located in the available Legends CLI documentation corpus, so its inheritedOnActionExecutingbehavior was not traced**.
Process flow¶
The diagram separates application start from the per-request paths.
flowchart TD
A["Application_Start"] --> B["Register routes, filters, maps,<br>bundles and validation"]
B --> C["DependencyMap.Configure<br>(Autofac container)"]
R["HTTP request"] --> D["Windows authentication"]
D --> E["Route to controller"]
E --> F{"Controller has<br>SaifAuthorize?"}
F -->|"Yes"| G{"Has CBPEnterBill?"}
G -->|"No"| X["Access denied"]
G -->|"Yes"| H{"Derives from<br>BaseController?"}
F -->|"No"| H
H -->|"No (Home)"| K["Action runs"]
H -->|"Yes"| I{"AJAX request?"}
I -->|"No"| J["OnActionExecuting sets<br>web context default"]
I -->|"Yes"| K
J --> K
K --> L{"Response type"}
L -->|"Full view"| M["_Bootstrap3 layout renders<br>web context and menus"]
L -->|"JSON or grid data"| N["Data returned, no layout"]
L -->|"Redirect"| O["Redirect, no layout"]
Failure and edge-case behavior¶
- A caller without the
CBPEnterBillrole is refused by the framework filter on the Entry, Inbox and Search controllers. - The inherited behavior of
ClaimControllerBasewas not traced**.
Related documentation¶
- Operations and processes
- Business rules
- Hosted endpoints
- Data model
- Architecture
- Tech debt
- Screen catalog
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. Statements marked with*were inferred from code structure or contextual evidence. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
- ClaimBillEntry/Global.asax.cs
- ClaimBillEntry/App_Start/RouteConfig.cs
- ClaimBillEntry/App_Start/FilterConfig.cs
- ClaimBillEntry/Controllers/BaseController.cs
- ClaimBillEntry/Controllers/HomeController.cs
- ClaimBillEntry/Views/Shared/_Bootstrap3.cshtml
- SAIF.DependencyMaps.Web.ClaimBillEntry/DependencyMap.cs