forked from raoul2000/simpleWorkflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario.txt
99 lines (73 loc) · 2.55 KB
/
scenario.txt
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Describes behaviors for both the model status attribute, and the actual status
stored in the SWActiveRecordBehavior.
Definition
attrib : is the Model status Attribute
sw : is the SimpleWorkflow behavior internal SWNode
------------------------------------------------------------------------------------------------------------------
Scenario 1 : enter in workflow (auto insertion)
initial state :
attrib = null
sw = null
autoinsert = true
call swNextStatus()
if the default workflow and its initial node can be found insert
into workflow, otherwise ERROR
onSuccess
attrib <- W/initStatus
sw <- W/initStatus
beforeSave()
call swNextStatus()
------------------------------------------------------------------------------------------------------------------
Scenario 2 : no auto insertion into workflow
initial state :
attrib = null
sw = null
autoinsert = false
call swNextStatus()
if the default workflow and its initial node can be found insert into
workflow, otherwise ERROR
: attrib <- W/initStatus
: sw <- W/initStatus
beforeSave()
NOP (because autoinsert = false)
------------------------------------------------------------------------------------------------------------------
Scenario 3 : enter in workflow
initial state :
attrib = W/S (set manually)
sw = null
call swNextStatus()
if W/S is an initial status SUCCESS, otherwise ERROR
: sw <- W/S
beforeSave()
call swNextStatus()
------------------------------------------------------------------------------------------------------------------
Scenario 4 : leave workflow
initial state :
attrib = null
sw = W/S
call swNextStatus()
if W/S is a final status, otherwise ERROR
: sw <- null
beforeSave()
call swNextStatus()
------------------------------------------------------------------------------------------------------------------
Scenario 5 : transition
initial state :
attrib = W1/S1
sw = W2/S2
call swNextStatus()
if transition W2/S2 -> W1/S1 exist, perform transition
otherwise ERROR
: attrib <- W2/S2
beforeSave()
call swNextStatus()
------------------------------------------------------------------------------------------------------------------
Scenario 6 : transition (loop)
initial state :
attrib = W1/S1
sw = W1/S1
call swNextStatus()
if transition W1/S1 -> W1/S1 exist, perform transition
(otherwise no error)
beforeSave()
call swNextStatus()