Attorney assignment batch¶
Runs the Oracle-side attorney assignment procedure, resolves results, updates file locations and LCE records, sends notifications, and syncs Outlook/Exchange calendars.
| Field | Value |
|---|---|
| Operation ID | attorney-assignment-batch |
| Trigger | A scheduled or manual batch run starts the attorney assignment process |
| Inputs | Assignment run parameters |
| Outputs | Assignment results, notifications, calendar updates |
| Primary components | clsAssignmentProcess.RunAssignmentProcess, clsAssignmentProcess.GetAssignmentResults |
| Entry point | SAIF.Business.Claim.Legal\LegalNet\clsAssignmentProcess.vb |
Steps¶
RunAssignmentProcess()first callsGetMaxSeq(), which executesselect pk80005_assignment.max_result_seq from dualto capture the currentMAX(assignment_result_seq_num)fromassignment_resultas a watermark (pk80005_assignment.max_result_seq) — necessary becauserun_assignmentwrites new rows into the same table and the .NET caller has no other way to detect which rows are new. It then invokespk80005_ASSIGNMENT.run_assignmentas a parameterless stored procedure call (no arguments are passed from the VB.NET side). Internally,run_assignmentis the package's top-level driver: it sequentially runsassign_by_employer,assign_dcbs_cases,assign_recon_cases,assign_rotation_cases,assign_same,assign_health_issue_cases,assign_wrkr_conflict_cases,assign_critical_claim_cases,assign_portland_cases,assign_remaining_cases, andpreviously_assignedoverPENDA-status legal cases with unassignedSET/RESEThearings (pk80005_assignment operations). Each of these procedures cursors over its candidate cases and calls the sharedassignIt/assignItBalancedfunctions to evaluate a candidate attorney against the package's conflict-of-interest and workload rules — employer, adjuster, ALJ, opposing-representation, rotation, calendar, long-leave, location, and weekly-caseload checks (BR-PKG2-001 through BR-PKG2-009). Every evaluation is recorded viainsert_resultswith aCA/CACresult code for a completed assignment or anNA*code identifying the specific blocking reason (BR-PKG2-011, BR-PKG2-012), andupdateSchedulepersists the winning attorney back onto the case'sschedulerow for successful assignments. Determining whether a result isCAvs.CAC(vs. anNA*blocking code) is therefore performed entirely insiderun_assignment, not by the VB.NET caller — the .NET side only reacts to the result code after the fact (BR-ASG-001).GetAssignmentResults()re-readsMaxSeqviaGetMaxSeq()a second time, giving the caller a before/after bracket around therun_assignmentcall soclsAssignmentResults.GetAssignmentResultsandclsAssignmentDetail.GetAssignmentDetailcan filterpk80005_assignment.get_results/get_assign_resultsto only the rows created since the batch started (via each cursor'sin_numwatermark parameter), then loadsclsAssignmentResultCollectionandclsResultDetailCollectionfor the"ASSIGN"action on the current date.updateFileLocation()andupdateLCE()apply file-location and legal-case-evaluation updates for each assignment result, branching by result code (BR-ASG-002).SendNotifications()sends adjuster/attorney e-mail notifications for the batch's results.updateOutlook("ASSIGN", MaxSeq, "LegalNet")syncs Outlook/Exchange calendar appointments for assigned attorneys; non-production environments redirect these operations to test mailboxes.
Process flow¶
The following diagram visualizes this operation's control flow, including the assignment/conflict
logic that executes inside run_assignment (subgraph) rather than in the VB.NET caller.
flowchart TD
Start(["Start assignment<br>batch"]) --> MaxSeq1["GetMaxSeq<br>watermark before"]
MaxSeq1 --> RunProc
subgraph RunProc["pk80005_assignment.run_assignment (Oracle)"]
direction TB
AssignDrivers["assign_by_employer, assign_dcbs_cases,<br>assign_recon_cases, assign_rotation_cases,<br>assign_same, assign_health_issue_cases,<br>assign_wrkr_conflict_cases,<br>assign_critical_claim_cases,<br>assign_portland_cases,<br>assign_remaining_cases,<br>previously_assigned"] --> AssignIt["assignIt /<br>assignItBalanced:<br>conflict + workload checks"]
AssignIt --> InsertResults["insert_results:<br>CA/CAC or NA* code"]
InsertResults --> UpdateSched["updateSchedule<br>(on CA/CAC)"]
end
RunProc --> MaxSeq2["GetMaxSeq<br>watermark after"]
MaxSeq2 --> GetResults["GetAssignmentResults<br>(rows since watermark)"]
GetResults --> Decision{"Result code?"}
Decision -->|CA| UpdateFL["updateFileLocation +<br>updateLCE"]
Decision -->|CAC| UpdateFLConflict["updateFileLocation +<br>updateLCE + conflict<br>notification"]
Decision -->|NA*| Skip["No downstream<br>update"]
UpdateFL --> SendNotif["SendNotifications"]
UpdateFLConflict --> SendNotif
SendNotif --> UpdateOutlook["updateOutlook ASSIGN"]
UpdateOutlook --> End(["End"])
Failure and edge-case behavior¶
- Non-production environments (
GetApplicationEnvironment() <> ApplicationEnvironment.Prod) redirect calendar/mailbox operations to test mailboxes rather than real attorney mailboxes.*
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
SAIF.Business.Claim.Legal\LegalNet\clsAssignmentProcess.vb