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.onap.so.bpmn.infrastructure.scripts
23 import static org.apache.commons.lang3.StringUtils.*;
25 import javax.xml.parsers.DocumentBuilder
26 import javax.xml.parsers.DocumentBuilderFactory
28 import org.apache.commons.lang3.*
29 import org.camunda.bpm.engine.delegate.BpmnError
30 import org.camunda.bpm.engine.delegate.DelegateExecution
31 import org.json.JSONArray;
32 import org.json.JSONObject;
33 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
34 import org.onap.so.bpmn.common.scripts.ExceptionUtil
35 import org.onap.so.bpmn.common.scripts.MsoUtils
36 import org.onap.so.bpmn.core.UrnPropertiesReader
37 import org.onap.so.bpmn.core.WorkflowException
38 import org.onap.so.bpmn.core.json.JsonUtils
39 import org.onap.so.logger.MessageEnum
40 import org.onap.so.logger.MsoLogger
41 import org.springframework.web.util.UriUtils;
42 import org.w3c.dom.Document
43 import org.w3c.dom.Element
44 import org.w3c.dom.Node
45 import org.w3c.dom.NodeList
46 import org.xml.sax.InputSource
47 import org.onap.so.client.aai.entities.uri.AAIResourceUri
48 import org.onap.so.client.aai.entities.uri.AAIUriFactory
49 import org.onap.so.client.aai.AAIObjectType
50 import org.onap.so.client.aai.AAIResourcesClient
57 * This groovy class supports the <class>DoDeleteE2EServiceInstance.bpmn</class> process.
60 * @param - msoRequestId
61 * @param - globalSubscriberId - O
62 * @param - subscriptionServiceType - O
63 * @param - serviceInstanceId
64 * @param - serviceInstanceName - O
65 * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
66 * @param - sdncVersion
67 * @param - failNotFound - TODO
68 * @param - serviceInputParams - TODO
71 * @param - WorkflowException
75 public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
76 private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCustomDeleteE2EServiceInstance.class);
79 String Prefix="DDELSI_"
80 ExceptionUtil exceptionUtil = new ExceptionUtil()
81 JsonUtils jsonUtil = new JsonUtils()
83 public void preProcessRequest (DelegateExecution execution) {
84 msoLogger.trace("preProcessRequest ")
88 String requestId = execution.getVariable("msoRequestId")
89 execution.setVariable("prefix",Prefix)
92 //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
93 String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
94 if (globalSubscriberId == null)
96 execution.setVariable("globalSubscriberId", "")
99 //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
100 String serviceType = execution.getVariable("serviceType")
101 if (serviceType == null)
103 execution.setVariable("serviceType", "")
106 //Generated in parent for AAI PUT
107 String serviceInstanceId = execution.getVariable("serviceInstanceId")
108 if (isBlank(serviceInstanceId)){
109 msg = "Input serviceInstanceId is null"
111 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
114 String sdncCallbackUrl = UrnPropertiesReader.getVariable('mso.workflow.sdncadapter.callback',execution)
115 if (isBlank(sdncCallbackUrl)) {
116 msg = "URN_mso_workflow_sdncadapter_callback is null"
118 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
120 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
121 msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
123 StringBuilder sbParams = new StringBuilder()
124 Map<String, String> paramsMap = execution.getVariable("serviceInputParams")
125 if (paramsMap != null)
127 sbParams.append("<service-input-parameters>")
128 for (Map.Entry<String, String> entry : paramsMap.entrySet()) {
130 String paramName = entry.getKey()
131 String paramValue = entry.getValue()
134 <name>${MsoUtils.xmlEscape(paramName)}</name>
135 <value>${MsoUtils.xmlEscape(paramValue)}</value>
138 sbParams.append(paramsXml)
140 sbParams.append("</service-input-parameters>")
142 String siParamsXml = sbParams.toString()
143 if (siParamsXml == null)
145 execution.setVariable("siParamsXml", siParamsXml)
147 } catch (BpmnError e) {
149 } catch (Exception ex){
150 msg = "Exception in preProcessRequest " + ex.getMessage()
152 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
154 msoLogger.trace("Exit preProcessRequest ")
158 public void preProcessVFCDelete (DelegateExecution execution) {
161 public void postProcessVFCDelete(DelegateExecution execution, String response, String method) {
164 public void preProcessSDNCDelete (DelegateExecution execution) {
165 msoLogger.trace("preProcessSDNCDelete ")
169 def serviceInstanceId = execution.getVariable("serviceInstanceId")
170 def serviceInstanceName = execution.getVariable("serviceInstanceName")
171 def callbackURL = execution.getVariable("sdncCallbackUrl")
172 def requestId = execution.getVariable("msoRequestId")
173 def serviceId = execution.getVariable("productFamilyId")
174 def subscriptionServiceType = execution.getVariable("subscriptionServiceType")
175 def globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
177 String serviceModelInfo = execution.getVariable("serviceModelInfo")
178 def modelInvariantUuid = ""
179 def modelVersion = ""
182 if (!isBlank(serviceModelInfo))
184 modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
185 modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion")
186 modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid")
187 modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName")
189 if (modelInvariantUuid == null) {
190 modelInvariantUuid = ""
192 if (modelVersion == null) {
195 if (modelUuid == null) {
198 if (modelName == null) {
202 if (serviceInstanceName == null) {
203 serviceInstanceName = ""
205 if (serviceId == null) {
209 def siParamsXml = execution.getVariable("siParamsXml")
210 def serviceType = execution.getVariable("serviceType")
211 if (serviceType == null)
216 def sdncRequestId = UUID.randomUUID().toString()
219 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
220 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
221 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
222 <sdncadapter:RequestHeader>
223 <sdncadapter:RequestId>${MsoUtils.xmlEscape(sdncRequestId)}</sdncadapter:RequestId>
224 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
225 <sdncadapter:SvcAction>delete</sdncadapter:SvcAction>
226 <sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation>
227 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl>
228 <sdncadapter:MsoAction>${MsoUtils.xmlEscape(serviceType)}</sdncadapter:MsoAction>
229 </sdncadapter:RequestHeader>
230 <sdncadapterworkflow:SDNCRequestData>
231 <request-information>
232 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
237 <request-action>DeleteServiceInstance</request-action>
238 </request-information>
239 <service-information>
240 <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id>
241 <subscription-service-type>${MsoUtils.xmlEscape(subscriptionServiceType)}</subscription-service-type>
242 <onap-model-information>
243 <model-invariant-uuid>${MsoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
244 <model-uuid>${MsoUtils.xmlEscape(modelUuid)}</model-uuid>
245 <model-version>${MsoUtils.xmlEscape(modelVersion)}</model-version>
246 <model-name>${MsoUtils.xmlEscape(modelName)}</model-name>
247 </onap-model-information>
248 <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
250 <global-customer-id>${MsoUtils.xmlEscape(globalSubscriberId)}</global-customer-id>
251 </service-information>
252 <service-request-input>
253 <service-instance-name>${MsoUtils.xmlEscape(serviceInstanceName)}</service-instance-name>
255 </service-request-input>
256 </sdncadapterworkflow:SDNCRequestData>
257 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
259 sdncDelete = utils.formatXml(sdncDelete)
260 def sdncRequestId2 = UUID.randomUUID().toString()
261 String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
262 execution.setVariable("sdncDelete", sdncDelete)
263 execution.setVariable("sdncDeactivate", sdncDeactivate)
264 msoLogger.info("sdncDeactivate:\n" + sdncDeactivate)
265 msoLogger.info("sdncDelete:\n" + sdncDelete)
267 } catch (BpmnError e) {
269 } catch(Exception ex) {
270 msg = "Exception in preProcessSDNCDelete. " + ex.getMessage()
272 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception Occured in preProcessSDNCDelete.\n" + ex.getMessage())
274 msoLogger.info(" *****Exit preProcessSDNCDelete *****")
277 public void postProcessSDNCDelete(DelegateExecution execution, String response, String method) {
279 msoLogger.trace("postProcessSDNC " + method + " ")
283 WorkflowException workflowException = execution.getVariable("WorkflowException")
284 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
285 msoLogger.info("SDNCResponse: " + response)
286 msoLogger.info("workflowException: " + workflowException)
288 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
289 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
290 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == "true"){
291 msoLogger.info("Good response from SDNC Adapter for service-instance " + method + "response:\n" + response)
294 msg = "Bad Response from SDNC Adapter for service-instance " + method
296 exceptionUtil.buildAndThrowWorkflowException(execution, 3500, msg)
298 } catch (BpmnError e) {
300 } catch(Exception ex) {
301 msg = "Exception in postProcessSDNC " + method + " Exception:" + ex.getMessage()
303 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
305 msoLogger.trace("Exit postProcessSDNC " + method + " ")
308 public void postProcessAAIGET(DelegateExecution execution) {
309 msoLogger.trace("postProcessAAIGET ")
313 String serviceInstanceId = execution.getVariable("serviceInstanceId")
314 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
315 String serviceType = ""
318 msoLogger.info("Found Service-instance in AAI")
320 String siData = execution.getVariable("GENGS_service")
321 msoLogger.info("SI Data")
324 msg = "Could not retrive ServiceInstance data from AAI to delete id:" + serviceInstanceId
326 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
330 msoLogger.info("SI Data" + siData)
331 //Confirm there are no related service instances (vnf/network or volume)
332 if (utils.nodeExists(siData, "relationship-list")) {
333 msoLogger.info("SI Data relationship-list exists:")
334 InputSource source = new InputSource(new StringReader(siData));
335 DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
336 DocumentBuilder docBuilder = docFactory.newDocumentBuilder()
337 Document serviceXml = docBuilder.parse(source)
338 serviceXml.getDocumentElement().normalize()
340 NodeList nodeList = serviceXml.getElementsByTagName("relationship")
341 JSONArray jArray = new JSONArray()
342 for (int x = 0; x < nodeList.getLength(); x++) {
343 Node node = nodeList.item(x)
344 if (node.getNodeType() == Node.ELEMENT_NODE) {
345 Element eElement = (Element) node
346 def e = eElement.getElementsByTagName("related-to").item(0).getTextContent() //for ns
347 if(e.equals("service-instance")){
348 def relatedObject = eElement.getElementsByTagName("related-link").item(0).getTextContent()
349 msoLogger.info("ServiceInstance Related NS :" + relatedObject)
350 NodeList dataList = node.getChildNodes()
351 if(null != dataList) {
352 JSONObject jObj = new JSONObject()
353 for (int i = 0; i < dataList.getLength(); i++) {
354 Node dNode = dataList.item(i)
355 if(dNode.getNodeName() == "relationship-data") {
356 Element rDataEle = (Element)dNode
357 def eKey = rDataEle.getElementsByTagName("relationship-key").item(0).getTextContent()
358 def eValue = rDataEle.getElementsByTagName("relationship-value").item(0).getTextContent()
359 if(eKey.equals("service-instance.service-instance-id")){
360 jObj.put("resourceInstanceId", eValue)
363 else if(dNode.getNodeName() == "related-to-property"){
364 Element rDataEle = (Element)dNode
365 def eKey = rDataEle.getElementsByTagName("property-key").item(0).getTextContent()
366 def eValue = rDataEle.getElementsByTagName("property-value").item(0).getTextContent()
367 if(eKey.equals("service-instance.service-instance-name")){
368 jObj.put("resourceType", eValue)
372 msoLogger.info("Relationship related to Resource:" + jObj.toString())
375 //for overlay/underlay
376 }else if (e.equals("configuration")){
377 def relatedObject = eElement.getElementsByTagName("related-link").item(0).getTextContent()
378 msoLogger.info("ServiceInstance Related Configuration :" + relatedObject)
379 NodeList dataList = node.getChildNodes()
380 if(null != dataList) {
381 JSONObject jObj = new JSONObject()
382 for (int i = 0; i < dataList.getLength(); i++) {
383 Node dNode = dataList.item(i)
384 if(dNode.getNodeName() == "relationship-data") {
385 Element rDataEle = (Element)dNode
386 def eKey = rDataEle.getElementsByTagName("relationship-key").item(0).getTextContent()
387 def eValue = rDataEle.getElementsByTagName("relationship-value").item(0).getTextContent()
388 if(eKey.equals("configuration.configuration-id")){
389 jObj.put("resourceInstanceId", eValue)
392 else if(dNode.getNodeName() == "related-to-property"){
393 Element rDataEle = (Element)dNode
394 def eKey = rDataEle.getElementsByTagName("property-key").item(0).getTextContent()
395 def eValue = rDataEle.getElementsByTagName("property-value").item(0).getTextContent()
396 if(eKey.equals("configuration.configuration-type")){
397 jObj.put("resourceType", eValue)
401 msoLogger.info("Relationship related to Resource:" + jObj.toString())
407 execution.setVariable("serviceRelationShip", jArray.toString())
411 boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
413 msoLogger.info("Error getting Service-instance from AAI", + serviceInstanceId)
414 WorkflowException workflowException = execution.getVariable("WorkflowException")
415 msoLogger.debug("workflowException: " + workflowException)
416 if(workflowException != null){
417 exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
421 msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
423 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
427 msoLogger.info("Service-instance NOT found in AAI. Silent Success")
429 }catch (BpmnError e) {
431 } catch (Exception ex) {
432 msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
434 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
436 msoLogger.trace("Exit postProcessAAIGET ")
440 * Deletes the service instance in aai
442 public void deleteServiceInstance(DelegateExecution execution) {
443 msoLogger.trace("Entered deleteServiceInstance")
445 String globalCustId = execution.getVariable("globalSubscriberId")
446 String serviceType = execution.getVariable("serviceType")
447 String serviceInstanceId = execution.getVariable("serviceInstanceId")
449 AAIResourcesClient resourceClient = new AAIResourcesClient();
450 AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
451 resourceClient.delete(serviceInstanceUri)
453 msoLogger.trace("Exited deleteServiceInstance")
455 msoLogger.debug("Error occured within deleteServiceInstance method: " + e)
456 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai")
460 public void preInitResourcesOperStatus(DelegateExecution execution){
461 msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
463 String serviceId = execution.getVariable("serviceInstanceId")
464 String operationId = execution.getVariable("operationId")
465 String operationType = execution.getVariable("operationType")
466 String resourceTemplateUUIDs = ""
467 String result = "processing"
468 String progress = "0"
470 String operationContent = "Prepare service creation"
471 msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
472 serviceId = UriUtils.encode(serviceId,"UTF-8")
473 execution.setVariable("serviceInstanceId", serviceId)
474 execution.setVariable("operationId", operationId)
475 execution.setVariable("operationType", operationType)
476 // we use resource instance ids for delete flow as resourceTemplateUUIDs
479 "resourceInstanceId":"1111",
480 "resourceType":"vIMS"
483 "resourceInstanceId":"222",
484 "resourceType":"vEPC"
487 "resourceInstanceId":"3333",
488 "resourceType":"overlay"
491 "resourceInstanceId":"4444",
492 "resourceType":"underlay"
495 String serviceRelationShip = execution.getVariable("serviceRelationShip")
497 def jsonSlurper = new JsonSlurper()
498 def jsonOutput = new JsonOutput()
499 List relationShipList = jsonSlurper.parseText(serviceRelationShip)
501 if (relationShipList != null) {
502 relationShipList.each {
503 resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":"
506 execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
509 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
510 xmlns:ns="http://org.onap.so/requestsdb">
513 <ns:initResourceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
514 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
515 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
516 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
517 <resourceTemplateUUIDs>${MsoUtils.xmlEscape(resourceTemplateUUIDs)}</resourceTemplateUUIDs>
518 </ns:initResourceOperationStatus>
520 </soapenv:Envelope>"""
522 payload = utils.formatXml(payload)
523 execution.setVariable("CVFMI_initResOperStatusRequest", payload)
524 msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
525 msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
528 msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
529 execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
531 msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
535 * prepare delete parameters
537 public void preResourceDelete(execution, resourceName){
538 // we use resource instance ids for delete flow as resourceTemplateUUIDs
541 "resourceInstanceId":"1111",
542 "resourceType":"vIMS"
545 "resourceInstanceId":"222",
546 "resourceType":"vEPC"
549 "resourceInstanceId":"3333",
550 "resourceType":"overlay"
553 "resourceInstanceId":"4444",
554 "resourceType":"underlay"
557 msoLogger.trace("STARTED preResourceDelete Process ")
558 String serviceRelationShip = execution.getVariable("serviceRelationShip")
559 def jsonSlurper = new JsonSlurper()
560 def jsonOutput = new JsonOutput()
561 List relationShipList = jsonSlurper.parseText(serviceRelationShip)
563 if (relationShipList != null) {
564 relationShipList.each {
565 if(StringUtils.containsIgnoreCase(it.resourceType, resourceName)) {
566 String resourceInstanceUUID = it.resourceInstanceId
567 String resourceTemplateUUID = it.resourceInstanceId
568 execution.setVariable("resourceTemplateId", resourceTemplateUUID)
569 execution.setVariable("resourceInstanceId", resourceInstanceUUID)
570 execution.setVariable("resourceType", resourceName)
571 msoLogger.info("Delete Resource Info resourceTemplate Id :" + resourceTemplateUUID + " resourceInstanceId: " + resourceInstanceUUID + " resourceType: " + resourceName)
575 msoLogger.trace("END preResourceDelete Process ")
578 public void sequenceResource(execution){
579 msoLogger.trace("STARTED sequenceResource Process ")
580 List<String> nsResources = new ArrayList<String>()
581 List<String> wanResources = new ArrayList<String>()
582 List<String> resourceSequence = new ArrayList<String>()
584 String serviceRelationShip = execution.getVariable("serviceRelationShip")
587 def jsonSlurper = new JsonSlurper()
588 def jsonOutput = new JsonOutput()
589 List relationShipList = jsonSlurper.parseText(serviceRelationShip)
591 if (relationShipList != null) {
592 relationShipList.each {
593 if(StringUtils.containsIgnoreCase(it.resourceType, "overlay") || StringUtils.containsIgnoreCase(it.resourceType, "underlay")){
594 wanResources.add(it.resourceType)
596 nsResources.add(it.resourceType)
600 resourceSequence.addAll(wanResources)
601 resourceSequence.addAll(nsResources)
602 String isContainsWanResource = wanResources.isEmpty() ? "false" : "true"
603 execution.setVariable("isContainsWanResource", isContainsWanResource)
604 execution.setVariable("currentResourceIndex", 0)
605 execution.setVariable("resourceSequence", resourceSequence)
606 msoLogger.info("resourceSequence: " + resourceSequence)
607 execution.setVariable("wanResources", wanResources)
608 msoLogger.trace("END sequenceResource Process ")
611 public void getCurrentResource(execution){
612 msoLogger.trace("Start getCurrentResoure Process ")
613 def currentIndex = execution.getVariable("currentResourceIndex")
614 List<String> resourceSequence = execution.getVariable("resourceSequence")
615 List<String> wanResources = execution.getVariable("wanResources")
616 String resourceName = resourceSequence.get(currentIndex)
617 execution.setVariable("resourceType",resourceName)
618 if(wanResources.contains(resourceName)){
619 execution.setVariable("controllerInfo", "SDN-C")
621 execution.setVariable("controllerInfo", "VF-C")
623 msoLogger.trace("COMPLETED getCurrentResoure Process ")
626 public void parseNextResource(execution){
627 msoLogger.trace("Start parseNextResource Process ")
628 def currentIndex = execution.getVariable("currentResourceIndex")
629 def nextIndex = currentIndex + 1
630 execution.setVariable("currentResourceIndex", nextIndex)
631 List<String> resourceSequence = execution.getVariable("resourceSequence")
632 if(nextIndex >= resourceSequence.size()){
633 execution.setVariable("allResourceFinished", "true")
635 execution.setVariable("allResourceFinished", "false")
637 msoLogger.trace("COMPLETED parseNextResource Process ")