lockAdvisoryAlice+AliceBob.pu 1.32 KB
Newer Older
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@startuml

actor Alice #FFBBBB
actor Bob #BBBBFF

== Advisory Lock: single user ==

Alice -> form: open page
form -> Alice: form
Alice -> Alice: edit (first change)
Alice -> dirty: action=lock
dirty -> Alice: status=success, lock_timeout=<secs>
activate dirty #FFBBBB
...
Alice -> save: POST form
save -> dirty: lock valid?
dirty -> save: yes
save -> save: save form
save -> dirty: action=release
deactivate dirty
save -> Alice: status=succes,redirect=client

== Advisory Lock: multi user ==

Alice -> form: open page
form -> Alice: form
Alice -> Alice: edit (first change)
Alice -> dirty: action=lock
activate dirty #FFBBBB
dirty -> Alice: status=success, lock_timeout=<secs>
...
Bob -> form: open page
form -> Bob: form
...
Bob -> Bob: edit (first change)
Bob -> dirty: action=lock
dirty -> Bob: status=**conflict_allow_force**,\nlock_timeout=<secs>,\nmessage=Record locked by user Alice
note right: User Bob can edit and save
Bob -> save: Post form
save -> dirty: lock valid?
dirty -> save: no
save -> save: save form
save -> dirty: action=release
dirty->dirty: lock for Alice can't be released by Bob
save -> Bob: status=succes,redirect=client
...
Alice -> save: POST form
save -> dirty: lock valid?
dirty -> save: yes
save -> save: save form
save -> dirty: action=release
deactivate dirty
save -> Alice: status=succes,redirect=client

@enduml