Persist native CM workflows in CatalogDB
[so.git] / adapters / mso-catalog-db-adapter / src / main / resources / db / migration / R__WorkflowDesignerData.sql
1 use catalogdb;
2
3 DELETE FROM activity_spec_to_activity_spec_parameters;
4 DELETE FROM activity_spec_to_activity_spec_categories;
5 DELETE FROM activity_spec_to_user_parameters;
6 DELETE FROM activity_spec;
7 DELETE FROM activity_spec_categories;
8 DELETE FROM activity_spec_parameters;
9 DELETE FROM user_parameters;
10
11 INSERT INTO activity_spec (NAME, DESCRIPTION, VERSION) 
12 VALUES 
13 ('VNFSetInMaintFlagActivity','Activity to Set InMaint Flag in A&AI',1.0),
14 ('VNFCheckPserversLockedFlagActivity','Activity Check Pservers Locked Flag VNF',1.0),
15 ('VNFCheckInMaintFlagActivity','Activity CheckIn Maint Flag on VNF',1.0),
16 ('VNFCheckClosedLoopDisabledFlagActivity','Activity Check Closed Loop Disabled Flag on VNF',1.0),
17 ('VNFSetClosedLoopDisabledFlagActivity','Activity Set Closed Loop Disabled Flag on VNF',1.0),
18 ('VNFUnsetClosedLoopDisabledFlagActivity','Activity Unset Closed Loop Disabled Flag on VNF',1.0),
19 ('VNFLockActivity','Activity Lock on VNF',1.0),
20 ('VNFUnlockActivity','Activity UnLock on VNF',1.0),
21 ('VNFStopActivity','Activity Stop on VNF',1.0),
22 ('VNFStartActivity','Activity Start on VNF',1.0),
23 ('VNFSnapShotActivity','Activity Snap Shot on VNF',1.0),
24 ('FlowCompleteActivity','Activity Complete on VNF',1.0),
25 ('PauseForManualTaskActivity','Activity Pause For Manual Task on VNF',1.0),
26 ('DistributeTrafficActivity','Activity Distribute Traffic on VNF',1.0),
27 ('DistributeTrafficCheckActivity','Activity Distribute Traffic Check on VNF',1.0),
28 ('VNFHealthCheckActivity','Activity Health Check on VNF',1.0),
29 ('VNFQuiesceTrafficActivity','Activity Quiesce Traffic on VNF',1.0),
30 ('VNFResumeTrafficActivity','Activity Resume Traffic on VNF',1.0),
31 ('VNFUnsetInMaintFlagActivity','Activity Unset InMaint Flag on VNF',1.0),
32 ('VNFUpgradeBackupActivity','Activity Upgrade Backup on VNF',1.0),
33 ('VNFUpgradePostCheckActivity','Activity Upgrade Post Check on VNF',1.0),
34 ('VNFUpgradePreCheckActivity','Activity Upgrade PreCheck on VNF',1.0),
35 ('VNFUpgradeSoftwareActivity','Activity UpgradeS oftware on VNF',1.0),
36 ('VnfInPlaceSoftwareUpdate','Activity InPlace Software Update on VNF',1.0);
37
38 INSERT INTO activity_spec_categories (NAME)
39 VALUES ('VNF');
40
41 INSERT INTO activity_spec_to_activity_spec_categories(ACTIVITY_SPEC_ID, ACTIVITY_SPEC_CATEGORIES_ID) 
42 VALUES
43 ((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0),
44 (select ID from activity_spec_categories where NAME='VNF')),
45 ((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0),
46 (select ID from activity_spec_categories where NAME='VNF')),
47 ((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0),
48 (select ID from activity_spec_categories where NAME='VNF')),
49 ((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0),
50 (select ID from activity_spec_categories where NAME='VNF')),
51 ((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0),
52 (select ID from activity_spec_categories where NAME='VNF')),
53 ((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0),
54 (select ID from activity_spec_categories where NAME='VNF')),
55 ((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0),
56 (select ID from activity_spec_categories where NAME='VNF')),
57 ((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0),
58 (select ID from activity_spec_categories where NAME='VNF')),
59 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
60 (select ID from activity_spec_categories where NAME='VNF')),
61 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
62 (select ID from activity_spec_categories where NAME='VNF')),
63 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
64 (select ID from activity_spec_categories where NAME='VNF')),
65 ((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0),
66 (select ID from activity_spec_categories where NAME='VNF')),
67 ((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0),
68 (select ID from activity_spec_categories where NAME='VNF')),
69 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
70 (select ID from activity_spec_categories where NAME='VNF')),
71 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
72 (select ID from activity_spec_categories where NAME='VNF')),
73 ((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0),
74 (select ID from activity_spec_categories where NAME='VNF')),
75 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
76 (select ID from activity_spec_categories where NAME='VNF')),
77 ((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0),
78 (select ID from activity_spec_categories where NAME='VNF')),
79 ((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0),
80 (select ID from activity_spec_categories where NAME='VNF')),
81 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
82 (select ID from activity_spec_categories where NAME='VNF')),
83 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
84 (select ID from activity_spec_categories where NAME='VNF')),
85 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
86 (select ID from activity_spec_categories where NAME='VNF')),
87 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
88 (select ID from activity_spec_categories where NAME='VNF')),
89 ((select ID from activity_spec where NAME='VnfInPlaceSoftwareUpdate' and VERSION=1.0),
90 (select ID from activity_spec_categories where NAME='VNF'));
91
92 INSERT INTO activity_spec_parameters (NAME, TYPE, DIRECTION, DESCRIPTION) 
93 VALUES('WorkflowException','WorkflowException','output','Description');
94
95 INSERT INTO activity_spec_to_activity_spec_parameters( ACTIVITY_SPEC_ID, ACTIVITY_SPEC_PARAMETERS_ID) 
96 VALUES
97 ((select ID from activity_spec where NAME='VNFSetInMaintFlagActivity' and VERSION=1.0),
98 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
99 ((select ID from activity_spec where NAME='VNFCheckPserversLockedFlagActivity' and VERSION=1.0),
100 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
101 ((select ID from activity_spec where NAME='VNFCheckInMaintFlagActivity' and VERSION=1.0),
102 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
103 ((select ID from activity_spec where NAME='VNFCheckClosedLoopDisabledFlagActivity' and VERSION=1.0),
104 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
105 ((select ID from activity_spec where NAME='VNFSetClosedLoopDisabledFlagActivity' and VERSION=1.0),
106 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
107 ((select ID from activity_spec where NAME='VNFUnsetClosedLoopDisabledFlagActivity' and VERSION=1.0),
108 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
109 ((select ID from activity_spec where NAME='VNFLockActivity' and VERSION=1.0),
110 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
111 ((select ID from activity_spec where NAME='VNFUnlockActivity' and VERSION=1.0),
112 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
113 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
114 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
115 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
116 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
117 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
118 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
119 ((select ID from activity_spec where NAME='FlowCompleteActivity' and VERSION=1.0),
120 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
121 ((select ID from activity_spec where NAME='PauseForManualTaskActivity' and VERSION=1.0),
122 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
123 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
124 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
125 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
126 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
127 ((select ID from activity_spec where NAME='VNFHealthCheckActivity' and VERSION=1.0),
128 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
129 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
130 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
131 ((select ID from activity_spec where NAME='VNFResumeTrafficActivity' and VERSION=1.0),
132 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
133 ((select ID from activity_spec where NAME='VNFUnsetInMaintFlagActivity' and VERSION=1.0),
134 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
135 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
136 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
137 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
138 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
139 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
140 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output')),
141 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
142 (select ID from activity_spec_parameters where NAME='WorkflowException' and DIRECTION='output'));
143
144 INSERT INTO `user_parameters`(`NAME`,`PAYLOAD_LOCATION`,`LABEL`,`TYPE`,`DESCRIPTION`,`IS_REQUIRED`,`MAX_LENGTH`,`ALLOWABLE_CHARS`)
145 VALUES 
146 ('cloudOwner','cloudConfiguration','Cloud Owner','text','',1,7,''), 
147 ('operations_timeout','userParams','Operations Timeout','text','',1,50,''),
148 ('existing_software_version','userParams','Existing Software Version','text','',1,50,''),
149 ('tenantId','cloudConfiguration','Tenant/Project ID','text','',1,36,''),
150 ('new_software_version','userParams','New Software Version','text','',1,50,''),
151 ('book_name','userParams','Name of Commands Book Set','text','',1,50,''),
152 ('node_list','userParams','List of Nodes','text','',1,200,''),
153 ('file_parameter_content','userParams','Configuration File Content','text','',1,50000,''),
154 ('lcpCloudRegionId','cloudConfiguration','Cloud Region ID','text','',1,7,'');
155
156 INSERT INTO `activity_spec_to_user_parameters`(`ACTIVITY_SPEC_ID`,`USER_PARAMETERS_ID`)
157 VALUES
158 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
159 (select ID from user_parameters where NAME='lcpCloudRegionId')),
160 ((select ID from activity_spec where NAME='VNFStopActivity' and VERSION=1.0),
161 (select ID from user_parameters where NAME='tenantId')),
162 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
163 (select ID from user_parameters where NAME='lcpCloudRegionId')),
164 ((select ID from activity_spec where NAME='VNFStartActivity' and VERSION=1.0),
165 (select ID from user_parameters where NAME='tenantId')),
166 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
167 (select ID from user_parameters where NAME='lcpCloudRegionId')),
168 ((select ID from activity_spec where NAME='VNFSnapShotActivity' and VERSION=1.0),
169 (select ID from user_parameters where NAME='tenantId')),
170 ((select ID from activity_spec where NAME='VNFQuiesceTrafficActivity' and VERSION=1.0),
171 (select ID from user_parameters where NAME='operations_timeout')),
172 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
173 (select ID from user_parameters where NAME='book_name')),
174 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
175 (select ID from user_parameters where NAME='node_list')),
176 ((select ID from activity_spec where NAME='DistributeTrafficActivity' and VERSION=1.0),
177 (select ID from user_parameters where NAME='file_parameter_content')),
178 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
179 (select ID from user_parameters where NAME='book_name')),
180 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
181 (select ID from user_parameters where NAME='node_list')),
182 ((select ID from activity_spec where NAME='DistributeTrafficCheckActivity' and VERSION=1.0),
183 (select ID from user_parameters where NAME='file_parameter_content')),
184 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
185 (select ID from user_parameters where NAME='existing_software_version')),
186 ((select ID from activity_spec where NAME='VNFUpgradeBackupActivity' and VERSION=1.0),
187 (select ID from user_parameters where NAME='new_software_version')),
188 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
189 (select ID from user_parameters where NAME='existing_software_version')),
190 ((select ID from activity_spec where NAME='VNFUpgradePostCheckActivity' and VERSION=1.0),
191 (select ID from user_parameters where NAME='new_software_version')),
192 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
193 (select ID from user_parameters where NAME='existing_software_version')),
194 ((select ID from activity_spec where NAME='VNFUpgradePreCheckActivity' and VERSION=1.0),
195 (select ID from user_parameters where NAME='new_software_version')),
196 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
197 (select ID from user_parameters where NAME='existing_software_version')),
198 ((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
199 (select ID from user_parameters where NAME='new_software_version'));
200
201 INSERT INTO `workflow` (`ARTIFACT_UUID`,`ARTIFACT_NAME`,`NAME`,`OPERATION_NAME`,`VERSION`,`DESCRIPTION`,`RESOURCE_TARGET`,`SOURCE`)
202 VALUES
203 ('9d45cd30-1a89-4993-87c1-6dd09c1696cf','VFModule-ScaleOut','VNF Scale Out','ScaleOut',1.0,'native static workflow to support ScaleOut','vfModule','native'),
204 ('da6478e4-ea33-3346-ac12-ab121284a333','VnfInPlaceUpdate.bpmn','VNF In Place Software Update','inPlaceSoftwareUpdate',1.0,'native static workflow to support inPlaceSoftwareUpdate','vnf','native'),
205 ('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VNF Config Update','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native');