-
Notifications
You must be signed in to change notification settings - Fork 0
/
Workflow.yml
executable file
·87 lines (70 loc) · 2.36 KB
/
Workflow.yml
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
#class of the model
class:
name: Mothership\StateMachine\Examples\Advanced\AdvancedWorkflow
args: []
#definition of the states and transition...the order establishes the transition from one state to another
#the name of each state is NOT case sensitive
states:
# initialize the logging and stuff
start:
type: initial
second_state:
type: normal
transitions_from: [start]
transitions_to: [second_state]
load_document:
type: normal
transitions_from: [second_state]
transitions_to: [load_document]
has_images:
type: normal
transitions_from: [load_document]
transitions_to: [has_images]
download_directory_exist:
type: normal
transitions_from: [has_images]
transitions_to: [download_directory_exist]
product_has_media_gallery:
type: normal
transitions_from: [download_directory_exist]
transitions_to: [product_has_media_gallery]
create_media_gallery:
type: normal
transitions_from: [{status: product_has_media_gallery, result: false}]
transitions_to: [create_media_gallery]
prepare_collection:
type: normal
transitions_from: [{status: product_has_media_gallery, result: true}, create_media_gallery]
transitions_to: [prepare_collection]
process_items:
type: normal
transitions_from: [prepare_collection, {status: has_more, result: true}]
transitions_to: [process_items]
original_image_exist_as_copy:
type: normal
transitions_from: [process_items]
transitions_to: [original_image_exist_as_copy]
hash_equals_original:
type: normal
transitions_from: [{status: original_image_exist_as_copy, result: true}]
transitions_to: [copy_equals_original]
remove_existing:
type: normal
transitions_from: [{status: hash_equals_original, result: false}]
transitions_to: [is_new]
download_original:
type: normal
transitions_from: [{status: original_image_exist_as_copy, result: false}, remove_existing]
transitions_to: [download_original]
assign_image:
type: normal
transitions_from: [{status: hash_equals_original, result: true}, download_original]
transitions_to: [assign_image]
has_more:
type: normal
transitions_from: [assign_image]
transitions_to: [has_more]
finish:
type: final
transitions_from: [{status: has_more, result: false}]
transitions_to: [finish]