Update a task¶
This operation persists changes to an existing task row via pk82036_task.task_update, enforcing optimistic concurrency using UPDATE_SEQ_NUM.
| Field | Value |
|---|---|
| Operation ID | OP-3 |
| Trigger | Application calls Save() on a modified task |
| Inputs | Modified clsTask instance |
| Outputs | Updated TASK row |
| Primary components | clsTask.BeforeUpdate, clsTask.AfterUpdate |
| Entry point | SAIF.Business.Tasks/clsTask.vb |
Steps¶
- The same common business rules as insert are re-evaluated before update (BR-001–BR-008).
- On failure: save is blocked unless overridden (BR-026).
- Set
UpdateDate = NowandUpdateUser = DPI.UserID. - Build a
NonQueryStoredProcedurerequest onpk82036_task.task_updatewith the mutable columns (task user/MailID, action/category/priority codes, date, text, policy number, claim ID, image sequence number, task security), the six context values, the key valuesTaskSeqNum+UpdateSeqNum(optimistic concurrency token, BR-013), andRowsAffectedasReturnValue(SQL-013, TASK). - Note:
TaskSourceCodeis not a parameter of the update call — the source system is immutable after insert*.Origin: The
task_updateprocedure body resides in the Oracle database and was not retrieved in this analysis pass.** - Framework executes the request against the DPI.
- After execution:
RowsAffected <> 1→AddErrorMessage("UpdateError", clsConstants.Messages.DBContentionError)(BR-011, BR-013).- Otherwise: remove the message, increment
m_UpdateSeqNum, callMarkOld().
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Save called on modified task]) --> D{Business rules pass?}
D -->|No| ErrEnd([Save blocked])
D -->|Yes| S1["BeforeUpdate builds<br>task_update request with<br>UpdateSeqNum"]
S1 --> S2[Framework executes request]
S2 --> D2{RowsAffected = 1?}
D2 -->|No| ErrEnd2(["UpdateError:<br>DBContentionError"])
D2 -->|Yes| S3["Increment UpdateSeqNum,<br>MarkOld"]
S3 --> EndOk([Task persisted])
Failure and edge-case behavior¶
- A stale
UpdateSeqNum(another process updated the row first) yieldsRowsAffected = 0, surfaced as aDBContentionErrorrather than an exception (BR-011, BR-013). - Source system code cannot be changed once a task is created*.
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. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
- SAIF.Business.Tasks/clsTask.vb