lockAdvisoryAlice+AliceBob.pu 1.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
@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
activate dirty #FFBBBB
13
dirty -> Alice: status=success, lock_timeout=<secs>
14
...
15
16
17
18
19
Alice -> Alice: edit (more changes)
note over Alice: Client will extend lock automatically,\nif there are changes during last timeout period
Alice -> dirty: action=extend
dirty -> Alice: status=success
...
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
42
dirty -> Bob: status=**conflict_allow_force**,\nmessage=Record locked by user Alice
43
note right: User Bob can decide between a) reload and b) overwrite.
44
...
45
46
47
48
alt Bob: overwrite
   Bob -> Bob: can edit and receive no more warnings
   Bob -> save: Post form
   save -> dirty: lock type 'Advisory'? yes >> always allow write.
49
50
51
   save -> save: save form
   save -> dirty: action=release
   deactivate dirty
52
53
54
   save -> Bob: status=succes,redirect=client
else Bob: reload
   Bob -> Bob: reload page
55
end
56

57
58
59
Alice -> save: Post form
save -> dirty: record modified. Message: Reload form.

60
@enduml