modifiedRecord.pu 1.01 KB
Newer Older
Carsten  Rose's avatar
Carsten Rose committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@startuml

actor Alice #FFBBBB
actor Bob #BBBBFF

== Detect modified record: on lock ==

Alice -> form: open page
form -> Alice: form, recordHashMd5='a'
...
Bob -> form: open page
form -> Bob: form, recordHashMd5='a'
...
Alice -> dirty: edit: action=lock, recordHashMd5='a' (hash from form!)
dirty -> Alice: status=success, lock_timeout=<secs>
...
Alice -> save: POST (incl. recordHashMd5)
save -> Alice: action=success, update new recordHashMd5='b' in form.
...
Bob -> dirty: edit: action=lock, recordHashMd5='a' (hash from form!)
dirty -> Bob: status=conclict, msg=record has changed, reload form


== Detect modified record: on save ==

Alice -> form: open page
form -> Alice: form, recordHashMd5='a'
...
Alice -> dirty: edit: action=lock, recordHashMd5='a' (hash from form!)
dirty -> Alice: status=success, lock_timeout=<secs>
...
note over Alice: some background task.
...
System -> System: change record.
...
Alice -> save: POST (incl. recordHashMd5)
save -> Alice: status=error, msg=record has changed, reload form


@enduml