Skip to content

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

  1. The same common business rules as insert are re-evaluated before update (BR-001–BR-008).
  2. On failure: save is blocked unless overridden (BR-026).
  3. Set UpdateDate = Now and UpdateUser = DPI.UserID.
  4. Build a NonQuery StoredProcedure request on pk82036_task.task_update with 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 values TaskSeqNum + UpdateSeqNum (optimistic concurrency token, BR-013), and RowsAffected as ReturnValue (SQL-013, TASK).
  5. Note: TaskSourceCode is not a parameter of the update call — the source system is immutable after insert*.

    Origin: The task_update procedure body resides in the Oracle database and was not retrieved in this analysis pass.**

  6. Framework executes the request against the DPI.
  7. After execution:
  8. RowsAffected <> 1 → AddErrorMessage("UpdateError", clsConstants.Messages.DBContentionError) (BR-011, BR-013).
  9. Otherwise: remove the message, increment m_UpdateSeqNum, call MarkOld().

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) yields RowsAffected = 0, surfaced as a DBContentionError rather than an exception (BR-011, BR-013).
  • Source system code cannot be changed once a task is created*.

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