SAIF.Application.Claim.Legal architecture¶
SAIF.Application.Claim.Legal is the Application/orchestration ("AppManager") tier for legal-case (WCB/DCBS appeal) management. It sits directly beneath the Legal\ web front end and directly above the SAIF.Business.Claim.Legal business-object tier, translating UI screen actions into business-object CRUD calls, applying screen-level validation and authorization, and bridging to external systems (Guidewire, Appworx print batch) and application-layer Oracle SQL.
Responsibilities¶
- Translate UI screen actions (one
*Managerclass per screen/workflow area — Assignment, Appeal, Board Log, Case Cost, Case Notes, Case Search, Create File, Mail Date, Other Parties, Outcome, Quick Cal, Request, Schedule, Summary, Update Case, and Attorney/Hearing-Location/Person maintenance) into business-object retrieve/save calls. - Enforce screen-level and claim-level authorization (
SecurityPrincipal.IsAuthorized(<resourceKey>),LegalManagerBase.OnRetrieve()conflict/exposure gating). - Manage legal-case context selection and creation (
SetCurrentCase,CreateCase,OnContextChanged) and consolidated-case propagation (file location, LCE due date, case status, DEF flag). - Execute a small set of application-layer (non-
IBusinessCriteria) Oracle SQL statements and one stored-procedure execute (pk80001_LEGALNET.insertLetterRequest) directly from manager classes. - Cache largely-static code-table lookups (attorney/hearing-location/person/case-status code lists) in
HttpContext.Current.Cachefor 8 hours to reduce Oracle round-trips. - Integrate with external systems: Appworx batch print submission for letters (Create File, Mail Date, DEF), and Guidewire claim-system REST APIs for matter/activity sync (Assignment, Schedule, Request managers).
Component boundaries¶
LegalManagerBase(MustInherit, inheritsClaimAppManagerfromSAIF.Application.Claim) — the shared boundary for every concrete manager: case-context lifecycle, claim-level conflict/exposure authorization, consolidated-case propagation helpers, and the direct stored-procedure callinsertLetterRequest.- 22 concrete
*Managerclasses (e.g.,clsAppealManager,clsScheduleManager,clsRequestManager,clsAttorneyTableManager) — one per screen/workflow area, each owning its own business-object collaboration, validation, and (in a few cases) external-integration logic. clsLegalData(inheritsclsBusinessBase† fromSAIF.Framework.Core) — a lightweight read-only header holder for a legal case, loaded via thepk80001_legalNet.getHeaderstored procedure; not part of the*Managerhierarchy.- DTO/request classes (
GwActivityRequest,GwMatterRequest,WcdRequest) — payload shapes for outbound Guidewire API calls; pure data carriers with no behavior of their own. - Data-layer boundary: this library owns no
IBusinessCriteriaimplementations (confirmed by DB analysis); all business-object CRUD SQL for legal-case entities lives in the referencedSAIF.Business.Claim.Legallibrary. This library instead authors application-layer SQL directly against manager classes for code-table lookups, one scalar lookup, and one stored-procedure insert — a distinct, narrower data-access boundary than the business tier. - Web-tier coupling boundary: several managers (
clsAppealManager,clsAttorneyTableManager) callSystem.Web.HttpContext.Current.Cache/HttpRequestdirectly for AJAX endpoints and caching, coupling this Application-layer library more tightly to the ASP.NET web tier than a strict layered architecture would prescribe*.
Interaction model¶
- Primary control/data flow:
Legal.vbproj(web UI) → aSAIF.Application.Claim.Legalmanager (New→OnInitialize/OnContextChanged→OnRetrieve) →SAIF.Business.Claim.Legalbusiness objects (Get*/New*factory methods,Save()) → BOF data portal (IDataPortalInfo) → Oracle stored procedures/PL-SQL packages (chieflypk80001_LEGALNET/pk80001_legalNet). Write flows funnel through each manager'sOnWrite()override, with several addingPreSaveProcessing()/PostSaveProcessing()hooks around the business-objectSave(). - Data-layer interaction (this library's own SQL): application-layer SQL is authored directly in manager classes, bypassing the business/
IBusinessCriterialayer. Database DB analysis findings catalog 24 statements (SQL-001–SQL-024): one stored-procedure execute (pk80001_LEGALNET.insertLetterRequest, used for DEF and recon-request letters), one stored-procedure result-set retrieve (pk80001_legalNet.getHeader, backingclsLegalData), one scalar stored-function call (pk80001_LEGALNET.get_atty_mngr_email), one scalar inlineSELECTagainstattorney_profile, and 20 static/constant code-table lookupSELECTs executed viaclsCodeCollection.GetCodeCollectionagainst tables such asPOLICY,DURATION_CODE,HEARING_LOCATION_CODE,LEGAL_PERSON/LEGAL_PERSON_TYPE,OTHER_FIRM,APPEAL,REVIEW_LEVEL_CODE, andCASE_STATUS_CODE. All tables are recorded as unqualified (no explicit schema owner)**. See Database tables and the SQL catalog for the full statement-level detail — not duplicated here. - External integration boundary (non-BOF):
clsAssignmentManager,clsScheduleManager, andclsRequestManagercall out to Guidewire claim-system REST APIs (GwMatterApi,GWActivityData,GWClaimDataApi) viaSAIF.Web.API.Clients/SAIF.Web.API.Core, and to accclaimdataapiendpoint configured viaEnvironmentService.GetConfigSetting("cc.ccclaimdataapiurl")*. These calls are wrapped in try/catch withLogging.clsLogError.CreateErroron failure — a best-effort, fire-and-forget pattern that does not abort the primary save. - Batch print integration:
clsCreateFileManagerandclsMailDateManagersubmit Appworx batch print jobs (SAIF.Services.Appworx.clsRequestAppworxJob.SubmitBatchJob) for letters and cover letters after a letter request is inserted. - Inherited framework lifecycle: every concrete manager, via
LegalManagerBase→ClaimAppManager→AppManagerBase, is simultaneously a BOF business object (through the inheritedclsBusinessBasechain) and an application-process controller with its own parallelOnInitialize/OnRetrieve/OnWritelifecycle. Per cached Legends CLI RAG findings forclsBusinessBase(SAIF.Framework.Core): its public surface includesRules(clsRulesManager), edit-session management (BeginEdit/CancelEdit/ApplyEdit), link-management methods, andIDataErrorInfosupport (Error/Item), and it owns aclsRulesManagerinstance tied to the V1 rules engine, with broken rules tracked and surfaced throughIDataErrorInfo.† No direct evidence in this library's source shows these inheritedclsBusinessBasemembers (Rules,BeginEdit, the inherited save path) being invoked — managers instead rely onLegalManagerBase's own parallel lifecycle contract*.
Design constraints¶
- No
IBusinessCriteriaimplementations exist in this library; all business-tier CRUD for legal-case entities must go throughSAIF.Business.Claim.Legal— application-layer SQL here is limited to code-table lookups, one scalar lookup, and one stored-procedure insert. - Two SQL statements (
SQL-019,SQL-020) and one status-code list (SQL-024) build query text via runtime string concatenation rather than Oracle bind variables; while the concatenated values are typed (Decimal, internally-derived status codes) and not raw user input, this deviates from the bind-variable pattern used elsewhere in the library*. - Guidewire and Appworx integrations are treated as best-effort, non-transactional side effects: failures are logged (
Logging.clsLogError.CreateError) but do not roll back or block the primary BOF save. - Authorization is concentrated in
LegalManagerBase.OnRetrieve()(claim-level view/conflict/exposure gate, inherited by all 22 managers) andclsCaseNotesManager(note-level gate); the remaining concrete managers add no further security-key checks beyond this inherited gate, so action-level authorization beyond screen view is not independently enforced at this layer for most screens*. - This library's own configuration footprint is minimal: one Environment API key (
cc.ccclaimdataapiurl) and two call sites ofGetApplicationEnvironment()for non-Production email-safety branching (DEF email redirection); all Oracle connectivity is inherited from the shared BOFDataLayer/Connectioninfrastructure rather than configured locally.
Architecture diagram¶
The following diagram shows the high-level component layering and external integration boundaries for this library.
flowchart TD
UI["Legal.vbproj<br>(web front end)"] --> LMB["LegalManagerBase<br>(shared case-context, auth, consol-case logic)"]
LMB --> MGRS["22 concrete *Manager classes<br>(Acknowledge, Appeal, Assignment, AttorneyTable, AttyMessages, BoardLog, CaseCost, CaseNotes, CaseSearch, CreateFile, HearingLocation, LegalPerson, MailDate, Maintenance, Outcome, OtherParties, QuickCal, Request, Schedule, Summary, UpdateCase)<br>(one per screen/workflow area)"]
MGRS --> BIZ["SAIF.Business.Claim.Legal<br>(business objects, IBusinessCriteria CRUD)"]
BIZ --> DPI["BOF data portal (IDataPortalInfo)"]
DPI --> ORA[("Oracle<br>pk80001_LEGALNET / pk80001_legalNet")]
MGRS --> APPSQL["Application-layer SQL<br>(code-table lookups, insertLetterRequest)"]
APPSQL --> ORA
MGRS --> APPWORX["SAIF.Services.Appworx<br>(batch print jobs)"]
MGRS --> GW["Guidewire claim-system REST APIs<br>(GwMatterApi, GWActivityData, GWClaimDataApi)"]
MGRS --> CACHE["HttpContext.Current.Cache<br>(code-table caching, 8h)"]
Sequence diagram¶
The following diagram shows the primary case-context load and letter-request flow.
sequenceDiagram
participant Web as Legal.vbproj (UI)
participant Mgr as *Manager (LegalManagerBase-derived)
participant Biz as SAIF.Business.Claim.Legal
participant DPI as BOF data portal
participant Ora as Oracle (pk80001_LEGALNET)
Web->>Mgr: SetCurrentCase(caseID) / CreateCase()
Mgr->>Biz: clsLegalCase.GetLegalCase(DPI, caseID)
Biz->>DPI: retrieve request
DPI->>Ora: stored-procedure / SQL
Ora-->>DPI: result set
DPI-->>Biz: business object
Biz-->>Mgr: clsLegalCase
Mgr->>Mgr: OnRetrieve() authorization gate
Mgr-->>Web: case data (or authorization error)
Web->>Mgr: PrintDEF() / SendReconRequest()
Mgr->>Ora: insertLetterRequest (pk80001_LEGALNET)
Ora-->>Mgr: requestNum
Mgr-->>Web: letter request queued
Related documentation¶
- Index
- Overview
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- Database tables
- SQL catalog
- Configuration
- API reference
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¶
SAIF.Application.Claim.Legal\SAIF.Application.Claim.Legal.vbprojSAIF.Application.Claim.Legal\LegalManagerBase.vbSAIF.Application.Claim.Legal\clsLegalData.vbSAIF.Application.Claim.Legal\clsAttorneyTableManager.vbSAIF.Application.Claim.Legal\LegalNet\clsAssignmentManager.vbSAIF.Application.Claim.Legal\LegalNet\clsRequestManager.vbSAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vbSAIF.Application.Claim.Legal\LegalNet\clsCaseNotesManager.vbSAIF.Application.Claim.Legal\Web.configSAIF.Application.Claim.Legal\app.config