aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy
blob: 59998576089de181c0fc2875cfdf63dc12bb838b (plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
/*-
 * ============LICENSE_START=======================================================
 * OPENECOMP - MSO
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.openecomp.mso.bpmn.infrastructure.scripts

import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.runtime.Execution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.NetworkUtils
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
import org.openecomp.mso.bpmn.common.scripts.VfModule
import org.openecomp.mso.bpmn.common.scripts.VfModuleBase
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.bpmn.core.json.JsonUtils;
import org.openecomp.mso.rest.APIResponse
import org.springframework.web.util.UriUtils

public class DoUpdateVfModule extends VfModuleBase {

	ExceptionUtil exceptionUtil = new ExceptionUtil()
	JsonUtils jsonUtil = new JsonUtils()

	/**
	 * Initialize the flow's variables.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void initProcessVariables(Execution execution) {
		execution.setVariable('prefix', 'DOUPVfMod_')
		execution.setVariable('DOUPVfMod_requestInfo', null)
		execution.setVariable('DOUPVfMod_serviceInstanceId', null)
		execution.setVariable('DOUPVfMod_requestId', null)
		execution.setVariable('DOUPVfMod_vnfInputs', null)
		execution.setVariable('DOUPVfMod_vnfId', null)
		execution.setVariable('DOUPVfMod_vnfName', null)
		execution.setVariable('DOUPVfMod_vnfNameFromAAI', null)
		execution.setVariable('DOUPVfMod_vfModuleName', null)
		execution.setVariable('DOUPVfMod_vfModuleId', null)
		execution.setVariable('DOUPVfMod_vnfType', null)
		execution.setVariable('DOUPVfMod_asdcServiceModelVersion', null)
		execution.setVariable('DOUPVfMod_vfModuleModelName', null)
		execution.setVariable('DOUPVfMod_modelCustomizationUuid', null)
		execution.setVariable("DOUPVfMod_isBaseVfModule", "false")
		execution.setVariable('DOUPVfMod_serviceId', null)
		execution.setVariable('DOUPVfMod_aicCloudRegion', null)
		execution.setVariable('DOUPVfMod_tenantId', null)
		execution.setVariable('DOUPVfMod_volumeGroupId', null)
		execution.setVariable('DOUPVfMod_vfModule', null)
		execution.setVariable('DOUPVfMod_vnfParams', null)
		execution.setVariable("DOUPVfMod_baseVfModuleId", "")
		execution.setVariable("DOUPVfMod_baseVfModuleHeatStackId", "")
		execution.setVariable('DOUPVfMod_prepareUpdateAAIVfModuleRequest', null)
		execution.setVariable('DOUPVfMod_sdncChangeAssignRequest', null)
		execution.setVariable('DOUPVfMod_sdncChangeAssignResponse', null)
		execution.setVariable('DOUPVfMod_sdncActivateRequest', null)
		execution.setVariable('DOUPVfMod_sdncActivateResponse', null)
		execution.setVariable('DOUPVfMod_sdncTopologyRequest', null)
		execution.setVariable('DOUPVfMod_sdncTopologyResponse', null)
		execution.setVariable('DOUPVfMod_vnfAdapterRestRequest', null)
		execution.setVariable('DOUPVfMod_updateAAIGenericVnfRequest', null)
		execution.setVariable('DOUPVfMod_updateAAIVfModuleRequest', null)
		execution.setVariable('DOUPVfMod_skipUpdateGenericVnf', false)
		execution.setVariable('DoUpdateVfModuleSuccessIndicator', false)
	}

	/**
	 * Check for missing elements in the received request.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void preProcessRequest(Execution execution) {
		def method = getClass().getSimpleName() + '.preProcessRequest(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			initProcessVariables(execution)
			def xml = getVariable(execution, 'DoUpdateVfModuleRequest')
			utils.logAudit("DoUpdateVfModule request: " + xml)
			logDebug('Received request xml:\n' + xml, isDebugLogEnabled)
			
			if (xml == null || xml.isEmpty()) {
				// Building Block-type request

				String cloudConfiguration = execution.getVariable("cloudConfiguration")
				String vfModuleModelInfo = execution.getVariable("vfModuleModelInfo")
				
				def serviceModelInfo = execution.getVariable("serviceModelInfo")
				logDebug("serviceModelInfo: " + serviceModelInfo, isDebugLogEnabled)
				def vnfModelInfo = execution.getVariable("vnfModelInfo")
				

				//tenantId
				def tenantId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.tenantId")
				execution.setVariable("DOUPVfMod_tenantId", tenantId)
				
				//volumeGroupId
				def volumeGroupId = execution.getVariable("volumeGroupId")
				execution.setVariable("DOUPVfMod_volumeGroupId", volumeGroupId)
				//volumeGroupName
				def volumeGroupName = execution.getVariable("volumeGroupName")
				execution.setVariable("DOUPVfMod_volumeGroupName", volumeGroupName)
				//cloudSiteId
				def cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "cloudConfiguration.lcpCloudRegionId")
				execution.setVariable("DOUPVfMod_cloudSiteId", cloudSiteId)
				
				logDebug("cloudSiteId: " + cloudSiteId, isDebugLogEnabled)
				//vnfType
				def vnfType = execution.getVariable("vnfType")
				execution.setVariable("DOUPVfMod_vnfType", vnfType)
				
				logDebug("vnfType: " + vnfType, isDebugLogEnabled)
				//vnfName
				def vnfName = execution.getVariable("vnfName")
				execution.setVariable("DOUPVfMod_vnfName", vnfName)
				
				logDebug("vnfName: " + vnfName, isDebugLogEnabled)
				//vnfId
				def vnfId = execution.getVariable("vnfId")
				execution.setVariable("DOUPVfMod_vnfId", vnfId)
				
				logDebug("vnfId: " + vnfId, isDebugLogEnabled)
				//vfModuleName
				def vfModuleName = execution.getVariable("vfModuleName")
				execution.setVariable("DOUPVfMod_vfModuleName", vfModuleName)
				
				logDebug("vfModuleName: " + vfModuleName, isDebugLogEnabled)
				//vfModuleModelName
				def vfModuleModelName = jsonUtil.getJsonValue(vfModuleModelInfo, "modelName")
				execution.setVariable("DOUPVfMod_vfModuleModelName", vfModuleModelName)
				
				logDebug("vfModuleModelName: " + vfModuleModelName, isDebugLogEnabled)
				//modelCustomizationUuid
				def modelCustomizationUuid = jsonUtil.getJsonValue(vfModuleModelInfo, "modelCustomizationId")
				execution.setVariable("DOUPVfMod_modelCustomizationUuid", modelCustomizationUuid)
				
				logDebug("modelCustomizationUuid: " + modelCustomizationUuid, isDebugLogEnabled)
				//vfModuleId
				def vfModuleId = execution.getVariable("vfModuleId")
				execution.setVariable("DOUPVfMod_vfModuleId", vfModuleId)
				logDebug("vfModuleId: " + vfModuleId, isDebugLogEnabled)
				def requestId = execution.getVariable("requestId")
				execution.setVariable("DOUPVfMod_requestId", requestId)
				logDebug("requestId: " + requestId, isDebugLogEnabled)
				// Set mso-request-id to request-id for VNF Adapter interface
				execution.setVariable("mso-request-id", requestId)
				//serviceId
				def serviceId = execution.getVariable("serviceId")
				execution.setVariable("DOUPVfMod_serviceId", serviceId)
				logDebug("serviceId: " + serviceId, isDebugLogEnabled)
				//serviceInstanceId
				def serviceInstanceId = execution.getVariable("serviceInstanceId")
				execution.setVariable("DOUPVfMod_serviceInstanceId", serviceInstanceId)
				
				logDebug("serviceInstanceId: " + serviceInstanceId, isDebugLogEnabled)
				//source - HARDCODED
				def source = "VID"
				execution.setVariable("DOUPVfMod_source", source)
				
				logDebug("source: " + source, isDebugLogEnabled)
				//backoutOnFailure
				def disableRollback = execution.getVariable("disableRollback")
				def backoutOnFailure = true
				if (disableRollback != null && disableRollback.equals("true")) {
					backoutOnFailure = false
				}
				execution.setVariable("DOUPVfMod_backoutOnFailure", backoutOnFailure)
				logDebug("backoutOnFailure: " + backoutOnFailure, isDebugLogEnabled)
				//isBaseVfModule
				def isBaseVfModule = execution.getVariable("isBaseVfModule")
				execution.setVariable("DOUPVfMod_isBaseVfModule", isBaseVfModule)
				logDebug("isBaseVfModule: " + isBaseVfModule, isDebugLogEnabled)
				//asdcServiceModelVersion
				def asdcServiceModelVersion = execution.getVariable("asdcServiceModelVersion")
				execution.setVariable("DOUPVfMod_asdcServiceModelVersion", asdcServiceModelVersion)
				logDebug("asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugLogEnabled)
				//personaModelId
				execution.setVariable("DOUPVfMod_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantId"))
				//personaModelVersion
				execution.setVariable("DOUPVfMod_personaModelVersion", jsonUtil.getJsonValue(vfModuleModelInfo, "modelVersion"))
				//Get or Generate UUID
				String uuid = execution.getVariable("DOUPVfMod_uuid")
				if(uuid == null){
					uuid = UUID.randomUUID()
					logDebug("Generated messageId (UUID) is: " + uuid, isDebugLogEnabled)
				}else{
					logDebug("Found messageId (UUID) is: " + uuid, isDebugLogEnabled)
				}
				//isVidRequest
				String isVidRequest = execution.getVariable("isVidRequest")
				// default to true
				if (isVidRequest == null || isVidRequest.isEmpty()) {
					execution.setVariable("isVidRequest", "true")
				}
				//globalSubscriberId
				String globalSubscriberId = execution.getVariable("globalSubscriberId")
				execution.setVariable("DOUPVfMod_globalSubscriberId", globalSubscriberId)
				logDebug("globalSubsrciberId: " + globalSubscriberId, isDebugLogEnabled)
				//vnfQueryPath
				String vnfQueryPath = execution.getVariable("vnfQueryPath")
				execution.setVariable("DOUPVfMod_vnfQueryPath", vnfQueryPath)
				logDebug("vnfQueryPath: " + vnfQueryPath, isDebugLogEnabled)

				String vnfParamsChildNodes = execution.getVariable("vfModuleInputParams")
				execution.setVariable('DOUPVfMod_vnfParams', vnfParamsChildNodes)
			}
			else {

				def requestInfo = getRequiredNodeXml(execution, xml, 'request-info')
				execution.setVariable('DOUPVfMod_requestInfo', requestInfo)
				execution.setVariable('DOUPVfMod_requestId', getRequiredNodeText(execution, requestInfo, 'request-id'))
			def serviceInstanceId = execution.getVariable('mso-service-instance-id')
				if (serviceInstanceId == null) {
					serviceInstanceId = ''
				}
				execution.setVariable('DOUPVfMod_serviceInstanceId', serviceInstanceId)
	
				def vnfInputs = getRequiredNodeXml(execution, xml, 'vnf-inputs')
				execution.setVariable('DOUPVfMod_vnfInputs', vnfInputs)
				execution.setVariable('DOUPVfMod_vnfId', getRequiredNodeText(execution, vnfInputs, 'vnf-id'))
				execution.setVariable('DOUPVfMod_vfModuleId', getRequiredNodeText(execution, vnfInputs, 'vf-module-id'))
				execution.setVariable('DOUPVfMod_vfModuleName', getNodeTextForce(vnfInputs, 'vf-module-name'))
				execution.setVariable('DOUPVfMod_vnfType', getNodeTextForce(vnfInputs, 'vnf-type'))
				execution.setVariable('DOUPVfMod_vnfName', getNodeTextForce(vnfInputs, 'vnf-name'))
				execution.setVariable('DOUPVfMod_asdcServiceModelVersion', getNodeTextForce(vnfInputs, 'asdc-service-model-version'))
				execution.setVariable('DOUPVfMod_vfModuleModelName', getRequiredNodeText(execution, vnfInputs, 'vf-module-model-name'))
				execution.setVariable('DOUPVfMod_modelCustomizationUuid', getNodeTextForce(vnfInputs, 'model-customization-id'))
				execution.setVariable('DOUPVfMod_serviceId', getRequiredNodeText(execution, vnfInputs, 'service-id'))
				execution.setVariable('DOUPVfMod_aicCloudRegion', getRequiredNodeText(execution, vnfInputs, 'aic-cloud-region'))
				execution.setVariable('DOUPVfMod_tenantId', getRequiredNodeText(execution, vnfInputs, 'tenant-id'))
				//isBaseVfModule
				def isBaseVfModule = "false"
				if (utils.nodeExists(xml, "is-base-vf-module")) {
					isBaseVfModule = utils.getNodeText(xml, "is-base-vf-module")
					execution.setVariable("DOUPVfMod_isBaseVfModule", isBaseVfModule)
				}
				logDebug("isBaseVfModule: " + isBaseVfModule, isDebugLogEnabled)
	
				NetworkUtils networkUtils = new NetworkUtils()
				def backoutOnFailure = networkUtils.isRollbackEnabled(execution, xml)
				execution.setVariable("DOUPVfMod_backoutOnFailure", backoutOnFailure)
	
				def String vgi = getNodeTextForce(vnfInputs, 'volume-group-id')
				execution.setVariable('DOUPVfMod_volumeGroupId', vgi)
	
				execution.setVariable('DOUPVfMod_vnfParams', utils.getNodeXml(xml, 'vnf-params', false))
			}

			def sdncCallbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
			if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
				def msg = 'Required variable \'URN_mso_workflow_sdncadapter_callback\' is missing'
				logError(msg)
				exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
			}

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preProcessRequest(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the PrepareUpdateAAIVfModule subflow.  This will
	 * set the orchestration-status to 'pending-update'.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepPrepareUpdateAAIVfModule(Execution execution) {
		def method = getClass().getSimpleName() + '.preparePrepareUpdateAAIVfModule(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')
			def orchestrationStatus = 'pending-update'

			String prepareUpdateAAIVfModuleRequest = """
				<PrepareUpdateAAIVfModuleRequest>
					<vnf-id>${vnfId}</vnf-id>
					<vf-module-id>${vfModuleId}</vf-module-id>
					<orchestration-status>${orchestrationStatus}</orchestration-status>
				</PrepareUpdateAAIVfModuleRequest>
			"""
			prepareUpdateAAIVfModuleRequest = utils.formatXml(prepareUpdateAAIVfModuleRequest)
			execution.setVariable('DOUPVfMod_prepareUpdateAAIVfModuleRequest', prepareUpdateAAIVfModuleRequest)
			utils.logAudit("DoUpdateAAIVfModule request: " + prepareUpdateAAIVfModuleRequest)
			logDebug('Request for PrepareUpdateAAIVfModule:\n' + prepareUpdateAAIVfModuleRequest, isDebugLogEnabled)

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in preparePrepareUpdateAAIVfModule(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the ConfirmVolumeGroupTenant subflow.  Currently,
	 * there is really nothing to do, so we just log that we're passing through.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepConfirmVolumeGroupTenant(Execution execution) {
		def method = getClass().getSimpleName() + '.prepConfirmVolumeGroupTenant(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			// Nothing to do - just log that we're passing through here

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepConfirmVolumeGroupTenant(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the SDNC Adapter subflow to perform
	 * a VNF topology 'changeassign' operation.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepSDNCTopologyChg(Execution execution) {
		def method = getClass().getSimpleName() + '.prepSDNCTopologyChg(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def requestId = execution.getVariable('DOUPVfMod_requestId')
			def serviceInstanceId = execution.getVariable('DOUPVfMod_serviceInstanceId')
			def callbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
			def serviceId = execution.getVariable('DOUPVfMod_serviceId')
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vnfType = execution.getVariable('DOUPVfMod_vnfType')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')
			def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName')
			def VfModule vfModule = (VfModule) execution.getVariable('DOUPVfMod_vfModule')
			def vfModuleName = vfModule.getElementText('vf-module-name')
			def tenantId = execution.getVariable('DOUPVfMod_tenantId')
			def aicCloudRegion = execution.getVariable('DOUPVfMod_aicCloudRegion')

			// Retrieve vnf name from AAI response
			def vnfName = execution.getVariable('DOUPVfMod_vnfNameFromAAI')
			execution.setVariable('DOUPVfMod_vnfName', vnfName)

			def vnfParamsXml = execution.getVariable('DOUPVfMod_vnfParams')
			def vnfNetworks = transformNetworkParamsToVnfNetworks(vnfParamsXml)

			String sdncTopologyRequest = """
				<sdncadapterworkflow:SDNCAdapterWorkflowRequest
						xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
						xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
					<sdncadapter:RequestHeader>
						<sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
						<sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>
						<sdncadapter:SvcAction>changeassign</sdncadapter:SvcAction>
						<sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
						<sdncadapter:CallbackUrl>${callbackUrl}</sdncadapter:CallbackUrl>
					</sdncadapter:RequestHeader>
					<sdncadapterworkflow:SDNCRequestData>
					      <request-information>
					         <request-id>${requestId}</request-id>
					         <request-action>ChangeVNFActivateRequest</request-action>
					         <source>PORTAL</source>
					         <notification-url/>
					         <order-number/>
					         <order-version/>
					      </request-information>
					      <service-information>
					         <service-type>${serviceId}</service-type>
					         <service-instance-id>${vnfId}</service-instance-id>
					         <subscriber-name>dontcare</subscriber-name>
					      </service-information>
					      <vnf-request-information>
					         <vnf-id>${vfModuleId}</vnf-id>
					         <vnf-type>${vfModuleModelName}</vnf-type>
					         <vnf-name>${vfModuleName}</vnf-name>
					         <generic-vnf-id>${vnfId}</generic-vnf-id>
					         <generic-vnf-name>${vnfName}</generic-vnf-name>
							 <generic-vnf-type>${vnfType}</generic-vnf-type>
					         <tenant>${tenantId}</tenant>
					         <aic-cloud-region>${aicCloudRegion}</aic-cloud-region>
					         ${vnfNetworks}
					      </vnf-request-information>
 					</sdncadapterworkflow:SDNCRequestData>
				</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
			"""
			sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
			execution.setVariable('DOUPVfMod_sdncChangeAssignRequest', sdncTopologyRequest)
			utils.logAudit("sdncChangeAssignRequest : " + sdncTopologyRequest)
			logDebug('Request for SDNCAdapter topology/changeassign:\n' + sdncTopologyRequest, isDebugLogEnabled)

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyChg(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the SDNC Adapter subflow to perform
	 * a VNF topology 'query' operation.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepSDNCTopologyQuery(Execution execution) {
		def method = getClass().getSimpleName() + '.prepSDNCTopologyQuery(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def requestId = execution.getVariable('DOUPVfMod_requestId')
			def serviceInstanceId = execution.getVariable('DOUPVfMod_serviceInstanceId')
			def callbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')

			def svcInstId = ""
			if (serviceInstanceId == null || serviceInstanceId.isEmpty()) {
				svcInstId = vfModuleId
			}
			else {
				svcInstId = serviceInstanceId
			}

			//!!!! TEMPORARY WORKAROUND FOR SDNC REPLICATION ISSUE
			sleep(5000)

			String sdncTopologyRequest = """
				<sdncadapterworkflow:SDNCAdapterWorkflowRequest
						xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
						xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
					<sdncadapter:RequestHeader>
						<sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
						<sdncadapter:SvcInstanceId>${svcInstId}</sdncadapter:SvcInstanceId>
						<sdncadapter:SvcAction>query</sdncadapter:SvcAction>
						<sdncadapter:SvcOperation>/VNF-API:vnfs/vnf-list/${vfModuleId}</sdncadapter:SvcOperation>
						<sdncadapter:CallbackUrl>${callbackUrl}</sdncadapter:CallbackUrl>
						<sdncadapter:MsoAction>mobility</sdncadapter:MsoAction>
					</sdncadapter:RequestHeader>
				</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
			"""
			sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
			execution.setVariable('DOUPVfMod_sdncTopologyRequest', sdncTopologyRequest)
			utils.logAudit("sdncTopologyRequest : " + sdncTopologyRequest)
			logDebug('Request for SDNCAdapter query:\n' + sdncTopologyRequest, isDebugLogEnabled)

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyQuery(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the VnfAdapterRest subflow.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepVnfAdapterRest(Execution execution) {
		def method = getClass().getSimpleName() + '.prepVnfAdapterRest(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def requestId = execution.getVariable('DOUPVfMod_requestId')
			def serviceInstanceId = execution.getVariable('DOUPVfMod_serviceInstanceId')
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')
			def vfModuleName = execution.getVariable('DOUPVfMod_vfModuleName')
			def vnfInputs = execution.getVariable('DOUPVfMod_vnfInputs')
			def tenantId = execution.getVariable('DOUPVfMod_tenantId')
			def volumeGroupId = execution.getVariable('DOUPVfMod_volumeGroupId')
			def VfModule vfModule = (VfModule) execution.getVariable('DOUPVfMod_vfModule')
			def heatStackId = vfModule.getElementText('heat-stack-id')
			def cloudId = execution.getVariable('DOUPVfMod_aicCloudRegion')
			def vnfType = execution.getVariable('DOUPVfMod_vnfType')
			def vnfName = execution.getVariable('DOUPVfMod_vnfName')
			def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName')
			def baseVfModuleId = execution.getVariable("DOUPVfMod_baseVfModuleId")
			def baseVfModuleStackId = execution.getVariable("DOUPVfMod_baseVfModuleHeatStackId")
			def asdcServiceModelVersion = execution.getVariable('DOUPVfMod_asdcServiceModelVersion')
			def modelCustomizationUuid = execution.getVariable('DOUPVfMod_modelCustomizationUuid')
			def backoutOnFailure = execution.getVariable("DOUPVfMod_backoutOnFailure")

			def vnfParamsXml = execution.getVariable('DOUPVfMod_vnfParams')
			def vfModuleParamsEntries = transformParamsToEntries(vnfParamsXml)

			def messageId = execution.getVariable('mso-request-id') + '-' + System.currentTimeMillis()
			def notificationUrl = createCallbackURL(execution, "VNFAResponse", messageId)
			def useQualifiedHostName = execution.getVariable("URN_mso_use_qualified_host")
			if ('true'.equals(useQualifiedHostName)) {
					notificationUrl = utils.getQualifiedHostNameForCallback(notificationUrl)
			}

			String sdncGetResponse = execution.getVariable('DOUPVfMod_sdncTopologyResponse')

			String vfModuleParams = buildVfModuleParams(vfModuleParamsEntries, sdncGetResponse, vnfId, vnfName,
					vfModuleId, vfModuleName, null)


			String vnfAdapterRestRequest = """
				<updateVfModuleRequest>
					<cloudSiteId>${cloudId}</cloudSiteId>
					<tenantId>${tenantId}</tenantId>
					<vnfId>${vnfId}</vnfId>
					<vfModuleId>${vfModuleId}</vfModuleId>
					<vfModuleStackId>${heatStackId}</vfModuleStackId>
					<vnfType>${vnfType}</vnfType>
					<vnfVersion>${asdcServiceModelVersion}</vnfVersion>
					<modelCustomizationUuid>${modelCustomizationUuid}</modelCustomizationUuid>
					<vfModuleType>${vfModuleModelName}</vfModuleType>
					<volumeGroupId>${volumeGroupId}</volumeGroupId>
					<baseVfModuleId>${baseVfModuleId}</baseVfModuleId>
    				<baseVfModuleStackId>${baseVfModuleStackId}</baseVfModuleStackId>
					<skipAAI>true</skipAAI>
					<backout>${backoutOnFailure}</backout>
				    <failIfExists>false</failIfExists>
					<vfModuleParams>
						${vfModuleParams}
				    </vfModuleParams>
				    <msoRequest>
				        <requestId>${requestId}</requestId>
				        <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>
				    </msoRequest>
				    <messageId>${messageId}</messageId>
				    <notificationUrl>${notificationUrl}</notificationUrl>
				</updateVfModuleRequest>
			"""
			vnfAdapterRestRequest = utils.formatXml(vnfAdapterRestRequest)
			execution.setVariable('DOUPVfMod_vnfAdapterRestRequest', vnfAdapterRestRequest)
			utils.logAudit("vnfAdapterRestRequest : " + vnfAdapterRestRequest)
			logDebug('Request for VNFAdapter Rest:\n' + vnfAdapterRestRequest, isDebugLogEnabled)

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepVnfAdapterRest(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the UpdateAAIGenericVnf subflow.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepUpdateAAIGenericVnf(Execution execution) {
		def method = getClass().getSimpleName() + '.prepUpdateAAIGenericVnf(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vnfInputs = execution.getVariable('DOUPVfMod_vnfInputs')

			def personaModelId = utils.getNodeText1(vnfInputs, 'vnf-persona-model-id')
			def personaModelVersion = utils.getNodeText1(vnfInputs, 'vnf-persona-model-version')
			if ((personaModelId == null) || (personaModelVersion == null)) {
				logDebug('Skipping update for Generic VNF ' + vnfId +
					' because either \'vnf-persona-model-id\' or \'vnf-persona-model-version\' is absent', isDebugLogEnabled)
				execution.setVariable('DOUPVfMod_skipUpdateGenericVnf', true)
			} else {
				def personaModelIdElement = '<persona-model-id>' + personaModelId + '</persona-model-id>'
				def personaModelVersionElement = '<persona-model-version>' + personaModelVersion + '</persona-model-version>'

				String updateAAIGenericVnfRequest = """
					<UpdateAAIGenericVnfRequest>
						<vnf-id>${vnfId}</vnf-id>
						${personaModelIdElement}
						${personaModelVersionElement}
					</UpdateAAIGenericVnfRequest>
				"""
				updateAAIGenericVnfRequest = utils.formatXml(updateAAIGenericVnfRequest)
				execution.setVariable('DOUPVfMod_updateAAIGenericVnfRequest', updateAAIGenericVnfRequest)
				utils.logAudit("updateAAIGenericVnfRequest : " + updateAAIGenericVnfRequest)
				logDebug('Request for UpdateAAIGenericVnf:\n' + updateAAIGenericVnfRequest, isDebugLogEnabled)
			}

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the UpdateAAIVfModule subflow.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepUpdateAAIVfModule(Execution execution) {
		def method = getClass().getSimpleName() + '.prepUpdateAAIVfModule(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')
			def orchestrationStatus = 'updated'
			def vnfInputs = execution.getVariable('DOUPVfMod_vnfInputs')

			def volumeGroupIdElement = ''
			def volumeGroupId = execution.getVariable('DOUPVfMod_volumeGroupId')
			if (volumeGroupId != null) {
				volumeGroupIdElement = '<volume-group-id>' + volumeGroupId + '</volume-group-id>'
			}
			def personaModelIdElement = ''
			def personaModelId = utils.getNodeText1(vnfInputs, 'persona-model-id')
			if (personaModelId != null) {
				personaModelIdElement = '<persona-model-id>' + personaModelId + '</persona-model-id>'
			}
			def personaModelVersionElement = ''
			def personaModelVersion = utils.getNodeText1(vnfInputs, 'persona-model-version')
			if (personaModelVersion != null) {
				personaModelVersionElement = '<persona-model-version>' + personaModelVersion + '</persona-model-version>'
			}
			def contrailServiceInstanceFqdnElement = ''
			def contrailServiceInstanceFqdn = utils.getNodeText1(vnfInputs, 'contrail-service-instance-fqdn')
			if (contrailServiceInstanceFqdn != null) {
				contrailServiceInstanceFqdnElement = '<contrail-service-instance-fqdn>' + contrailServiceInstanceFqdn + '</contrail-service-instance-fqdn>'
			}
			def personaModelCustomizationIdElement = ''
			def modelCustomizationId = execution.getVariable('DOUPVfMod_modelCustomizationUuid')
			if (modelCustomizationId != null) {
				personaModelCustomizationIdElement = '<persona-model-customization-id>' + modelCustomizationId + '</persona-model-customization-id>'
			}

			String updateAAIVfModuleRequest = """
				<UpdateAAIVfModuleRequest>
					<vnf-id>${vnfId}</vnf-id>
					<vf-module-id>${vfModuleId}</vf-module-id>
					<orchestration-status>${orchestrationStatus}</orchestration-status>
					${volumeGroupIdElement}
					${personaModelIdElement}
					${personaModelVersionElement}
					${contrailServiceInstanceFqdnElement}
					${personaModelCustomizationIdElement}
				</UpdateAAIVfModuleRequest>
			"""
			updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
			execution.setVariable('DOUPVfMod_updateAAIVfModuleRequest', updateAAIVfModuleRequest)
			utils.logAudit("updateAAIVfModuleRequest : " + updateAAIVfModuleRequest)
			logDebug('Request for UpdateAAIVfModule:\n' + updateAAIVfModuleRequest, isDebugLogEnabled)

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIVfModule(): ' + e.getMessage())
		}
	}

	/**
	 * Prepare a Request for invoking the SDNC Adapter subflow to perform
	 * a VNF topology 'activate' operation.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void prepSDNCTopologyAct(Execution execution) {
		def method = getClass().getSimpleName() + '.prepSDNCTopologyAct(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def requestId = execution.getVariable('DOUPVfMod_requestId')
			def serviceInstanceId = execution.getVariable('DOUPVfMod_serviceInstanceId')
			def callbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
			def serviceId = execution.getVariable('DOUPVfMod_serviceId')
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vnfName = execution.getVariable('DOUPVfMod_vnfName')
			def vnfType = execution.getVariable('DOUPVfMod_vnfType')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')
			def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName')
			def VfModule vfModule = (VfModule) execution.getVariable('DOUPVfMod_vfModule')
			def vfModuleName = vfModule.getElementText('vf-module-name')
			def tenantId = execution.getVariable('DOUPVfMod_tenantId')
			def aicCloudRegion = execution.getVariable('DOUPVfMod_aicCloudRegion')

			def vnfParamsXml = execution.getVariable('DOUPVfMod_vnfParams')
			def vnfNetworks = transformNetworkParamsToVnfNetworks(vnfParamsXml)

			String sdncTopologyRequest = """
				<sdncadapterworkflow:SDNCAdapterWorkflowRequest
						xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
						xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
					<sdncadapter:RequestHeader>
						<sdncadapter:RequestId>${requestId}</sdncadapter:RequestId>
						<sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>
						<sdncadapter:SvcAction>activate</sdncadapter:SvcAction>
						<sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
						<sdncadapter:CallbackUrl>${callbackUrl}</sdncadapter:CallbackUrl>
					</sdncadapter:RequestHeader>
					<sdncadapterworkflow:SDNCRequestData>
					      <request-information>
					         <request-id>${requestId}</request-id>
					         <request-action>ChangeVNFActivateRequest</request-action>
					         <source>PORTAL</source>
					         <notification-url/>
					         <order-number/>
					         <order-version/>
					      </request-information>
					      <service-information>
					         <service-type>${serviceId}</service-type>
					         <service-instance-id>${vnfId}</service-instance-id>
					         <subscriber-name>dontcare</subscriber-name>
					      </service-information>
					      <vnf-request-information>
					         <vnf-id>${vfModuleId}</vnf-id>
					         <vnf-type>${vfModuleModelName}</vnf-type>
					         <vnf-name>${vfModuleName}</vnf-name>
					         <generic-vnf-id>${vnfId}</generic-vnf-id>
					         <generic-vnf-name>${vnfName}</generic-vnf-name>
							 <generic-vnf-type>${vnfType}</generic-vnf-type>
					         <tenant>${tenantId}</tenant>
					         <aic-cloud-region>${aicCloudRegion}</aic-cloud-region>
					      </vnf-request-information>
 					</sdncadapterworkflow:SDNCRequestData>
				</sdncadapterworkflow:SDNCAdapterWorkflowRequest>
			"""
			sdncTopologyRequest = utils.formatXml(sdncTopologyRequest)
			execution.setVariable('DOUPVfMod_sdncActivateRequest', sdncTopologyRequest)
			utils.logAudit("sdncActivateRequest : " + sdncTopologyRequest)
			logDebug('Request for SDNCAdapter topology/activate:\n' + sdncTopologyRequest, isDebugLogEnabled)


			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepSDNCTopologyAct(): ' + e.getMessage())
		}
	}

	/**
	 * Log a WorkflowException that has been created.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void handleWorkflowException(Execution execution) {
		def method = getClass().getSimpleName() + '.handleWorkflowException(' +
			'execution=' + execution.getId() +
			')'
		def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def WorkflowException workflowException = (WorkflowException) execution.getVariable('WorkflowException')
			logError(method + ' caught WorkflowException: ' + workflowException.getErrorMessage())

			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildWorkflowException(execution, 1002, 'Error in handleWorkflowException(): ' + e.getMessage())
		}
	}

	public void validateSDNCResponse(Execution execution, String response, String method){
		def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
		def prefix = execution.getVariable("prefix")

		logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)

		WorkflowException workflowException = execution.getVariable("WorkflowException")
		boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")

		utils.logAudit("workflowException: " + workflowException)

		SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
		sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)

		utils.logAudit("SDNCResponse: " + response)

		String sdncResponse = response
		if(execution.getVariable(prefix + 'sdncResponseSuccess') == true){
			logDebug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call.  Response is: \n" + sdncResponse, isDebugLogEnabled)
		}else{
			logDebug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.", isDebugLogEnabled)
			throw new BpmnError("MSOWorkflowException")
		}
		logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
	}

	/**
	 * Using the received vnfId and vfModuleId, query AAI to get the corresponding VNF info.
	 * A 200 response is expected with the VNF info in the response body. Will find out the base module info.
	 *
	 * @param execution The flow's execution instance.
	 */
	public void queryAAIVfModule(Execution execution) {
		def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
		def method = getClass().getSimpleName() + '.getVfModule(' +
			'execution=' + execution.getId() +
			')'
		logDebug('Entered ' + method, isDebugLogEnabled)

		try {
			def vnfId = execution.getVariable('DOUPVfMod_vnfId')
			def vfModuleId = execution.getVariable('DOUPVfMod_vfModuleId')

			AaiUtil aaiUriUtil = new AaiUtil(this)
			String  aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution)
			logDebug('AAI URI is: ' + aai_uri, isDebugLogEnabled)

			String endPoint = execution.getVariable("URN_aai_endpoint") + "${aai_uri}/" + UriUtils.encode(vnfId, "UTF-8") + "?depth=1"
			utils.logAudit("AAI endPoint: " + endPoint)

			try {
				def aaiRequestId = UUID.randomUUID().toString()
				logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
				APIResponse response = aaiUriUtil.executeAAIGetCall(execution, endPoint)
				utils.logAudit("createVfModule - invoking httpGet() to AAI")

				def responseData = response.getResponseBodyAsString()
				if (responseData != null) {
					logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)

				}

				utils.logAudit("createVfModule - queryAAIVfModule Response: " + responseData)
				utils.logAudit("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())

				execution.setVariable('DOUPVfMod_queryAAIVfModuleResponseCode', response.getStatusCode())
				execution.setVariable('DOUPVfMod_queryAAIVfModuleResponse', responseData)
				logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
				logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
				if (response.getStatusCode() == 200) {
					// Parse the VNF record from A&AI to find base module info
					logDebug('Parsing the VNF data to find base module info', isDebugLogEnabled)
					if (responseData != null) {
						def vfModulesText = utils.getNodeXml(responseData, "vf-modules")
						def xmlVfModules= new XmlSlurper().parseText(vfModulesText)
						def vfModules = xmlVfModules.'**'.findAll {it.name() == "vf-module"}
						int vfModulesSize = 0
						for (i in 0..vfModules.size()-1) {
							def vfModuleXml = groovy.xml.XmlUtil.serialize(vfModules[i])
							def isBaseVfModule = utils.getNodeText(vfModuleXml, "is-base-vf-module")

							if (isBaseVfModule == "true") {
							    String baseModuleId = utils.getNodeText1(vfModuleXml, "vf-module-id")
							    execution.setVariable("DOUPVfMod_baseVfModuleId", baseModuleId)
							    logDebug('Received baseVfModuleId: ' + baseModuleId, isDebugLogEnabled)
							    String baseModuleHeatStackId = utils.getNodeText1(vfModuleXml, "heat-stack-id")
							    execution.setVariable("DOUPVfMod_baseVfModuleHeatStackId", baseModuleHeatStackId)
							    logDebug('Received baseVfModuleHeatStackId: ' + baseModuleHeatStackId, isDebugLogEnabled)
							}
						}
					}
				}
			} catch (Exception ex) {
				ex.printStackTrace()
				logDebug('Exception occurred while executing AAI GET:' + ex.getMessage(),isDebugLogEnabled)
				exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
			}
			logDebug('Exited ' + method, isDebugLogEnabled)
		} catch (BpmnError e) {
			throw e;
		} catch (Exception e) {
			logError('Caught exception in ' + method, e)
			exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
		}
	}


}