X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2Fso-bpmn-infrastructure-common%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Finfrastructure%2Fscripts%2FDoCreateVnf.groovy;h=e1b0776d3b57382dd2104c6469624d6d9b0cba59;hb=66e2da67751e823a1feb4afac9aaa880e1841013;hp=24528db47309eb90db6d6db0d166b51ae4aaa40c;hpb=1e22f36f9d682875754c927506d1d299389260eb;p=so.git diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy index 24528db473..e1b0776d3b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy @@ -23,13 +23,12 @@ package org.onap.so.bpmn.infrastructure.scripts import org.onap.so.db.catalog.beans.HomingInstance +import org.onap.so.logger.ErrorCode import static org.apache.commons.lang3.StringUtils.* import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution -import org.onap.aai.domain.yang.GenericVnf -import org.onap.so.bpmn.common.scripts.AaiUtil import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor import org.onap.so.bpmn.common.scripts.ExceptionUtil import org.onap.so.bpmn.common.scripts.MsoUtils @@ -42,17 +41,12 @@ import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.domain.VnfResource import org.onap.so.bpmn.core.json.JsonUtils import org.onap.so.logger.MessageEnum -import org.onap.so.logger.MsoLogger import org.slf4j.Logger import org.slf4j.LoggerFactory import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient -import org.onap.so.client.aai.entities.AAIResultWrapper import org.onap.so.client.aai.entities.uri.AAIResourceUri -import org.onap.so.client.aai.entities.uri.AAIUriFactory; -import org.springframework.web.util.UriUtils -import org.json.JSONObject - +import org.onap.so.client.aai.entities.uri.AAIUriFactory /** * This class supports the DoCreateVnf building block subflow @@ -222,7 +216,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) { def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing' logger.error("{} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - MsoLogger.ErrorCode.UnknownError.getValue()); + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg) } execution.setVariable("DoCVNF_sdncCallbackUrl", sdncCallbackUrl) @@ -368,7 +362,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { resourceClient.connect(uri, siUri) }catch(Exception ex) { - logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex) + logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process: {}", ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf CreateGenericVnf Process") } logger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process") @@ -414,7 +408,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { }catch(Exception e){ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occured Processing preProcessSDNCAssignRequest", "BPMN", - MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e) + ErrorCode.UnknownError.getValue(), "Exception is:\n" + e) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occurred during preProcessSDNCAssignRequest Method:\n" + e.getMessage()) } logger.trace("COMPLETED preProcessSDNCAssignRequest") @@ -632,7 +626,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { }catch(Exception e){ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Exception Occurred Processing preProcessSDNCGetRequest. ", "BPMN", - MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); + ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during prepareProvision Method:\n" + e.getMessage()) } logger.trace("COMPLETED preProcessSDNCGetRequest Process") @@ -671,7 +665,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { } catch (Exception e) { logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Caught exception in " + method, "BPMN", - MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); + ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage()) } }