2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.bpmn.infrastructure.scripts;
23 import static org.apache.commons.lang3.StringUtils.*;
24 import groovy.xml.XmlUtil
27 import org.openecomp.mso.bpmn.core.json.JsonUtils
28 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
29 import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
30 import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
31 import org.openecomp.mso.bpmn.core.WorkflowException
32 import org.openecomp.mso.rest.APIResponse;
33 import org.openecomp.mso.rest.RESTClient
34 import org.openecomp.mso.rest.RESTConfig
36 import java.util.UUID;
37 import javax.xml.parsers.DocumentBuilder
38 import javax.xml.parsers.DocumentBuilderFactory
40 import org.camunda.bpm.engine.delegate.BpmnError
41 import org.camunda.bpm.engine.runtime.Execution
42 import org.json.JSONObject;
43 import org.apache.commons.lang3.*
44 import org.apache.commons.codec.binary.Base64;
45 import org.springframework.web.util.UriUtils;
46 import org.w3c.dom.Document
47 import org.w3c.dom.Element
48 import org.w3c.dom.Node
49 import org.w3c.dom.NodeList
50 import org.xml.sax.InputSource
53 * This groovy class supports the <class>DoDeleteE2EServiceInstance.bpmn</class> process.
56 * @param - msoRequestId
57 * @param - globalSubscriberId - O
58 * @param - subscriptionServiceType - O
59 * @param - serviceInstanceId
60 * @param - serviceInstanceName - O
61 * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
62 * @param - sdncVersion
63 * @param - failNotFound - TODO
64 * @param - serviceInputParams - TODO
67 * @param - WorkflowException
71 public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
73 String Prefix="DDELSI_"
74 ExceptionUtil exceptionUtil = new ExceptionUtil()
75 JsonUtils jsonUtil = new JsonUtils()
77 public void preProcessRequest (Execution execution) {
78 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
79 utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled)
83 String requestId = execution.getVariable("msoRequestId")
84 execution.setVariable("prefix",Prefix)
87 //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
88 String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
89 if (globalSubscriberId == null)
91 execution.setVariable("globalSubscriberId", "")
94 //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
95 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
96 if (subscriptionServiceType == null)
98 execution.setVariable("subscriptionServiceType", "")
101 //Generated in parent for AAI PUT
102 String serviceInstanceId = execution.getVariable("serviceInstanceId")
103 if (isBlank(serviceInstanceId)){
104 msg = "Input serviceInstanceId is null"
105 utils.log("DEBUG", msg, isDebugEnabled)
106 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
109 String sdncCallbackUrl = execution.getVariable('URN_mso_workflow_sdncadapter_callback')
110 if (isBlank(sdncCallbackUrl)) {
111 msg = "URN_mso_workflow_sdncadapter_callback is null"
112 utils.log("DEBUG", msg, isDebugEnabled)
113 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
115 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
116 utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled)
118 StringBuilder sbParams = new StringBuilder()
119 Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
120 if (paramsMap != null)
122 sbParams.append("<service-input-parameters>")
123 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
125 String paramName = entry.getKey()
126 String paramValue = entry.getValue()
129 <name>${paramName}</name>
130 <value>${paramValue}</value>
133 sbParams.append(paramsXml)
135 sbParams.append("</service-input-parameters>")
137 String siParamsXml = sbParams.toString()
138 if (siParamsXml == null)
140 execution.setVariable("siParamsXml", siParamsXml)
142 } catch (BpmnError e) {
144 } catch (Exception ex){
145 msg = "Exception in preProcessRequest " + ex.getMessage()
146 utils.log("DEBUG", msg, isDebugEnabled)
147 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
149 utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
153 public void preProcessVFCDelete (Execution execution) {
156 public void postProcessVFCDelete(Execution execution, String response, String method) {
159 public void preProcessSDNCDelete (Execution execution) {
160 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
161 utils.log("DEBUG"," ***** preProcessSDNCDelete *****", isDebugEnabled)
165 def serviceInstanceId = execution.getVariable("serviceInstanceId")
166 def serviceInstanceName = execution.getVariable("serviceInstanceName")
167 def callbackURL = execution.getVariable("sdncCallbackUrl")
168 def requestId = execution.getVariable("msoRequestId")
169 def serviceId = execution.getVariable("productFamilyId")
170 def subscriptionServiceType = execution.getVariable("subscriptionServiceType")
171 def globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
173 String serviceModelInfo = execution.getVariable("serviceModelInfo")
174 def modelInvariantUuid = ""
175 def modelVersion = ""
178 if (!isBlank(serviceModelInfo))
180 modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
181 modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion")
182 modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid")
183 modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName")
185 if (modelInvariantUuid == null) {
186 modelInvariantUuid = ""
188 if (modelVersion == null) {
191 if (modelUuid == null) {
194 if (modelName == null) {
198 if (serviceInstanceName == null) {
199 serviceInstanceName = ""
201 if (serviceId == null) {
205 def siParamsXml = execution.getVariable("siParamsXml")
206 def serviceType = execution.getVariable("serviceType")
207 if (serviceType == null)
212 def sdncRequestId = UUID.randomUUID().toString()
215 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1"
216 xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1"
217 xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1">
218 <sdncadapter:RequestHeader>
219 <sdncadapter:RequestId>${sdncRequestId}</sdncadapter:RequestId>
220 <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId>
221 <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
222 <sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>
223 <sdncadapter:CallbackUrl>${callbackURL}</sdncadapter:CallbackUrl>
224 <sdncadapter:MsoAction>${serviceType}</sdncadapter:MsoAction>
225 </sdncadapter:RequestHeader>
226 <sdncadapterworkflow:SDNCRequestData>
227 <request-information>
228 <request-id>${requestId}</request-id>
233 <request-action>DeleteServiceInstance</request-action>
234 </request-information>
235 <service-information>
236 <service-id>${serviceId}</service-id>
237 <subscription-service-type>${subscriptionServiceType}</subscription-service-type>
238 <onap-model-information>
239 <model-invariant-uuid>${modelInvariantUuid}</model-invariant-uuid>
240 <model-uuid>${modelUuid}</model-uuid>
241 <model-version>${modelVersion}</model-version>
242 <model-name>${modelName}</model-name>
243 </onap-model-information>
244 <service-instance-id>${serviceInstanceId}</service-instance-id>
246 <global-customer-id>${globalSubscriberId}</global-customer-id>
247 </service-information>
248 <service-request-input>
249 <service-instance-name>${serviceInstanceName}</service-instance-name>
251 </service-request-input>
252 </sdncadapterworkflow:SDNCRequestData>
253 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
255 sdncDelete = utils.formatXml(sdncDelete)
256 def sdncRequestId2 = UUID.randomUUID().toString()
257 String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
258 execution.setVariable("sdncDelete", sdncDelete)
259 execution.setVariable("sdncDeactivate", sdncDeactivate)
260 utils.log("DEBUG","sdncDeactivate:\n" + sdncDeactivate, isDebugEnabled)
261 utils.log("DEBUG","sdncDelete:\n" + sdncDelete, isDebugEnabled)
263 } catch (BpmnError e) {
265 } catch(Exception ex) {
266 msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
267 utils.log("DEBUG", msg, isDebugEnabled)
268 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception Occured in preProcessSDNCDelete.\n" + ex.getMessage())
270 utils.log("DEBUG"," *****Exit preProcessSDNCDelete *****", isDebugEnabled)
273 public void postProcessSDNCDelete(Execution execution, String response, String method) {
275 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
276 utils.log("DEBUG"," ***** postProcessSDNC " + method + " *****", isDebugEnabled)
280 WorkflowException workflowException = execution.getVariable("WorkflowException")
281 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
282 utils.log("DEBUG", "SDNCResponse: " + response, isDebugEnabled)
283 utils.log("DEBUG", "workflowException: " + workflowException, isDebugEnabled)
285 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
286 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
288 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
289 utils.log("DEBUG","Good response from SDNC Adapter for service-instance " + method + "response:\n" + response, isDebugEnabled)
292 msg = "Bad Response from SDNC Adapter for service-instance " + method
293 utils.log("DEBUG", msg, isDebugEnabled)
294 exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
296 } catch (BpmnError e) {
298 } catch(Exception ex) {
299 msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
300 utils.log("DEBUG", msg, isDebugEnabled)
301 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
303 utils.log("DEBUG"," *** Exit postProcessSDNC " + method + " ***", isDebugEnabled)
306 public void postProcessAAIGET(Execution execution) {
307 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
308 utils.log("DEBUG"," ***** postProcessAAIGET ***** ", isDebugEnabled)
312 execution.setVariable("serviceInstanceId","serviceInstanceId")
313 execution.setVariable("GENGS_FoundIndicator",true)
314 execution.setVariable("GENGS_siResourceLink","GENGS_siResourceLink")
315 execution.setVariable("globalSubscriberId","globalSubscriberId")
316 execution.setVariable("subscriptionServiceType","subscriptionServiceType")
317 execution.setVariable("GENGS_service","GENGS_service")
318 execution.setVariable("GENGS_SuccessIndicator",true)
320 String serviceInstanceId = execution.getVariable("serviceInstanceId")
321 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
322 String serviceType = ""
324 if(foundInAAI == true){
325 utils.log("DEBUG","Found Service-instance in AAI", isDebugEnabled)
327 //Extract GlobalSubscriberId
328 String siRelatedLink = execution.getVariable("GENGS_siResourceLink")
329 if (isBlank(siRelatedLink))
331 msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
332 utils.log("DEBUG", msg, isDebugEnabled)
333 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
337 utils.log("DEBUG","Found Service-instance in AAI. link: " + siRelatedLink, isDebugEnabled)
338 String globalSubscriberId = execution.getVariable("globalSubscriberId")
339 if(isBlank(globalSubscriberId)){
340 int custStart = siRelatedLink.indexOf("customer/")
341 int custEnd = siRelatedLink.indexOf("/service-subscriptions")
342 globalSubscriberId = siRelatedLink.substring(custStart + 9, custEnd)
343 execution.setVariable("globalSubscriberId", globalSubscriberId)
346 //Extract Service Type if not provided on request
347 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
348 if(isBlank(subscriptionServiceType)){
349 int serviceStart = siRelatedLink.indexOf("service-subscription/")
350 int serviceEnd = siRelatedLink.indexOf("/service-instances/")
351 String serviceTypeEncoded = siRelatedLink.substring(serviceStart + 21, serviceEnd)
352 subscriptionServiceType = UriUtils.decode(serviceTypeEncoded, "UTF-8")
353 execution.setVariable("subscriptionServiceType", subscriptionServiceType)
356 if (isBlank(globalSubscriberId) || isBlank(subscriptionServiceType))
358 msg = "Could not retrive global-customer-id & subscription-service-type from AAI to delete id:" + serviceInstanceId
359 utils.log("DEBUG", msg, isDebugEnabled)
360 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
364 String siData = execution.getVariable("GENGS_service")
365 utils.log("DEBUG", "SI Data", isDebugEnabled)
368 msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
369 utils.log("DEBUG", msg, isDebugEnabled)
370 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
374 utils.log("DEBUG", "SI Data" + siData, isDebugEnabled)
375 serviceType = utils.getNodeText1(siData,"service-type")
376 execution.setVariable("serviceType", serviceType)
377 execution.setVariable("serviceRole", utils.getNodeText1(siData,"service-role"))
378 String orchestrationStatus = utils.getNodeText1(siData,"orchestration-status")
380 //Confirm there are no related service instances (vnf/network or volume)
381 if (utils.nodeExists(siData, "relationship-list")) {
382 utils.log("DEBUG", "SI Data relationship-list exists:", isDebugEnabled)
383 InputSource source = new InputSource(new StringReader(siData));
384 DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
385 DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
386 Document serviceXml = docBuilder.parse(source)
388 NodeList nodeList = serviceXml.getElementsByTagName("relationship")
389 for (int x = 0; x < nodeList.getLength(); x++) {
390 Node node = nodeList.item(x)
391 if (node.getNodeType() == Node.ELEMENT_NODE) {
392 Element eElement = (Element) node
393 def e = eElement.getElementsByTagName("related-to").item(0).getTextContent()
394 if(e.equals("generic-vnf") || e.equals("l3-network") || e.equals("allotted-resource") ){
395 utils.log("DEBUG", "ServiceInstance still has relationship(s) to generic-vnfs, l3-networks or allotted-resources", isDebugEnabled)
396 execution.setVariable("siInUse", true)
397 //there are relationship dependencies to this Service Instance
398 msg = " Stopped deleting Service Instance, it has dependencies. Service instance id: " + serviceInstanceId
399 utils.log("DEBUG", msg, isDebugEnabled)
400 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
402 utils.log("DEBUG", "Relationship NOT related to OpenStack", isDebugEnabled)
408 if ("TRANSPORT".equalsIgnoreCase(serviceType))
410 if ("PendingDelete".equals(orchestrationStatus))
412 execution.setVariable("skipDeactivate", true)
416 msg = "ServiceInstance of type TRANSPORT must in PendingDelete status to allow Delete. Orchestration-status:" + orchestrationStatus
417 utils.log("DEBUG", msg, isDebugEnabled)
418 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
424 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
425 if(succInAAI != true){
426 utils.log("DEBUG","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)
427 WorkflowException workflowException = execution.getVariable("WorkflowException")
428 utils.logAudit("workflowException: " + workflowException)
429 if(workflowException != null){
430 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
434 msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
435 utils.log("DEBUG", msg, isDebugEnabled)
436 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
440 utils.log("DEBUG","Service-instance NOT found in AAI. Silent Success", isDebugEnabled)
442 } catch (BpmnError e) {
444 } catch (Exception ex) {
445 msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
446 utils.log("DEBUG", msg, isDebugEnabled)
447 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
449 utils.log("DEBUG"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
452 public void postProcessAAIDEL(Execution execution) {
453 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
454 utils.log("DEBUG"," ***** postProcessAAIDEL ***** ", isDebugEnabled)
457 String serviceInstanceId = execution.getVariable("serviceInstanceId")
458 boolean succInAAI = execution.getVariable("GENDS_SuccessIndicator")
459 if(succInAAI != true){
460 msg = "Error deleting Service-instance in AAI" + serviceInstanceId
461 utils.log("DEBUG", msg, isDebugEnabled)
462 WorkflowException workflowException = execution.getVariable("WorkflowException")
463 utils.logAudit("workflowException: " + workflowException)
464 if(workflowException != null){
465 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
469 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
472 } catch (BpmnError e) {
474 } catch (Exception ex) {
475 msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIDEL. " + ex.getMessage()
476 utils.log("DEBUG", msg, isDebugEnabled)
477 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
479 utils.log("DEBUG"," *** Exit postProcessAAIDEL *** ", isDebugEnabled)
482 public void preInitResourcesOperStatus(Execution execution){
483 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
485 utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
487 String serviceId = execution.getVariable("serviceInstanceId")
488 String operationId = execution.getVariable("operationId")
489 String operationType = execution.getVariable("operationType")
490 String resourceTemplateUUIDs = ""
491 String result = "processing"
492 String progress = "0"
494 String operationContent = "Prepare service creation"
495 utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled)
496 serviceId = UriUtils.encode(serviceId,"UTF-8")
497 execution.setVariable("serviceInstanceId", serviceId)
498 execution.setVariable("operationId", operationId)
499 execution.setVariable("operationType", operationType)
500 // we use resource instance ids for delete flow as resourceTemplateUUIDs
503 "resourceInstanceId":"1111",
504 "resourceType":"vIMS"
507 "resourceInstanceId":"222",
508 "resourceType":"vEPC"
511 "resourceInstanceId":"3333",
512 "resourceType":"overlay"
515 "resourceInstanceId":"4444",
516 "resourceType":"underlay"
519 String serviceRelationShip = execution.getVariable("serviceRelationShip")
521 def jsonSlurper = new JsonSlurper()
522 def jsonOutput = new JsonOutput()
523 List relationShipList = jsonSlurper.parseText(serviceRelationShip)
525 if (relationShipList != null) {
526 relationShipList.each {
527 resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":"
531 def dbAdapterEndpoint = execution.getVariable("URN_mso_openecomp_adapters_db_endpoint")
532 execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
533 utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
536 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
537 xmlns:ns="http://org.openecomp.mso/requestsdb">
540 <ns:initResourceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">
541 <serviceId>${serviceId}</serviceId>
542 <operationId>${operationId}</operationId>
543 <operationType>${operationType}</operationType>
544 <resourceTemplateUUIDs>${resourceTemplateUUIDs}</resourceTemplateUUIDs>
545 </ns:initResourceOperationStatus>
547 </soapenv:Envelope>"""
549 payload = utils.formatXml(payload)
550 execution.setVariable("CVFMI_initResOperStatusRequest", payload)
551 utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled)
552 utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
555 utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled)
556 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
558 utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
562 * prepare delete parameters
564 public void preResourceDelete(execution, resourceName){
565 // we use resource instance ids for delete flow as resourceTemplateUUIDs
568 "resourceInstanceId":"1111",
569 "resourceType":"vIMS"
572 "resourceInstanceId":"222",
573 "resourceType":"vEPC"
576 "resourceInstanceId":"3333",
577 "resourceType":"overlay"
580 "resourceInstanceId":"4444",
581 "resourceType":"underlay"
584 String serviceRelationShip = execution.getVariable("serviceRelationShip")
585 def jsonSlurper = new JsonSlurper()
586 def jsonOutput = new JsonOutput()
587 List relationShipList = jsonSlurper.parseText(serviceRelationShip)
589 if (relationShipList != null) {
590 relationShipList.each {
591 if(resourceName.equals(it.resourceType))
592 String resouceTemplateUUID = it.resourceInstanceId
593 String resouceInstanceUUID = it.resourceInstanceId
594 execution.setVariable("resouceTemplateUUID", resouceTemplateUUID)
595 execution.setVariable("resouceInstanceId", resouceInstanceUUID)
596 execution.setResourceType("resourceType", resourceName)