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.logger.LoggingAnchor
26 import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
27 import org.onap.logging.filter.base.ErrorCode
29 import static org.apache.commons.lang3.StringUtils.*;
31 import org.camunda.bpm.engine.delegate.BpmnError
32 import org.camunda.bpm.engine.delegate.DelegateExecution;
33 import org.json.JSONArray;
34 import org.json.JSONObject;
35 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor;
36 import org.onap.so.bpmn.common.scripts.CatalogDbUtils;
37 import org.onap.so.bpmn.common.scripts.ExceptionUtil;
38 import org.onap.so.bpmn.common.scripts.MsoUtils
39 import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils;
40 import org.onap.so.bpmn.common.scripts.VidUtils;
41 import org.onap.so.bpmn.core.UrnPropertiesReader
42 import org.onap.so.bpmn.core.WorkflowException
43 import org.onap.so.bpmn.core.domain.VnfResource
44 import org.onap.so.bpmn.core.json.JsonUtils;
45 import org.onap.so.bpmn.infrastructure.aai.groovyflows.AAICreateResources;
46 import org.onap.so.logger.MessageEnum
47 import org.slf4j.Logger
48 import org.slf4j.LoggerFactory
52 * This class supports the CreateVnfInfra Flow
53 * with the creation of a generic vnf for
56 class CreateVnfInfra extends AbstractServiceTaskProcessor {
58 private static final Logger logger = LoggerFactory.getLogger( CreateVnfInfra.class);
61 String Prefix="CREVI_"
62 ExceptionUtil exceptionUtil = new ExceptionUtil()
63 JsonUtils jsonUtil = new JsonUtils()
64 VidUtils vidUtils = new VidUtils(this)
65 CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create()
68 * This method gets and validates the incoming
74 public void preProcessRequest(DelegateExecution execution) {
75 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
76 execution.setVariable("prefix",Prefix)
77 logger.trace("STARTED CreateVnfInfra PreProcessRequest Process")
79 setBasicDBAuthHeader(execution, isDebugEnabled)
80 execution.setVariable("CREVI_sentSyncResponse", false)
84 String createVnfRequest = execution.getVariable("bpmnRequest")
85 execution.setVariable("CREVI_createVnfRequest", createVnfRequest)
86 logger.debug("Incoming CreateVnfInfra Request is: \n" + createVnfRequest)
88 if(createVnfRequest != null){
90 String requestId = execution.getVariable("mso-request-id")
91 execution.setVariable("CREVI_requestId", requestId)
92 logger.debug("Incoming Request Id is: " + requestId)
94 String serviceInstanceId = execution.getVariable("serviceInstanceId")
95 execution.setVariable("CREVI_serviceInstanceId", serviceInstanceId)
96 logger.debug("Incoming Service Instance Id is: " + serviceInstanceId)
98 String vnfType = execution.getVariable("vnfType")
99 execution.setVariable("CREVI_vnfType", vnfType)
100 logger.debug("Incoming Vnf Type is: " + vnfType)
102 String vnfName = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.instanceName")
103 execution.setVariable("CREVI_vnfName", vnfName)
104 logger.debug("Incoming Vnf Name is: " + vnfName)
106 String serviceId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.productFamilyId")
107 execution.setVariable("CREVI_serviceId", serviceId)
108 logger.debug("Incoming Service Id is: " + serviceId)
110 String source = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.source")
111 execution.setVariable("CREVI_source", source)
112 logger.debug("Incoming Source is: " + source)
114 String suppressRollback = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestInfo.suppressRollback")
115 execution.setVariable("CREVI_suppressRollback", suppressRollback)
116 logger.debug("Incoming Suppress Rollback is: " + suppressRollback)
118 def vnfModelInfo = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo")
119 execution.setVariable("CREVI_vnfModelInfo", vnfModelInfo)
121 String modelInvariantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelInvariantUuid")
122 execution.setVariable("CREVI_modelInvariantId", modelInvariantId)
123 logger.debug("Incoming Invariant Id is: " + modelInvariantId)
125 String modelVersion = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.modelInfo.modelVersion")
126 execution.setVariable("CREVI_modelVersion", modelVersion)
127 logger.debug("Incoming Model Version is: " + modelVersion)
129 def cloudConfiguration = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration")
130 execution.setVariable("CREVI_cloudConfiguration", cloudConfiguration)
132 String cloudSiteId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
133 execution.setVariable("CREVI_cloudSiteId", cloudSiteId)
134 logger.debug("Incoming Cloud Site Id is: " + cloudSiteId)
136 String tenantId = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.cloudConfiguration.tenantId")
137 execution.setVariable("CREVI_tenantId", tenantId)
138 logger.debug("Incoming Tenant Id is: " + tenantId)
140 //For Completion Handler & Fallout Handler
142 """<request-info xmlns="http://org.onap/so/infra/vnf-request/v1">
143 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
144 <action>CREATE</action>
145 <source>${MsoUtils.xmlEscape(source)}</source>
148 execution.setVariable("CREVI_requestInfo", requestInfo)
150 //TODO: Orch Status - TBD, will come from SDN-C Response in 1702
151 String orchStatus = "Created"
152 execution.setVariable("CREVI_orchStatus", orchStatus)
154 //TODO: Equipment Role - Should come from SDN-C Response in 1702
155 String equipmentRole = " "
156 execution.setVariable("CREVI_equipmentRole", equipmentRole)
158 String vnfId = execution.getVariable("testVnfId") // for junits
160 vnfId = UUID.randomUUID().toString()
161 logger.debug("Generated Vnf Id is: " + vnfId)
163 execution.setVariable("CREVI_vnfId", vnfId)
165 // Setting for Sub Flow Calls
166 execution.setVariable("CREVI_type", "generic-vnf")
167 execution.setVariable("GENGS_type", "service-instance")
169 String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
170 if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
171 def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing'
172 logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
173 ErrorCode.UnknownError.getValue());
175 exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
177 execution.setVariable("CREVI_sdncCallbackUrl", sdncCallbackUrl)
179 def vnfInputParameters = null
181 vnfInputParameters = jsonUtil.getJsonValue(createVnfRequest, "requestDetails.requestParameters.userParams")
183 catch (Exception e) {
184 logger.debug("userParams are not present in the request")
186 execution.setVariable("CREVI_vnfInputParameters", vnfInputParameters)
189 logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
191 exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Incoming Bpmn Request is Null.")
195 logger.debug("Rethrowing MSOWorkflowException")
198 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in " +
199 "CreateVnfInfra PreProcessRequest method", "BPMN", ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
200 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra PreProcessRequest")
203 logger.trace("COMPLETED CreateVnfInfra PreProcessRequest Process")
206 public void sendSyncResponse (DelegateExecution execution) {
207 execution.setVariable("prefix",Prefix)
209 logger.trace("STARTED CreateVnfInfra SendSyncResponse Process")
212 String requestId = execution.getVariable("CREVI_requestId")
213 String vnfId = execution.getVariable("CREVI_vnfId")
215 String createVnfResponse = """{"requestReferences":{"instanceId":"${vnfId}","requestId":"${requestId}"}}""".trim()
217 logger.debug("CreateVnfInfra Sync Response is: \n" + createVnfResponse)
219 sendWorkflowResponse(execution, 202, createVnfResponse)
221 execution.setVariable("CREVI_sentSyncResponse", true)
223 } catch (Exception ex) {
224 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), " Error Occurred in CreateVnfInfra SendSyncResponse Process", "BPMN",
225 ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
226 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra SendSyncResponse Process")
229 logger.trace("COMPLETED CreateVnfInfra SendSyncResponse Process")
233 public void preProcessSDNCAssignRequest(DelegateExecution execution){
234 execution.setVariable("prefix", Prefix)
235 logger.trace("STARTED preProcessSDNCAssignRequest")
236 def vnfId = execution.getVariable("CREVI_vnfId")
237 def serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
238 logger.debug("NEW VNF ID: " + vnfId)
243 String assignSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "assign")
245 assignSDNCRequest = utils.formatXml(assignSDNCRequest)
246 execution.setVariable("CREVI_assignSDNCRequest", assignSDNCRequest)
247 logger.debug("Outgoing AssignSDNCRequest is: \n" + assignSDNCRequest)
250 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occurred Processing preProcessSDNCAssignRequest", "BPMN",
251 ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
252 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during prepareProvision Method:\n" + e.getMessage())
254 logger.trace("COMPLETED preProcessSDNCAssignRequest")
257 public void preProcessSDNCActivateRequest(DelegateExecution execution) {
258 def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
259 'execution=' + execution.getId() +
261 logger.trace('Entered ' + method)
262 execution.setVariable("prefix", Prefix)
263 logger.trace("STARTED preProcessSDNCActivateRequest Process")
265 String vnfId = execution.getVariable("CREVI_vnfId")
266 String serviceInstanceId = execution.getVariable("CREVI_serviceInstanceId")
268 String activateSDNCRequest = buildSDNCRequest(execution, serviceInstanceId, "activate")
270 execution.setVariable("CREVI_activateSDNCRequest", activateSDNCRequest)
271 logger.debug("Outgoing CommitSDNCRequest is: \n" + activateSDNCRequest)
274 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured " +
275 "Processing preProcessSDNCActivateRequest", "BPMN", ErrorCode.UnknownError.getValue(), "Exception is:\n" + e)
276 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage())
278 logger.trace("COMPLETED preProcessSDNCActivateRequest Process")
281 public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
283 String uuid = execution.getVariable('testReqId') // for junits
285 uuid = execution.getVariable("mso-request-id") + "-" + System.currentTimeMillis()
287 def callbackURL = execution.getVariable("CREVI_sdncCallbackUrl")
288 def requestId = execution.getVariable("CREVI_requestId")
289 def serviceId = execution.getVariable("CREVI_serviceId")
290 def vnfType = execution.getVariable("CREVI_vnfType")
291 def vnfName = execution.getVariable("CREVI_vnfName")
292 def tenantId = execution.getVariable("CREVI_tenantId")
293 def source = execution.getVariable("CREVI_source")
294 def vnfId = execution.getVariable("CREVI_vnfId")
295 def cloudSiteId = execution.getVariable("CREVI_cloudSiteId")
297 String sdncVNFParamsXml = ""
299 if(execution.getVariable("CREVI_vnfParamsExistFlag") == true){
300 sdncVNFParamsXml = buildSDNCParamsXml(execution)
302 sdncVNFParamsXml = ""
306 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
307 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
308 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
309 <sdncadapter:RequestHeader>
310 <sdncadapter:RequestId>${MsoUtils.xmlEscape(requestId)}</sdncadapter:RequestId>
311 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId>
312 <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction>
313 <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
314 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl>
315 </sdncadapter:RequestHeader>
316 <sdncadapterworkflow:SDNCRequestData>
317 <request-information>
318 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
319 <request-action>VNFActivateRequest</request-action>
320 <source>${MsoUtils.xmlEscape(source)}</source>
322 </request-information>
323 <service-information>
324 <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id>
325 <service-type>${MsoUtils.xmlEscape(serviceId)}</service-type>
326 <service-instance-id>${MsoUtils.xmlEscape(svcInstId)}</service-instance-id>
327 <subscriber-name>notsurewecare</subscriber-name>
328 </service-information>
329 <vnf-request-information>
330 <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id>
331 <vnf-name>${MsoUtils.xmlEscape(vnfName)}</vnf-name>
332 <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type>
333 <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region>
334 <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant>
336 </vnf-request-information>
337 </sdncadapterworkflow:SDNCRequestData>
338 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
340 logger.debug("sdncRequest: " + sdncRequest)
344 public void validateSDNCResponse(DelegateExecution execution, String response, String method){
345 execution.setVariable("prefix",Prefix)
346 logger.debug("STARTED ValidateSDNCResponse Process")
348 WorkflowException workflowException = execution.getVariable("WorkflowException")
349 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
351 logger.debug("workflowException: " + workflowException)
353 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
354 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
356 logger.debug("SDNCResponse: " + response)
358 String sdncResponse = response
359 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
360 logger.trace("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse)
363 logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
364 throw new BpmnError("MSOWorkflowException")
366 logger.trace("COMPLETED ValidateSDNCResponse Process")
369 public void prepareCompletionHandlerRequest(DelegateExecution execution){
370 execution.setVariable("prefix",Prefix)
372 logger.trace("STARTED CreateVnfInfra PrepareCompletionHandlerRequest Process")
375 String requestInfo = execution.getVariable("CREVI_requestInfo")
376 String vnfId = execution.getVariable("CREVI_vnfId")
377 requestInfo = utils.removeXmlPreamble(requestInfo)
380 """<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
381 xmlns:ns="http://org.onap/so/request/types/v1">
383 <status-message>Vnf has been created successfully.</status-message>
384 <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
385 <mso-bpel-name>CreateVnfInfra</mso-bpel-name>
386 </aetgt:MsoCompletionRequest>"""
388 execution.setVariable("CREVI_completionHandlerRequest", request)
389 logger.debug("Completion Handler Request is: " + request)
391 execution.setVariable("WorkflowResponse", "Success") // for junits
393 } catch (Exception ex) {
394 logger.debug("Error Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process " + ex.getMessage())
395 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra PrepareCompletionHandlerRequest Process")
398 logger.trace("COMPLETED CreateVnfInfra PrepareCompletionHandlerRequest Process")
401 public void sendErrorResponse(DelegateExecution execution){
402 execution.setVariable("prefix",Prefix)
404 logger.trace("STARTED CreateVnfInfra sendErrorResponse Process")
406 def sentSyncResponse = execution.getVariable("CREVI_sentSyncResponse")
407 if(sentSyncResponse == false){
408 WorkflowException wfex = execution.getVariable("WorkflowException")
409 String response = exceptionUtil.buildErrorResponseXml(wfex)
411 logger.debug(response)
412 sendWorkflowResponse(execution, 500, response)
414 logger.debug("Not Sending Error Response. Sync Response Already Sent")
417 } catch (Exception ex) {
418 logger.debug("Error Occured in CreateVnfInfra sendErrorResponse Process " + ex.getMessage())
419 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra sendErrorResponse Process")
422 logger.trace("COMPLETED CreateVnfInfra sendErrorResponse Process")
425 public void prepareFalloutRequest(DelegateExecution execution){
426 execution.setVariable("prefix",Prefix)
428 logger.trace("STARTED CreateVnfInfra prepareFalloutRequest Process")
431 WorkflowException wfex = execution.getVariable("WorkflowException")
432 logger.debug(" Incoming Workflow Exception: " + wfex.toString())
433 String requestInfo = execution.getVariable("CREVI_requestInfo")
434 logger.debug(" Incoming Request Info: " + requestInfo)
436 String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
438 execution.setVariable("CREVI_falloutRequest", falloutRequest)
441 } catch (Exception ex) {
442 logger.debug("Error Occured in CreateVnfInfra prepareFalloutRequest Process " + ex.getMessage())
443 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVnfInfra prepareFalloutRequest Process")
446 logger.trace("COMPLETED CreateVnfInfra prepareFalloutRequest Process")
450 public void queryCatalogDB (DelegateExecution execution) {
451 execution.setVariable("prefix",Prefix)
453 logger.trace("STARTED CreateVnfInfra QueryCatalogDB Process")
456 String vnfModelInfo = execution.getVariable("CREVI_vnfModelInfo")
457 String vnfModelCustomizationUuid = jsonUtil.getJsonValueForKey(vnfModelInfo, "modelCustomizationUuid")
458 logger.debug("querying Catalog DB by vnfModelCustomizationUuid: " + vnfModelCustomizationUuid)
460 JSONArray vnfs = catalogDbUtils.getAllVnfsByVnfModelCustomizationUuid(execution,
461 vnfModelCustomizationUuid, "v2")
462 logger.debug("obtained VNF list: " + vnfs)
465 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching " +
466 "VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", ErrorCode.UnknownError.getValue(), "");
467 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
470 // Only one match here
471 JSONObject vnf = vnfs.get(0)
474 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "No matching VNF" +
475 " in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, "BPMN", ErrorCode.UnknownError.getValue(), "");
476 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "No matching VNF in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid)
479 VnfResource vnfResource = new VnfResource()
480 String nfType = jsonUtil.getJsonValueForKey(vnf, "nfType")
481 vnfResource.setNfType(nfType)
482 String nfRole = jsonUtil.getJsonValueForKey(vnf, "nfRole")
483 vnfResource.setNfRole(nfRole)
484 String nfFunction = jsonUtil.getJsonValueForKey(vnf, "nfFunction")
485 vnfResource.setNfFunction(nfFunction)
486 String nfNamingCode = jsonUtil.getJsonValueForKey(vnf, "nfNamingCode")
487 vnfResource.setNfNamingCode(nfNamingCode)
489 execution.setVariable("CREVI_vnfResourceDecomposition", vnfResource)
491 }catch(BpmnError e) {
493 }catch(Exception ex) {
494 logger.debug("Error Occurred in CreateVnfInfra QueryCatalogDB Process " + ex.getMessage())
495 exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occurred in CreateVnfInfra QueryCatalogDB Process")
499 logger.trace("COMPLETED CreateVnfInfra QueryCatalogDb Process")
501 public void createPlatform (DelegateExecution execution) {
502 logger.trace("START createPlatform")
504 String request = execution.getVariable("bpmnRequest")
505 String platformName = jsonUtil.getJsonValue(request, "requestDetails.platform.platformName")
506 String vnfId = execution.getVariable("CREVI_vnfId")
508 logger.debug("Platform NAME: " + platformName)
509 logger.debug("VnfID: " + vnfId)
511 if(platformName == null||platformName.equals("")){
512 String msg = "Exception in createPlatform. platformName was not found in the request.";
514 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
516 logger.debug("platformName was found.")
518 AAICreateResources aaiCR = new AAICreateResources()
519 aaiCR.createAAIPlatform(platformName, vnfId)
520 }catch(Exception ex){
521 String msg = "Exception in createPlatform. " + ex.getMessage();
523 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
526 logger.trace("Exit createPlatform")
528 public void createLineOfBusiness (DelegateExecution execution) {
529 logger.trace("START createLineOfBusiness")
531 String request = execution.getVariable("bpmnRequest")
532 String lineOfBusiness = jsonUtil.getJsonValue(request, "requestDetails.lineOfBusiness.lineOfBusinessName")
533 String vnfId = execution.getVariable("CREVI_vnfId")
535 logger.debug("LineOfBusiness NAME: " + lineOfBusiness)
536 logger.debug("VnfID: " + vnfId)
538 if(lineOfBusiness == null || lineOfBusiness.equals("")){
539 logger.debug("LineOfBusiness was not found. Continuing on with flow...")
541 logger.debug("LineOfBusiness was found.")
543 AAICreateResources aaiCR = new AAICreateResources()
544 aaiCR.createAAILineOfBusiness(lineOfBusiness, vnfId)
545 }catch(Exception ex){
546 String msg = "Exception in LineOfBusiness. " + ex.getMessage();
547 logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
548 ErrorCode.UnknownError.getValue(), "Exception is:\n" + ex)
549 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
552 logger.trace("Exit createLineOfBusiness")