2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.bpmn.infrastructure.scripts
25 import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
26 import org.onap.so.logger.ErrorCode
28 import static org.apache.commons.lang3.StringUtils.*;
30 import org.camunda.bpm.engine.delegate.BpmnError
31 import org.camunda.bpm.engine.delegate.DelegateExecution;
32 import org.json.JSONArray;
33 import org.json.JSONObject;
34 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
35 import org.onap.so.bpmn.common.scripts.CatalogDbUtils;
36 import org.onap.so.bpmn.common.scripts.ExceptionUtil;
37 import org.onap.so.bpmn.common.scripts.MsoUtils
38 import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils;
39 import org.onap.so.bpmn.common.scripts.VidUtils;
40 import org.onap.so.bpmn.core.UrnPropertiesReader
41 import org.onap.so.bpmn.core.WorkflowException
42 import org.onap.so.bpmn.core.domain.VnfResource
43 import org.onap.so.bpmn.core.json.JsonUtils;
44 import org.onap.so.bpmn.infrastructure.aai.groovyflows.AAICreateResources;
45 import org.onap.so.logger.MessageEnum
46 import org.slf4j.Logger
47 import org.slf4j.LoggerFactory
51 * This class supports the CreateVnfInfra Flow
52 * with the creation of a generic vnf for
55 class CreateVnfInfra extends AbstractServiceTaskProcessor {
57 private static final Logger logger = LoggerFactory.getLogger( CreateVnfInfra.class);
60 String Prefix="CREVI_"
61 ExceptionUtil exceptionUtil = new ExceptionUtil()
62 JsonUtils jsonUtil = new JsonUtils()
63 VidUtils vidUtils = new VidUtils(this)
64 CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
67 * This method gets and validates the incoming
73 public void preProcessRequest(DelegateExecution execution) {
74 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
75 execution.setVariable("prefix",Prefix)
76 logger.trace("STARTED CreateVnfInfra PreProcessRequest Process")
78 setBasicDBAuthHeader(execution, isDebugEnabled)
79 execution.setVariable("CREVI_sentSyncResponse", false)
83 String createVnfRequest = execution.getVariable("bpmnRequest")
84 execution.setVariable("CREVI_createVnfRequest", createVnfRequest)
85 logger.debug("Incoming CreateVnfInfra Request is: \n" + createVnfRequest)
87 if(createVnfRequest != null){
89 String requestId = execution.getVariable("mso-request-id")
90 execution.setVariable("CREVI_requestId", requestId)
91 logger.debug("Incoming Request Id is: " + requestId)
93 String serviceInstanceId = execution.getVariable("serviceInstanceId")
94 execution.setVariable("CREVI_serviceInstanceId", serviceInstanceId)
95 logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
97 String vnfType = execution.getVariable("vnfType")
98 execution.setVariable("CREVI_vnfType", vnfType)
99 logger.debug("Incoming Vnf Type is: " + vnfType)
101 String vnfName = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.instanceName")
102 execution.setVariable("CREVI_vnfName", vnfName)
103 logger.debug("Incoming Vnf Name is: " + vnfName)
105 String serviceId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.productFamilyId")
106 execution.setVariable("CREVI_serviceId", serviceId)
107 logger.debug("Incoming Service Id is: " + serviceId)
109 String source = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.source")
110 execution.setVariable("CREVI_source", source)
111 logger.debug("Incoming Source is: " + source)
113 String suppressRollback = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.suppressRollback")
114 execution.setVariable("CREVI_suppressRollback", suppressRollback)
115 logger.debug("Incoming Suppress Rollback is: " + suppressRollback)
117 def vnfModelInfo = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo")
118 execution.setVariable("CREVI_vnfModelInfo", vnfModelInfo)
120 String modelInvariantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelInvariantUuid")
121 execution.setVariable("CREVI_modelInvariantId", modelInvariantId)
122 logger.debug("Incoming Invariant Id is: " + modelInvariantId)
124 String modelVersion = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelVersion")
125 execution.setVariable("CREVI_modelVersion", modelVersion)
126 logger.debug("Incoming Model Version is: " + modelVersion)
128 def cloudConfiguration = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration")
129 execution.setVariable("CREVI_cloudConfiguration", cloudConfiguration)
131 String cloudSiteId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
132 execution.setVariable("CREVI_cloudSiteId", cloudSiteId)
133 logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
135 String tenantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.tenantId")
136 execution.setVariable("CREVI_tenantId", tenantId)
137 logger.debug("Incoming Tenant Id is: " + tenantId)
139 //For Completion Handler & Fallout Handler
141 """<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
142 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
143 <action>CREATE</action>
144 <source>${MsoUtils.xmlEscape(source)}</source>
147 execution.setVariable("CREVI_requestInfo", requestInfo)
149 //TODO: Orch Status - TBD, will come from SDN-C Response in 1702
150 String orchStatus = "Created"
151 execution.setVariable("CREVI_orchStatus", orchStatus)
153 //TODO: Equipment Role - Should come from SDN-C Response in 1702
154 String equipmentRole = " "
155 execution.setVariable("CREVI_equipmentRole", equipmentRole)
157 String vnfId = execution.getVariable("testVnfId") // for junits
159 vnfId = UUID.randomUUID().toString()
160 logger.debug("Generated Vnf Id is: " + vnfId)
162 execution.setVariable("CREVI_vnfId", vnfId)
164 // Setting for Sub Flow Calls
165 execution.setVariable("CREVI_type", "generic-vnf")
166 execution.setVariable("GENGS_type", "service-instance")
168 String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
169 if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
170 def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
171 logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
172 ErrorCode.UnknownError.getValue());
174 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
176 execution.setVariable("CREVI_sdncCallbackUrl", sdncCallbackUrl)
178 def vnfInputParameters = null
180 vnfInputParameters = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestParameters.userParams")
182 catch (Exception e) {
183 logger.debug("userParams are not present in the request")
185 execution.setVariable("CREVI_vnfInputParameters", vnfInputParameters)
188 logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
190 exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Incoming Bpmn Request is Null.")
194 logger.debug("Rethrowing MSOWorkflowException")
197 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in " +
198 "CreateVnfInfra PreProcessRequest method", "BPMN", ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
199 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra PreProcessRequest")
202 logger.trace("COMPLETED CreateVnfInfra PreProcessRequest Process")
205 public void sendSyncResponse (DelegateExecution execution) {
206 execution.setVariable("prefix",Prefix)
208 logger.trace("STARTED CreateVnfInfra SendSyncResponse Process")
211 String requestId = execution.getVariable("CREVI_requestId")
212 String vnfId = execution.getVariable("CREVI_vnfId")
214 String createVnfResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()
216 logger.debug("CreateVnfInfra Sync Response is: \n" + createVnfResponse)
218 sendWorkflowResponse(execution, 202, createVnfResponse)
220 execution.setVariable("CREVI_sentSyncResponse", true)
222 } catch (Exception ex) {
223 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in CreateVnfInfra SendSyncResponse Process", "BPMN",
224 ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
225 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra SendSyncResponse Process")
228 logger.trace("COMPLETED CreateVnfInfra SendSyncResponse Process")
232 public void preProcessSDNCAssignRequest(DelegateExecution execution){
233 execution.setVariable("prefix", Prefix)
234 logger.trace("STARTED preProcessSDNCAssignRequest")
235 def vnfId = execution.getVariable("CREVI_vnfId")
236 def serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
237 logger.debug("NEW VNF ID: " + vnfId)
242 String assignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "assign")
244 assignSDNCRequest = utils.formatXml(assignSDNCRequest)
245 execution.setVariable("CREVI_assignSDNCRequest", assignSDNCRequest)
246 logger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
249 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN",
250 ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
251 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareProvision Method:\n" + e.getMessage())
253 logger.trace("COMPLETED preProcessSDNCAssignRequest")
256 public void preProcessSDNCActivateRequest(DelegateExecution execution) {
257 def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
258 'execution=' + execution.getId() +
260 logger.trace('Entered ' + method)
261 execution.setVariable("prefix", Prefix)
262 logger.trace("STARTED preProcessSDNCActivateRequest Process")
264 String vnfId = execution.getVariable("CREVI_vnfId")
265 String serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
267 String activateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "activate")
269 execution.setVariable("CREVI_activateSDNCRequest", activateSDNCRequest)
270 logger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
273 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured " +
274 "Processing preProcessSDNCActivateRequest", "BPMN", ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
275 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage())
277 logger.trace("COMPLETED preProcessSDNCActivateRequest Process")
280 public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
282 String uuid = execution.getVariable('testReqId') // for junits
284 uuid = execution.getVariable("mso-request-id") + "-" + System.currentTimeMillis()
286 def callbackURL = execution.getVariable("CREVI_sdncCallbackUrl")
287 def requestId = execution.getVariable("CREVI_requestId")
288 def serviceId = execution.getVariable("CREVI_serviceId")
289 def vnfType = execution.getVariable("CREVI_vnfType")
290 def vnfName = execution.getVariable("CREVI_vnfName")
291 def tenantId = execution.getVariable("CREVI_tenantId")
292 def source = execution.getVariable("CREVI_source")
293 def vnfId = execution.getVariable("CREVI_vnfId")
294 def cloudSiteId = execution.getVariable("CREVI_cloudSiteId")
296 String sdncVNFParamsXml = ""
298 if(execution.getVariable("CREVI_vnfParamsExistFlag") == true){
299 sdncVNFParamsXml = buildSDNCParamsXml(execution)
301 sdncVNFParamsXml = ""
305 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
306 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
307 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
308 <sdncadapter:RequestHeader>
309 <sdncadapter:RequestId>${MsoUtils.xmlEscape(requestId)}</sdncadapter:RequestId>
310 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId>
311 <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction>
312 <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
313 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl>
314 </sdncadapter:RequestHeader>
315 <sdncadapterworkflow:SDNCRequestData>
316 <request-information>
317 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
318 <request-action>VNFActivateRequest</request-action>
319 <source>${MsoUtils.xmlEscape(source)}</source>
321 </request-information>
322 <service-information>
323 <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id>
324 <service-type>${MsoUtils.xmlEscape(serviceId)}</service-type>
325 <service-instance-id>${MsoUtils.xmlEscape(svcInstId)}</service-instance-id>
326 <subscriber-name>notsurewecare</subscriber-name>
327 </service-information>
328 <vnf-request-information>
329 <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
330 <vnf-name>${MsoUtils.xmlEscape(vnfName)}</vnf-name>
331 <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type>
332 <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region>
333 <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant>
335 </vnf-request-information>
336 </sdncadapterworkflow:SDNCRequestData>
337 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
339 logger.debug("sdncRequest: " + sdncRequest)
343 public void validateSDNCResponse(DelegateExecution execution, String response, String method){
344 execution.setVariable("prefix",Prefix)
345 logger.debug("STARTED ValidateSDNCResponse Process")
347 WorkflowException workflowException = execution.getVariable("WorkflowException")
348 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
350 logger.debug("workflowException: " + workflowException)
352 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
353 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
355 logger.debug("SDNCResponse: " + response)
357 String sdncResponse = response
358 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
359 logger.trace("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
362 logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
363 throw new BpmnError("MSOWorkflowException")
365 logger.trace("COMPLETED ValidateSDNCResponse Process")
368 public void prepareCompletionHandlerRequest(DelegateExecution execution){
369 execution.setVariable("prefix",Prefix)
371 logger.trace("STARTED CreateVnfInfra PrepareCompletionHandlerRequest Process")
374 String requestInfo = execution.getVariable("CREVI_requestInfo")
375 String vnfId = execution.getVariable("CREVI_vnfId")
376 requestInfo = utils.removeXmlPreamble(requestInfo)
379 """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
380 xmlns:ns="http://org.onap/so/request/types/v1">
382 <status-message>Vnf has been created successfully.</status-message>
383 <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
384 <mso-bpel-name>CreateVnfInfra</mso-bpel-name>
385 </aetgt:MsoCompletionRequest>"""
387 execution.setVariable("CREVI_completionHandlerRequest", request)
388 logger.debug("Completion Handler Request is: " + request)
390 execution.setVariable("WorkflowResponse", "Success") // for junits
392 } catch (Exception ex) {
393 logger.debug("Error Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
394 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process")
397 logger.trace("COMPLETED CreateVnfInfra PrepareCompletionHandlerRequest Process")
400 public void sendErrorResponse(DelegateExecution execution){
401 execution.setVariable("prefix",Prefix)
403 logger.trace("STARTED CreateVnfInfra sendErrorResponse Process")
405 def sentSyncResponse = execution.getVariable("CREVI_sentSyncResponse")
406 if(sentSyncResponse == false){
407 WorkflowException wfex = execution.getVariable("WorkflowException")
408 String response = exceptionUtil.buildErrorResponseXml(wfex)
410 logger.debug(response)
411 sendWorkflowResponse(execution, 500, response)
413 logger.debug("Not Sending Error Response. Sync Response Already Sent")
416 } catch (Exception ex) {
417 logger.debug("Error Occured in CreateVnfInfra sendErrorResponse Process " + ex.getMessage())
418 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra sendErrorResponse Process")
421 logger.trace("COMPLETED CreateVnfInfra sendErrorResponse Process")
424 public void prepareFalloutRequest(DelegateExecution execution){
425 execution.setVariable("prefix",Prefix)
427 logger.trace("STARTED CreateVnfInfra prepareFalloutRequest Process")
430 WorkflowException wfex = execution.getVariable("WorkflowException")
431 logger.debug(" Incoming Workflow Exception: " + wfex.toString())
432 String requestInfo = execution.getVariable("CREVI_requestInfo")
433 logger.debug(" Incoming Request Info: " + requestInfo)
435 String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
437 execution.setVariable("CREVI_falloutRequest", falloutRequest)
440 } catch (Exception ex) {
441 logger.debug("Error Occured in CreateVnfInfra prepareFalloutRequest Process " + ex.getMessage())
442 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra prepareFalloutRequest Process")
445 logger.trace("COMPLETED CreateVnfInfra prepareFalloutRequest Process")
449 public void queryCatalogDB (DelegateExecution execution) {
450 execution.setVariable("prefix",Prefix)
452 logger.trace("STARTED CreateVnfInfra QueryCatalogDB Process")
455 String vnfModelInfo = execution.getVariable("CREVI_vnfModelInfo")
456 String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
457 logger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
459 JSONArray vnfs = catalogDbUtils.getAllVnfsByVnfModelCustomizationUuid(execution,
460 vnfModelCustomizationUuid, "v2")
461 logger.debug("obtained VNF list: " + vnfs)
464 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching " +
465 "VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", ErrorCode.UnknownError.getValue(), "");
466 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
469 // Only one match here
470 JSONObject vnf = vnfs.get(0)
473 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching VNF" +
474 " in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", ErrorCode.UnknownError.getValue(), "");
475 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNF in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
478 VnfResource vnfResource = new VnfResource()
479 String nfType = jsonUtil.getJsonValueForKey(vnf, "nfType")
480 vnfResource.setNfType(nfType)
481 String nfRole = jsonUtil.getJsonValueForKey(vnf, "nfRole")
482 vnfResource.setNfRole(nfRole)
483 String nfFunction = jsonUtil.getJsonValueForKey(vnf, "nfFunction")
484 vnfResource.setNfFunction(nfFunction)
485 String nfNamingCode = jsonUtil.getJsonValueForKey(vnf, "nfNamingCode")
486 vnfResource.setNfNamingCode(nfNamingCode)
488 execution.setVariable("CREVI_vnfResourceDecomposition", vnfResource)
490 }catch(BpmnError e) {
492 }catch(Exception ex) {
493 logger.debug("Error Occurred in CreateVnfInfra QueryCatalogDB Process " + ex.getMessage())
494 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra QueryCatalogDB Process")
498 logger.trace("COMPLETED CreateVnfInfra QueryCatalogDb Process")
500 public void createPlatform (DelegateExecution execution) {
501 logger.trace("START createPlatform")
503 String request = execution.getVariable("bpmnRequest")
504 String platformName = jsonUtil.getJsonValue(request, "requestDetails.platform.platformName")
505 String vnfId = execution.getVariable("CREVI_vnfId")
507 logger.debug("Platform NAME: " + platformName)
508 logger.debug("VnfID: " + vnfId)
510 if(platformName == null||platformName.equals("")){
511 String msg = "Exception in createPlatform. platformName was not found in the request.";
513 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
515 logger.debug("platformName was found.")
517 AAICreateResources aaiCR = new AAICreateResources()
518 aaiCR.createAAIPlatform(platformName, vnfId)
519 }catch(Exception ex){
520 String msg = "Exception in createPlatform. " + ex.getMessage();
522 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
525 logger.trace("Exit createPlatform")
527 public void createLineOfBusiness (DelegateExecution execution) {
528 logger.trace("START createLineOfBusiness")
530 String request = execution.getVariable("bpmnRequest")
531 String lineOfBusiness = jsonUtil.getJsonValue(request, "requestDetails.lineOfBusiness.lineOfBusinessName")
532 String vnfId = execution.getVariable("CREVI_vnfId")
534 logger.debug("LineOfBusiness NAME: " + lineOfBusiness)
535 logger.debug("VnfID: " + vnfId)
537 if(lineOfBusiness == null || lineOfBusiness.equals("")){
538 logger.debug("LineOfBusiness was not found. Continuing on with flow...")
540 logger.debug("LineOfBusiness was found.")
542 AAICreateResources aaiCR = new AAICreateResources()
543 aaiCR.createAAILineOfBusiness(lineOfBusiness, vnfId)
544 }catch(Exception ex){
545 String msg = "Exception in LineOfBusiness. " + ex.getMessage();
546 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
547 ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex)
548 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
551 logger.trace("Exit createLineOfBusiness")