diff options
42 files changed, 1285 insertions, 1099 deletions
diff --git a/LICENSE.txt b/LICENSE.txt index cf1d4b6151..bb235ffb2c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,22 +1,39 @@ /* - * ============LICENSE_START========================================== - * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * =================================================================== - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END============================================ - * - * ECOMP and OpenECOMP are trademarks - * and service marks of AT&T Intellectual Property. - * - */
\ No newline at end of file +* ============LICENSE_START========================================== +* =================================================================== +* Copyright © 2017 AT&T Intellectual Property. All rights reserved. +* =================================================================== +* +* Unless otherwise specified, all software contained herein is licensed +* under the Apache License, Version 2.0 (the “License”); +* you may not use this software except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* +* +* Unless otherwise specified, all documentation contained herein is licensed +* under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +* you may not use this documentation except in compliance with the License. +* You may obtain a copy of the License at +* +* https://creativecommons.org/licenses/by/4.0/ +* +* Unless required by applicable law or agreed to in writing, documentation +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +* ============LICENSE_END============================================ +* +* ECOMP is a trademark and service mark of AT&T Intellectual Property. +* +*/ diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java index 43273df14f..2b2e2dce78 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java @@ -59,6 +59,7 @@ public interface MsoRequestsDbAdapter { @WebMethod public void updateServiceOperationStatus (@WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, @WebParam(name = "operationId") @XmlElement(required = false) String operationId, + @WebParam(name = "serviceName") @XmlElement(required = false) String serviceName, @WebParam(name = "operationType") @XmlElement(required = false) String operationType, @WebParam(name = "userId") @XmlElement(required = false) String userId, @WebParam(name = "result") @XmlElement(required = false) String result, diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 5140b6c4cb..900107d3c3 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -21,6 +21,7 @@ package org.openecomp.mso.adapters.requestsdb; import java.sql.Timestamp; + import javax.jws.WebService; import org.hibernate.HibernateException; @@ -281,11 +282,12 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { * @since ONAP Amsterdam Release */ @Override - public void updateServiceOperationStatus(String serviceId, String operationId, String operationType, String userId, + public void updateServiceOperationStatus(String serviceId, String operationId, String serviceName,String operationType, String userId, String result, String operationContent, String progress, String reason) throws MsoRequestsDbException { OperationStatus operStatus = new OperationStatus(); operStatus.setServiceId(serviceId); operStatus.setOperationId(operationId); + operStatus.setServiceName(serviceName); operStatus.setUserId(userId); operStatus.setOperation(operationType); operStatus.setReason(reason); diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java index e3297ff2d4..94f4de391b 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java @@ -378,7 +378,6 @@ public class VfcManager { && RequestsDbConstant.Status.FINISHED.equals(rspDesc.getStatus())) { LOGGER.info("job result is succeeded, operType is {}", nsOperInfo.getOperType()); nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus())); - nsOperInfo.setStatusDescription(CommonConstant.StatusDesc.QUERY_JOB_STATUS_FAILED); if (RequestsDbConstant.OperationType.CREATE.equals(nsOperInfo.getOperType())) { nsOperInfo.setStatus(RequestsDbConstant.Status.FINISHED); diff --git a/asdc-controller/src/main/resources/resource-examples/service_Rg511NfmService.csar b/asdc-controller/src/main/resources/resource-examples/service_Rg511NfmService.csar Binary files differindex 2686e4ba57..a383359ca0 100644 --- a/asdc-controller/src/main/resources/resource-examples/service_Rg511NfmService.csar +++ b/asdc-controller/src/main/resources/resource-examples/service_Rg511NfmService.csar diff --git a/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar b/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar Binary files differindex d2983ce609..edbd8d8fcc 100644 --- a/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar +++ b/asdc-controller/src/main/resources/resource-examples/service_Rg516VmmscSrvc_csar.csar diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd index e743dc754e..a8b5fcc945 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd @@ -1,11 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - ========================================================================= - AT&T Proprietary (Internal Use Only) Not for use or disclosure outside - the AT&T companies except under written agreement (c) 2015 AT&T - Intellectual Property. All rights reserved. AT&T and the AT&T logo are - trademarks of AT&T Intellectual Property. - ======================================================================= + ============LICENSE_START======================================================= + ONAP - SO + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= --> <!-- ================================================================ diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd index ce92a4909b..dcf52e30e5 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd @@ -1,11 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - ========================================================================= - AT&T Proprietary (Internal Use Only) Not for use or disclosure outside - the AT&T companies except under written agreement (c) 2015 AT&T - Intellectual Property. All rights reserved. AT&T and the AT&T logo are - trademarks of AT&T Intellectual Property. - ======================================================================= + ============LICENSE_START======================================================= + ONAP - SO + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ============LICENSE_END========================================================= --> <!-- ================================================================ diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy index abd693660d..450c5b1147 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy @@ -31,6 +31,7 @@ import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.bpmn.core.json.JsonUtils import org.openecomp.mso.rest.APIResponse +import java.util.List; import java.util.UUID; import org.camunda.bpm.engine.delegate.BpmnError @@ -54,7 +55,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor def isDebugEnabled=execution.getVariable("isDebugLogEnabled") execution.setVariable("prefix",Prefix) String msg = "" - utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled) + utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled) try { @@ -63,13 +64,13 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor String requestId = execution.getVariable("mso-request-id") execution.setVariable("msoRequestId", requestId) - utils.log("DEBUG", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled) + utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled) String serviceInstanceId = execution.getVariable("serviceInstanceId") if (isBlank(serviceInstanceId)) { serviceInstanceId = UUID.randomUUID().toString() } - utils.log("DEBUG", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled) + utils.log("INFO", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled) serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8") execution.setVariable("serviceInstanceId", serviceInstanceId) @@ -90,96 +91,73 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor if (isBlank(productFamilyId)) { msg = "Input productFamilyId is null" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } else { execution.setVariable("productFamilyId", productFamilyId) } - + String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams") + utils.log("INFO", "userParams:" + userParams, isDebugEnabled) + List<String> paramList = jsonUtil.StringArrayToList(execution, userParams) + String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest") //modelInfo - String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo") - if (isBlank(serviceModelInfo)) { - msg = "Input serviceModelInfo is null" - utils.log("DEBUG", msg, isDebugEnabled) + if (isBlank(uuiRequest)) { + msg = "Input uuiRequest is null" + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } else { - execution.setVariable("serviceModelInfo", serviceModelInfo) + execution.setVariable("uuiRequest", uuiRequest) } - utils.log("DEBUG", "modelInfo" + serviceModelInfo, isDebugEnabled) + utils.log("INFO", "uuiRequest:\n" + uuiRequest, isDebugEnabled) //requestParameters - String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType") - if (isBlank(subscriptionServiceType)) { - msg = "Input subscriptionServiceType is null" - utils.log("DEBUG", msg, isDebugEnabled) + String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.parameters.serviceType") + if (isBlank(serviceType)) { + msg = "Input serviceType is null" + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } else { - execution.setVariable("subscriptionServiceType", subscriptionServiceType) + execution.setVariable("serviceType", serviceType) } - - - /* - * Extracting User Parameters from incoming Request and converting into a Map - */ - def jsonSlurper = new JsonSlurper() - def jsonOutput = new JsonOutput() - - Map reqMap = jsonSlurper.parseText(siRequest) - - //InputParams - def userParams = reqMap.requestDetails?.requestParameters?.userParams - - Map<String, String> inputMap = [:] - if (userParams) { - userParams.each { - userParam -> inputMap.put(userParam.name, userParam.value) - } - } - - utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled) - execution.setVariable("serviceInputParams", inputMap) - execution.setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter") - //TODO - //execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")) - //execution.setVariable("failExists", true) + execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter") } catch (BpmnError e) { throw e; } catch (Exception ex){ msg = "Exception in preProcessRequest " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled) + utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled) } public void sendSyncResponse (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled) + utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled) try { String operationId = execution.getVariable("operationId") String serviceInstanceId = execution.getVariable("serviceInstanceId") // RESTResponse for API Handler (APIH) Reply Task String createServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim() - utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createServiceRestRequest, isDebugEnabled) + utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + createServiceRestRequest, isDebugEnabled) sendWorkflowResponse(execution, 202, createServiceRestRequest) execution.setVariable("sentSyncResponse", true) } catch (Exception ex) { String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled) + utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled) } public void sendSyncError (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " *** sendSyncError *** ", isDebugEnabled) + utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled) try { String errorMessage = "" @@ -200,14 +178,14 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor sendWorkflowResponse(execution, 500, buildworkflowException) } catch (Exception ex) { - utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled) + utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled) } } public void prepareCompletionRequest (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled) + utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled) try { String requestId = execution.getVariable("msoRequestId") @@ -231,23 +209,23 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest) execution.setVariable("completionRequest", xmlMsoCompletionRequest) - utils.log("DEBUG", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled) + utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled) } catch (Exception ex) { String msg = " Exception in prepareCompletion:" + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG", "*** Exit prepareCompletionRequest ***", isDebugEnabled) + utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled) } public void prepareFalloutRequest(Execution execution){ def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " *** prepareFalloutRequest *** ", isDebugEnabled) + utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled) try { WorkflowException wfex = execution.getVariable("WorkflowException") - utils.log("DEBUG", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled) + utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled) String requestId = execution.getVariable("msoRequestId") String source = execution.getVariable("source") String requestInfo = @@ -260,7 +238,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo) execution.setVariable("falloutRequest", falloutRequest) } catch (Exception ex) { - utils.log("DEBUG", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled) + utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled) String errorException = " Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage() String requestId = execution.getVariable("msoRequestId") String falloutRequest = @@ -280,7 +258,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor execution.setVariable("falloutRequest", falloutRequest) } - utils.log("DEBUG", "*** Exit prepareFalloutRequest ***", isDebugEnabled) + utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled) } /** @@ -288,17 +266,18 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor */ public void prepareInitServiceOperationStatus(Execution execution){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled) + utils.log("INFO", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled) try{ String serviceId = execution.getVariable("serviceInstanceId") String operationId = UUID.randomUUID().toString() + String serviceName = execution.getVariable("serviceInstanceName") String operationType = "CREATE" String userId = "" String result = "processing" String progress = "0" String reason = "" String operationContent = "Prepare service creation" - utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled) + utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled) serviceId = UriUtils.encode(serviceId,"UTF-8") execution.setVariable("serviceInstanceId", serviceId) execution.setVariable("operationId", operationId) @@ -306,7 +285,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) - utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) + utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) String payload = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" @@ -316,6 +295,7 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb"> <serviceId>${serviceId}</serviceId> <operationId>${operationId}</operationId> + <serviceName>${serviceName}</serviceName> <operationType>${operationType}</operationType> <userId>${userId}</userId> <result>${result}</result> @@ -328,14 +308,14 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor payload = utils.formatXml(payload) execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload) - utils.log("DEBUG", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled) + utils.log("INFO", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled) utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload) }catch(Exception e){ utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled) execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage()) } - utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled) + utils.log("INFO", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled) } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy index 7a047d4992..206e614630 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy @@ -81,36 +81,17 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor msg = "Input serviceInstanceId' is null"
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
-
- //String xmlRequestDetails = vidUtils.getJsonRequestDetailstoXml(siRequest)
- //execution.setVariable("requestDetails", xmlRequestDetails)
-
- //modelInfo
- String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
- if (isBlank(serviceModelInfo)) {
- msg = "Input serviceModelInfo is null"
+
+ String serviceType = execution.getVariable("serviceType")
+ if (isBlank(serviceType)) {
+ msg = "Input serviceType' is null"
utils.log("DEBUG", msg, isDebugEnabled)
- } else
- {
- execution.setVariable("serviceModelInfo", serviceModelInfo)
- //utils.log("DEBUG", "modelInfo" + serviceModelInfo, isDebugEnabled)
- }
-
- //requestInfo
- String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
- if (isBlank(productFamilyId))
- {
- msg = "Input productFamilyId is null"
- utils.log("DEBUG", msg, isDebugEnabled)
- //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
- execution.setVariable("productFamilyId", productFamilyId)
+ execution.setVariable("serviceType", serviceType)
}
- String source = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source")
- execution.setVariable("source", source)
//subscriberInfo
- String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
+ String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
utils.log("DEBUG", msg, isDebugEnabled)
@@ -118,37 +99,15 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor execution.setVariable("globalSubscriberId", globalSubscriberId)
}
- //requestParameters
- String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
- if (isBlank(subscriptionServiceType)) {
- msg = "Input subscriptionServiceType is null"
- utils.log("DEBUG", msg, isDebugEnabled)
- //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else {
- execution.setVariable("subscriptionServiceType", subscriptionServiceType)
- }
+ //operationId
+ String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
+ if (isBlank(operationId)) {
+ operationId = UUID.randomUUID().toString()
+ }
+ execution.setVariable("operationId", operationId)
- /*
- * Extracting User Parameters from incoming Request and converting into a Map
- */
- def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
-
- Map reqMap = jsonSlurper.parseText(siRequest)
-
- //InputParams
- def userParams = reqMap.requestDetails?.requestParameters?.userParams
-
- Map<String, String> inputMap = [:]
- if (userParams) {
- userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value)
- }
- }
+ execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
- utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
- execution.setVariable("serviceInputParams", inputMap)
-
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
@@ -164,11 +123,10 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
try {
- String requestId = execution.getVariable("msoRequestId")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
-
- // RESTResponse (for API Handler (APIH) Reply Task)
- String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
+ String operationId = execution.getVariable("operationId")
+
+ // RESTResponse (for API Handler (APIH) Reply Task) : :
+ String syncResponse = """{"operationId":"${operationId}"}""".trim()
utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
sendWorkflowResponse(execution, 202, syncResponse)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index a8506fdc94..ca67d5dcdd 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -81,31 +81,29 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { public void preProcessRequest (Execution execution) { def isDebugEnabled = execution.getVariable("isDebugLogEnabled") String msg = "" - utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) + utils.log("INFO"," ***** preProcessRequest *****", isDebugEnabled) try { - String requestId = execution.getVariable("msoRequestId") execution.setVariable("prefix", Prefix) - //Inputs //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId - + utils.log("INFO"," ***** globalSubscriberId *****" + globalSubscriberId, isDebugEnabled) //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology - String subscriptionServiceType = execution.getVariable("subscriptionServiceType") - + String serviceType = execution.getVariable("serviceType") + utils.log("INFO"," ***** serviceType *****" + serviceType, isDebugEnabled) //requestDetails.requestParameters. for SDNC assignTopology String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId if (isBlank(globalSubscriberId)) { msg = "Input globalSubscriberId is null" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } - if (isBlank(subscriptionServiceType)) { - msg = "Input subscriptionServiceType is null" - utils.log("DEBUG", msg, isDebugEnabled) + if (isBlank(serviceType)) { + msg = "Input serviceType is null" + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } @@ -116,93 +114,25 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { String sdncCallbackUrl = execution.getVariable('URN_mso_workflow_sdncadapter_callback') if (isBlank(sdncCallbackUrl)) { msg = "URN_mso_workflow_sdncadapter_callback is null" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } execution.setVariable("sdncCallbackUrl", sdncCallbackUrl) - utils.log("DEBUG","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled) + utils.log("INFO","SDNC Callback URL: " + sdncCallbackUrl, isDebugEnabled) - //requestDetails.modelInfo.for AAI PUT servieInstanceData & SDNC assignTopology - String modelInvariantUuid = "" - String modelVersion = "" - String modelUuid = "" - String modelName = "" - String serviceInstanceName = "" - //Generated in parent.for AAI PUT - String serviceInstanceId = "" - String serviceType = "" - String serviceRole = "" - - //requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData & SDNC assignToplology - serviceInstanceName = execution.getVariable("serviceInstanceName") - serviceInstanceId = execution.getVariable("serviceInstanceId") - - String serviceModelInfo = execution.getVariable("serviceModelInfo") - if (isBlank(serviceModelInfo)) { - msg = "Input serviceModelInfo is null" - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) - } - modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid") - modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion") - modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid") - modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName") - //modelCustomizationUuid NA for SI - - execution.setVariable("serviceType", serviceType) - execution.setVariable("serviceRole", serviceRole) - - if (serviceInstanceName == null) { - execution.setVariable("serviceInstanceName", "") - serviceInstanceName = "" - } - if (isBlank(serviceInstanceId)){ - msg = "Input serviceInstanceId is null" - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) - } - - if (modelInvariantUuid == null) { - modelInvariantUuid = "" - } - if (modelUuid == null) { - modelUuid = "" - } - if (modelVersion == null) { - modelVersion = "" - } - if (modelName == null) { - modelName = "" - } + //requestDetails.modelInfo.for AAI PUT servieInstanceData + //requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData + String serviceInstanceName = execution.getVariable("serviceInstanceName") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + String uuiRequest = execution.getVariable("uuiRequest") + String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceDefId") + String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.templateId") + //aai serviceType and Role can be setted as fixed value now. + String aaiServiceType = "voLTE type" + String aaiServiceRole = "voLTE role" execution.setVariable("modelInvariantUuid", modelInvariantUuid) - execution.setVariable("modelVersion", modelVersion) execution.setVariable("modelUuid", modelUuid) - execution.setVariable("modelName", modelName) - - StringBuilder sbParams = new StringBuilder() - Map<String, String> paramsMap = execution.getVariable("serviceInputParams") - if (paramsMap != null) - { - sbParams.append("<service-input-parameters>") - for (Map.Entry<String, String> entry : paramsMap.entrySet()) { - String paramsXml - String paramName = entry.getKey() - String paramValue = entry.getValue() - paramsXml = - """ <param> - <name>${paramName}</name> - <value>${paramValue}</value> - </param> - """ - sbParams.append(paramsXml) - } - sbParams.append("</service-input-parameters>") - } - String siParamsXml = sbParams.toString() - if (siParamsXml == null) - siParamsXml = "" - execution.setVariable("siParamsXml", siParamsXml) //AAI PUT String oStatus = execution.getVariable("initialStatus") ?: "" @@ -218,111 +148,39 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri) String serviceInstanceData = """<service-instance xmlns=\"${namespace}\"> - <service-instance-name>${serviceInstanceName}</service-instance-name> - <service-type>${serviceType}</service-type> - <service-role>${serviceRole}</service-role> + <service-instance-id>${serviceInstanceId}</service-instance-id> + <service-instance-name>${serviceInstanceName}</service-instance-name> + <service-type>${aaiServiceType}</service-type> + <service-role>${aaiServiceRole}</service-role> ${statusLine} <model-invariant-id>${modelInvariantUuid}</model-invariant-id> <model-version-id>${modelUuid}</model-version-id> - </service-instance>""".trim() - + </service-instance>""".trim() execution.setVariable("serviceInstanceData", serviceInstanceData) utils.logAudit(serviceInstanceData) - utils.log("DEBUG", " 'payload' to create Service Instance in AAI - " + "\n" + serviceInstanceData, isDebugEnabled) + utils.log("INFO", " aai_uri " + aai_uri + " namespace:" + namespace, isDebugEnabled) + utils.log("INFO", " 'payload' to create Service Instance in AAI - " + "\n" + serviceInstanceData, isDebugEnabled) } catch (BpmnError e) { throw e; } catch (Exception ex){ msg = "Exception in preProcessRequest " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled) - } - - //TODO: Will be able to replace with call to CustomE2EGetService as per the GenericGetService - public void getAAICustomerById (Execution execution) { - // https://{aaiEP}/aai/v8/business/customers/customer/{globalCustomerId} - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - String msg = "" - try { - - String globalCustomerId = execution.getVariable("globalSubscriberId") //UUI to AAI name map - utils.log("DEBUG"," ***** getAAICustomerById ***** globalCustomerId:" + globalCustomerId, isDebugEnabled) - - String aai_endpoint = execution.getVariable("URN_aai_endpoint") - AaiUtil aaiUriUtil = new AaiUtil(this) - String aai_uri = aaiUriUtil.getBusinessCustomerUri(execution) - if (isBlank(aai_endpoint) || isBlank(aai_uri)) - { - msg = "AAI URL is invalid. Endpoint:" + aai_endpoint + aai_uri - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) - } - String getAAICustomerUrl = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(globalCustomerId,"UTF-8") - - utils.logAudit(getAAICustomerUrl) - utils.log("DEBUG", "getAAICustomerById Url:" + getAAICustomerUrl, isDebugEnabled) - APIResponse response = aaiUriUtil.executeAAIGetCall(execution, getAAICustomerUrl) - String returnCode = response.getStatusCode() - String aaiResponseAsString = response.getResponseBodyAsString() - - msg = "getAAICustomerById ResponseCode:" + returnCode + " ResponseString:" + aaiResponseAsString - utils.log("DEBUG",msg, isDebugEnabled) - utils.logAudit(msg) - - if (returnCode=='200') { - // Customer found by ID. FLow to proceed. - utils.log("DEBUG",msg, isDebugEnabled) - - //TODO Deferred - //we might verify that service-subscription with matching name exists - //and throw error if not. If not checked, we will get exception in subsequent step on Create call - //in 1610 we assume both customer & service subscription were pre-created - - } else { - if (returnCode=='404') { - msg = "GlobalCustomerId:" + globalCustomerId + " not found (404) in AAI" - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg) - - } else { - if (aaiResponseAsString.contains("RESTFault")) { - utils.log("ERROR", aaiResponseAsString) - WorkflowException workflowException = exceptionUtil.MapAAIExceptionToWorkflowException(aaiResponseAsString, execution) - execution.setVariable("WorkflowException", workflowException) - throw new BpmnError("MSOWorkflowException") - - } else { - // aai all errors - msg = "Error in getAAICustomerById ResponseCode:" + returnCode - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg) - } - } - } - - } catch (BpmnError e) { - throw e; - } catch (Exception ex) { - msg = "Exception in getAAICustomerById. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," *****Exit getAAICustomerById *****", isDebugEnabled) - + utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled) } public void postProcessAAIGET(Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** postProcessAAIGET ***** ", isDebugEnabled) + utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled) String msg = "" try { String serviceInstanceName = execution.getVariable("serviceInstanceName") boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator") if(succInAAI != true){ - utils.log("DEBUG","Error getting Service-instance from AAI", + serviceInstanceName, isDebugEnabled) + utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceName, isDebugEnabled) WorkflowException workflowException = execution.getVariable("WorkflowException") utils.logAudit("workflowException: " + workflowException) if(workflowException != null){ @@ -331,7 +189,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { else { msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg) } } @@ -339,9 +197,9 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { { boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator") if(foundInAAI == true){ - utils.log("DEBUG","Found Service-instance in AAI", isDebugEnabled) + utils.log("INFO","Found Service-instance in AAI", isDebugEnabled) msg = "ServiceInstance already exists in AAI:" + serviceInstanceName - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg) } } @@ -349,21 +207,21 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { throw e; } catch (Exception ex) { msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," *** Exit postProcessAAIGET *** ", isDebugEnabled) + utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled) } public void postProcessAAIPUT(Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** postProcessAAIPUT ***** ", isDebugEnabled) + utils.log("INFO"," ***** postProcessAAIPUT ***** ", isDebugEnabled) String msg = "" try { String serviceInstanceId = execution.getVariable("serviceInstanceId") boolean succInAAI = execution.getVariable("GENPS_SuccessIndicator") if(succInAAI != true){ - utils.log("DEBUG","Error putting Service-instance in AAI", + serviceInstanceId, isDebugEnabled) + utils.log("INFO","Error putting Service-instance in AAI", + serviceInstanceId, isDebugEnabled) WorkflowException workflowException = execution.getVariable("WorkflowException") utils.logAudit("workflowException: " + workflowException) if(workflowException != null){ @@ -387,150 +245,22 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { throw e; } catch (Exception ex) { msg = "Exception in DoCreateServiceInstance.postProcessAAIDEL. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - utils.log("DEBUG"," *** Exit postProcessAAIPUT *** ", isDebugEnabled) - } - - public void preProcessSDNCAssignRequest(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - String msg = "" - utils.log("DEBUG"," ***** preProcessSDNCAssignRequest *****", isDebugEnabled) - - try { - def serviceInstanceId = execution.getVariable("serviceInstanceId") - def serviceInstanceName = execution.getVariable("serviceInstanceName") - def callbackURL = execution.getVariable("sdncCallbackUrl") - def requestId = execution.getVariable("msoRequestId") - def serviceId = execution.getVariable("productFamilyId") - def subscriptionServiceType = execution.getVariable("subscriptionServiceType") - def globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId - def serviceType = execution.getVariable("serviceType") - - def modelInvariantUuid = execution.getVariable("modelInvariantUuid") - def modelVersion = execution.getVariable("modelVersion") - def modelUuid = execution.getVariable("modelUuid") - def modelName = execution.getVariable("modelName") - - def sdncRequestId = UUID.randomUUID().toString() - - def siParamsXml = execution.getVariable("siParamsXml") - - String sdncAssignRequest = - """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" - xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> - <sdncadapter:RequestHeader> - <sdncadapter:RequestId>${sdncRequestId}</sdncadapter:RequestId> - <sdncadapter:SvcInstanceId>${serviceInstanceId}</sdncadapter:SvcInstanceId> - <sdncadapter:SvcAction>assign</sdncadapter:SvcAction> - <sdncadapter:SvcOperation>service-topology-operation</sdncadapter:SvcOperation> - <sdncadapter:CallbackUrl>${callbackURL}</sdncadapter:CallbackUrl> - <sdncadapter:MsoAction>${serviceType}</sdncadapter:MsoAction> - </sdncadapter:RequestHeader> - <sdncadapterworkflow:SDNCRequestData> - <request-information> - <request-id>${requestId}</request-id> - <source>MSO</source> - <notification-url/> - <order-number/> - <order-version/> - <request-action>CreateServiceInstance</request-action> - </request-information> - <service-information> - <service-id>${serviceId}</service-id> - <subscription-service-type>${subscriptionServiceType}</subscription-service-type> - <ecomp-model-information> - <model-invariant-uuid>${modelInvariantUuid}</model-invariant-uuid> - <model-uuid>${modelUuid}</model-uuid> - <model-version>${modelVersion}</model-version> - <model-name>${modelName}</model-name> - </ecomp-model-information> - <service-instance-id>${serviceInstanceId}</service-instance-id> - <subscriber-name/> - <global-customer-id>${globalSubscriberId}</global-customer-id> - </service-information> - <service-request-input> - <service-instance-name>${serviceInstanceName}</service-instance-name> - ${siParamsXml} - </service-request-input> - </sdncadapterworkflow:SDNCRequestData> - </sdncadapterworkflow:SDNCAdapterWorkflowRequest>""" - - utils.log("DEBUG","sdncAssignRequest:\n" + sdncAssignRequest, isDebugEnabled) - sdncAssignRequest = utils.formatXml(sdncAssignRequest) - execution.setVariable("sdncAssignRequest", sdncAssignRequest) - utils.logAudit("sdncAssignRequest: " + sdncAssignRequest) - - def sdncRequestId2 = UUID.randomUUID().toString() - String sdncDelete = sdncAssignRequest.replace(">assign<", ">delete<").replace(">CreateServiceInstance<", ">DeleteServiceInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<") - def sdncRequestId3 = UUID.randomUUID().toString() - String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId2}<", ">${sdncRequestId3}<") - def rollbackData = execution.getVariable("rollbackData") - rollbackData.put("SERVICEINSTANCE", "sdncDeactivate", sdncDeactivate) - rollbackData.put("SERVICEINSTANCE", "sdncDelete", sdncDelete) - execution.setVariable("rollbackData", rollbackData) - - utils.log("DEBUG","rollbackData:\n" + rollbackData.toString(), isDebugEnabled) - - } catch (BpmnError e) { - throw e; - } catch(Exception ex) { - msg = "Exception in preProcessSDNCAssignRequest. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," *****Exit preProcessSDNCAssignRequest *****", isDebugEnabled) - } - - public void postProcessSDNCAssign (Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** postProcessSDNCAssign ***** ", isDebugEnabled) - try { - WorkflowException workflowException = execution.getVariable("WorkflowException") - utils.logAudit("workflowException: " + workflowException) - - boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - - String response = execution.getVariable("sdncAdapterResponse") - utils.logAudit("SDNCResponse: " + response) - - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) - sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) - - if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ - utils.log("DEBUG","Good response from SDNC Adapter for service-instance topology assign: \n" + response, isDebugEnabled) - - def rollbackData = execution.getVariable("rollbackData") - rollbackData.put("SERVICEINSTANCE", "rollbackSDNC", "true") - execution.setVariable("rollbackData", rollbackData) - - }else{ - utils.log("DEBUG","Bad Response from SDNC Adapter for service-instance assign", isDebugEnabled) - throw new BpmnError("MSOWorkflowException") - } - - } catch (BpmnError e) { - throw e; - } catch(Exception ex) { - msg = "Exception in postProcessSDNCAssign. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) - } - utils.log("DEBUG"," *** Exit postProcessSDNCAssign *** ", isDebugEnabled) + utils.log("INFO"," *** Exit postProcessAAIPUT *** ", isDebugEnabled) } public void postProcessAAIGET2(Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** postProcessAAIGET2 ***** ", isDebugEnabled) + utils.log("INFO"," ***** postProcessAAIGET2 ***** ", isDebugEnabled) String msg = "" try { String serviceInstanceName = execution.getVariable("serviceInstanceName") boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator") if(succInAAI != true){ - utils.log("DEBUG","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled) + utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled) WorkflowException workflowException = execution.getVariable("WorkflowException") utils.logAudit("workflowException: " + workflowException) if(workflowException != null){ @@ -539,7 +269,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { else { msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg) } } @@ -550,7 +280,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { String aaiService = execution.getVariable("GENGS_service") if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) { execution.setVariable("serviceInstanceName", utils.getNodeText1(aaiService, "service-instance-name")) - utils.log("DEBUG","Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"), isDebugEnabled) + utils.log("INFO","Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"), isDebugEnabled) } } } @@ -558,58 +288,58 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { throw e; } catch (Exception ex) { msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - utils.log("DEBUG"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled) + utils.log("INFO"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled) } public void preProcessRollback (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled) + utils.log("INFO"," ***** preProcessRollback ***** ", isDebugEnabled) try { Object workflowException = execution.getVariable("WorkflowException"); if (workflowException instanceof WorkflowException) { - utils.log("DEBUG", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled) + utils.log("INFO", "Prev workflowException: " + workflowException.getErrorMessage(), isDebugEnabled) execution.setVariable("prevWorkflowException", workflowException); //execution.setVariable("WorkflowException", null); } } catch (BpmnError e) { - utils.log("DEBUG", "BPMN Error during preProcessRollback", isDebugEnabled) + utils.log("INFO", "BPMN Error during preProcessRollback", isDebugEnabled) } catch(Exception ex) { String msg = "Exception in preProcessRollback. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) } - utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled) + utils.log("INFO"," *** Exit preProcessRollback *** ", isDebugEnabled) } public void postProcessRollback (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled) + utils.log("INFO"," ***** postProcessRollback ***** ", isDebugEnabled) String msg = "" try { Object workflowException = execution.getVariable("prevWorkflowException"); if (workflowException instanceof WorkflowException) { - utils.log("DEBUG", "Setting prevException to WorkflowException: ", isDebugEnabled) + utils.log("INFO", "Setting prevException to WorkflowException: ", isDebugEnabled) execution.setVariable("WorkflowException", workflowException); } execution.setVariable("rollbackData", null) } catch (BpmnError b) { - utils.log("DEBUG", "BPMN Error during postProcessRollback", isDebugEnabled) + utils.log("INFO", "BPMN Error during postProcessRollback", isDebugEnabled) throw b; } catch(Exception ex) { msg = "Exception in postProcessRollback. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("INFO", msg, isDebugEnabled) } - utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugEnabled) + utils.log("INFO"," *** Exit postProcessRollback *** ", isDebugEnabled) } public void preInitResourcesOperStatus(Execution execution){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled) + utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled) try{ String serviceId = execution.getVariable("serviceInstanceId") String operationId = execution.getVariable("operationId") @@ -619,26 +349,21 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { String progress = "0" String reason = "" String operationContent = "Prepare service creation" - utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled) + utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType, isDebugEnabled) serviceId = UriUtils.encode(serviceId,"UTF-8") execution.setVariable("serviceInstanceId", serviceId) execution.setVariable("operationId", operationId) execution.setVariable("operationType", operationType) - def jsonSlurper = new JsonSlurper() - def jsonOutput = new JsonOutput() - String incomingRequest = execution.getVariable("bpmnRequest") - Map serviceReq = jsonSlurper.parseText(incomingRequest) - def segmentList = serviceReq.service.parameters.segments - - if (segmentList != null) { - segmentList.each { - resourceTemplateUUIDs = resourcesUUIDs + it.resourceUUID + ":" - } - } - - def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") + String incomingRequest = execution.getVariable("uuiRequest") + String resourcesStr = jsonUtil.getJsonValue(incomingRequest, "service.parameters.resources") + List<String> resourceList = jsonUtil.StringArrayToList(execution, resourcesStr) + for(String resource : resourceList){ + resourceTemplateUUIDs = resourceTemplateUUIDs + jsonUtil.getJsonValue(resource, "resourceDefId") + ":" + } + + def dbAdapterEndpoint = "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter" execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) - utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) + utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) String payload = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" @@ -656,45 +381,49 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { payload = utils.formatXml(payload) execution.setVariable("CVFMI_initResOperStatusRequest", payload) - utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled) + utils.log("INFO", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled) utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload) }catch(Exception e){ utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled) execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage()) } - utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled) + utils.log("INFO", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled) } /** * prepare resource create request */ - public void preResourceRequest(execution, resourceType){ + public void preResourceRequest(execution){ + String resourceType = execution.getVariable("resourceType") def isDebugEnabled=execution.getVariable("isDebugLogEnabled") String serviceInstanceName = execution.getVariable("serviceInstanceName") - String nsServiceName = nsName + "_" + serviceInstanceName - String nsServiceDescription = execution.getVariable("serviceInstanceDescription") + String nsServiceName = resourceType + "_" + serviceInstanceName execution.setVariable("nsServiceName", nsServiceName) - utils.log("DEBUG", "Prepare VFC Request nsServiceName:" + nsServiceName, isDebugEnabled) - execution.setVariable("nsServiceDescription", nsServiceDescription) - utils.log("DEBUG", "Prepare VFC Request nsServiceDescription:" + nsServiceDescription, isDebugEnabled) + utils.log("INFO", "Prepare VFC Request nsServiceName:" + nsServiceName, isDebugEnabled) String globalSubscriberId = execution.getVariable("globalSubscriberId") String serviceType = execution.getVariable("serviceType") - String serviceId = execution.getVariable("serviceId") + String serviceId = execution.getVariable("serviceInstanceId") + execution.setVariable("serviceId", serviceId) String operationId = execution.getVariable("operationId") - String incomingRequest = execution.getVariable("bpmnRequest") - Map serviceReq = jsonSlurper.parseText(incomingRequest) - def segmentList = serviceReq.service.parameters.segments - if (segmentList != null) { - segmentList.each { - if(StringUtils.containsIgnoreCase(it.resourceName, resourceType)){ - String resourceUUID = it.resourceUUID - String resourceParameters = it.nsParameters - execution.setVariable("resourceType", resourceType) - execution.setVariable("resourceUUID", resourceUUID) - execution.setVariable("resourceParameters", resourceParameters) - } - } - } + String incomingRequest = execution.getVariable("uuiRequest") + String resourcesStr = jsonUtil.getJsonValue(incomingRequest, "service.parameters.resources") + String nsServiceDescription = jsonUtil.getJsonValue(incomingRequest, "service.description") + execution.setVariable("nsServiceDescription", nsServiceDescription) + utils.log("INFO", "Prepare VFC Request nsServiceDescription:" + nsServiceDescription, isDebugEnabled) + List<String> resourceList = jsonUtil.StringArrayToList(execution, resourcesStr) + for(String resource : resourceList){ + String resourceName = jsonUtil.getJsonValue(resource, "resourceName") + if(StringUtils.containsIgnoreCase(resourceName, resourceType)){ + String resourceUUID = jsonUtil.getJsonValue(resource, "resourceDefId") + String resourceParameters = jsonUtil.getJsonValue(resource, "nsParameters") + execution.setVariable("resourceUUID", resourceUUID) + execution.setVariable("resourceParameters", resourceParameters) + utils.log("INFO", "Prepare VFC Request resourceType:" + resourceType, isDebugEnabled) + utils.log("INFO", "Prepare VFC Request resourceUUID:" + resourceUUID, isDebugEnabled) + utils.log("INFO", "Prepare VFC Request resourceParameters:" + resourceParameters, isDebugEnabled) + } + } + utils.log("INFO", "Prepare VFC Request finished", isDebugEnabled) } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy index 6c0dedfe78..8354798345 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVFCNetworkServiceInstance.groovy @@ -46,11 +46,9 @@ import org.openecomp.mso.rest.APIResponse; */
public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProcessor {
- String createUrl = "/vfc/vfcadapters/v1/ns"
-
- String instantiateUrl = "/vfcvfcadatpers/v1/ns/{nsInstanceId}/instantiate"
+ String vfcUrl = "/vfc/rest/v1/vfcadapter"
- String queryJobUrl = "/vfc/vfcadatpers/v1/jobs/{jobId}"
+ String host = "http://mso.mso.testlab.openecomp.org:8080"
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -65,23 +63,23 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces public void preProcessRequest (Execution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
- utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled)
+ utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
try {
//deal with nsName and Description
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
- utils.log("DEBUG", "nsServiceName:" + nsServiceName + " nsServiceDescription:" + nsServiceDescription, isDebugEnabled)
+ utils.log("INFO", "nsServiceName:" + nsServiceName + " nsServiceDescription:" + nsServiceDescription, isDebugEnabled)
//deal with operation key
String globalSubscriberId = execution.getVariable("globalSubscriberId")
- utils.log("DEBUG", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
String serviceType = execution.getVariable("serviceType")
- utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
+ utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
String serviceId = execution.getVariable("serviceId")
- utils.log("DEBUG", "serviceId:" + serviceId, isDebugEnabled)
+ utils.log("INFO", "serviceId:" + serviceId, isDebugEnabled)
String operationId = execution.getVariable("operationId")
- utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
+ utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
String nodeTemplateUUID = execution.getVariable("resourceUUID")
- utils.log("DEBUG", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)
+ utils.log("INFO", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)
/*
* segmentInformation needed as a object of segment
* {
@@ -93,11 +91,15 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces * }
* }
*/
- String nsParameters = execution.getVariable("resourceParamters")
- utils.log("DEBUG", "Input Request:" + siRequest, isDebugEnabled)
- String nsOperationKey = "{\"globalSubscriberId\":\"" + globalSubscriberId + "\",\"serviceType:\""
- + serviceType + "\",\"serviceId\":\"" + serviceId + "\",\"operationId\":\"" + operationId
- +"\",\"nodeTemplateUUID\":\"" + nodeTemplateUUID + "\"}";
+ String nsParameters = execution.getVariable("resourceParameters")
+ utils.log("INFO", "nsParameters:" + nsParameters, isDebugEnabled)
+ String nsOperationKey = """{
+ "globalSubscriberId":"${globalSubscriberId}",
+ "serviceType":"${serviceType}",
+ "serviceId":"${serviceId}",
+ "operationId":"${operationId}",
+ "nodeTemplateUUID":"${nodeTemplateUUID}"
+ }"""
execution.setVariable("nsOperationKey", nsOperationKey);
execution.setVariable("nsParameters", nsParameters)
@@ -106,10 +108,10 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("DEBUG", msg, isDebugEnabled)
+ utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
/**
@@ -117,13 +119,17 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces */
public void createNetworkService(Execution execution) {
- String nsOperationKey = excution.getVariable("nsOperationKey");
- String nsParameters = excution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey");
+ String nsParameters = execution.getVariable("nsParameters");
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
- String reqBody = "{\"nsServiceName\":\"" + nsServiceName + "\",\"nsServiceDescription\":\"" + nsServiceDescription
- +"\",\"nsOperationKey\":" + nsOperationKey + ",\"nsParameters\":" + nsParameters
- APIResponse apiResponse = postRequest(createUrl, reqBody)
+ String reqBody ="""{
+ "nsServiceName":"${nsServiceName}",
+ "nsServiceDescription":"${nsServiceDescription}",
+ "nsOperationKey":${nsOperationKey},
+ "nsParameters":${nsParameters}
+ }"""
+ APIResponse apiResponse = postRequest(execution, host + vfcUrl + "/ns", reqBody)
String returnCode = apiResponse.getStatusCode()
String aaiResponseAsString = apiResponse.getResponseBodyAsString()
String nsInstanceId = "";
@@ -138,14 +144,19 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces * instantiate NS task
*/
public void instantiateNetworkService(Execution execution) {
- String nsOperationKey = excution.getVariable("nsOperationKey");
- String nsParameters = excution.getVariable("nsParameters");
+ String nsOperationKey = execution.getVariable("nsOperationKey");
+ String nsParameters = execution.getVariable("nsParameters");
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
- String reqBody = "{\"nsServiceName\":\"" + nsServiceName + "\",\"nsServiceDescription\":\"" + nsServiceDescription
- +"\",\"nsOperationKey\":" + nsOperationKey + ",\"nsParameters\":" + nsParameters
- String url = instantiateUrl.replaceAll("{nsInstanceId}", execution.getVariable("nsInstanceId"))
- APIResponse apiResponse = postRequest(url, reqBody)
+ String reqBody ="""{
+ "nsServiceName":"${nsServiceName}",
+ "nsServiceDescription":"${nsServiceDescription}",
+ "nsOperationKey":${nsOperationKey},
+ "nsParameters":${nsParameters}
+ }"""
+ String nsInstanceId = execution.getVariable("nsInstanceId")
+ String url = host + vfcUrl + "/ns/" +nsInstanceId + "/instantiate"
+ APIResponse apiResponse = postRequest(execution, url, reqBody)
String returnCode = apiResponse.getStatusCode()
String aaiResponseAsString = apiResponse.getResponseBodyAsString()
String jobId = "";
@@ -160,16 +171,16 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces */
public void queryNSProgress(Execution execution) {
String jobId = execution.getVariable("jobId")
- String nsOperationKey = excution.getVariable("nsOperationKey");
- String url = queryJobUrl.replaceAll("{jobId}", execution.getVariable("jobId"))
- APIResponse apiResponse = postRequest(url, nsOperationKey)
+ String nsOperationKey = execution.getVariable("nsOperationKey");
+ String url = host + vfcUrl + "/jobs/" + jobId
+ APIResponse apiResponse = postRequest(execution, url, nsOperationKey)
String returnCode = apiResponse.getStatusCode()
String aaiResponseAsString = apiResponse.getResponseBodyAsString()
String operationStatus = "error"
if(returnCode== "200"){
operationStatus = jsonUtil.getJsonValue(aaiResponseAsString, "responseDescriptor.status")
}
- exection.setVariable("operationStatus", operationStatus)
+ execution.setVariable("operationStatus", operationStatus)
}
/**
@@ -189,25 +200,25 @@ public class DoCreateVFCNetworkServiceInstance extends AbstractServiceTaskProces public void finishNSCreate(Execution execution) {
//no need to do anything util now
}
-
+
/**
* post request
* url: the url of the request
* requestBody: the body of the request
*/
- private APIResponse postRequest(String url, String requestBody){
+ private APIResponse postRequest(Execution execution, String url, String requestBody){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- taskProcessor.logDebug( " ======== Started Execute VFC adapter Post Process ======== ", isDebugEnabled)
- taskProcessor.logDebug( "url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
+ utils.log("INFO"," ***** Started Execute VFC adapter Post Process *****", isDebugEnabled)
+ utils.log("INFO","url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
APIResponse apiResponse = null
try{
RESTConfig config = new RESTConfig(url);
- RESTClient client = new RESTClient(config).addHeader("X-FromAppId", "MSO").addHeader("X-TransactionId", uuid).addHeader("Accept","application/json");
+ RESTClient client = new RESTClient(config).addHeader("Content-Type", "application/json").addHeader("Accept","application/json").addHeader("Authorization","Basic QlBFTENsaWVudDpwYXNzd29yZDEk");
apiResponse = client.httpPost(requestBody)
- taskProcessor.logDebug( "response code:"+ apiResponse.getStatusCode() +"\nresponse body:"+ apiResponse.getResponseBodyAsString(), isDebugEnabled)
- taskProcessor.logDebug( "======== Completed Execute VF-C adapter Post Process ======== ", isDebugEnabled)
+ utils.log("INFO","response code:"+ apiResponse.getStatusCode() +"\nresponse body:"+ apiResponse.getResponseBodyAsString(), isDebugEnabled)
+ utils.log("INFO","======== Completed Execute VF-C adapter Post Process ======== ", isDebugEnabled)
}catch(Exception e){
- taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Post Call. Exception is: \n" + e, isDebugEnabled)
+ utils.log("ERROR","Exception occured while executing AAI Post Call. Exception is: \n" + e, isDebugEnabled)
throw new BpmnError("MSOWorkflowException")
}
return apiResponse
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy index 8ab8d61019..cd0fe818bc 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy @@ -58,8 +58,6 @@ import org.xml.sax.InputSource * @param - subscriptionServiceType - O * @param - serviceInstanceId * @param - serviceInstanceName - O - * @param - serviceModelInfo - O - * @param - productFamilyId * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM) * @param - sdncVersion * @param - failNotFound - TODO @@ -70,7 +68,7 @@ import org.xml.sax.InputSource * * Rollback - Deferred */ -public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { +public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { String Prefix="DDELSI_" ExceptionUtil exceptionUtil = new ExceptionUtil() @@ -474,7 +472,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { utils.log("DEBUG"," *** Exit postProcessAAIDEL *** ", isDebugEnabled) } - public void preInitResourcesOperStatus(Execution execution){ + public void preInitResourcesOperStatus(Execution execution){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled) @@ -523,7 +521,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { } } - def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") + def dbAdapterEndpoint = execution.getVariable("URN_mso_openecomp_adapters_db_endpoint") execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) @@ -552,7 +550,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor { } utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled) } - + /** * prepare delete parameters */ diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index 87cf6fbd0f..fc6293c11f 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -156,29 +156,33 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("subscriberInfo", subscriberInfo)
utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled)
- /* - * Extracting User Parameters from incoming Request and converting into a Map - */ - def jsonSlurper = new JsonSlurper() - def jsonOutput = new JsonOutput() + /*
+ * Extracting User Parameters from incoming Request and converting into a Map
+ */
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+
+ Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)
+
+ //InputParams
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
- Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest) - - //InputParams - def userParams = reqMap.requestDetails?.requestParameters?.userParams - - Map<String, String> inputMap = [:] - if (userParams) { - userParams.each { - name, value -> inputMap.put(name, value) - if (name.equals("BRG_WAN_MAC_Address")) - execution.setVariable("brgWanMacAddress", value)
- } - } - - utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled) - execution.setVariable("serviceInputParams", inputMap) - + Map<String, String> inputMap = [:]
+
+
+ if (userParams) {
+ userParams.each {
+ userParam ->
+ if("BRG_WAN_MAC_Address".equals(userParam?.name)) {
+ execution.setVariable("brgWanMacAddress", userParam.value)
+ inputMap.put("BRG_WAN_MAC_Address", userParam.value)
+ }
+ }
+ }
+
+ utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ execution.setVariable("serviceInputParams", inputMap)
+
utils.log("DEBUG", "Incoming brgWanMacAddress is: " + execution.getVariable('brgWanMacAddress'), isDebugEnabled)
//For Completion Handler & Fallout Handler
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java index 4495e87789..c52c3b2f14 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -43,8 +43,9 @@ import java.util.Map; public abstract class AbstractSdncOperationTask extends BaseTask { private static final String DEFAULT_MSB_IP = "127.0.0.1"; - private static final int DEFAULT_MSB_Port = 10081; + private static final int DEFAULT_MSB_Port = 80; private static final String SDCADAPTOR_INPUTS = "resourceParameters"; + public static final String ONAP_IP = "ONAP_IP"; private RequestsDatabase requestsDB = RequestsDatabase.getInstance(); @@ -105,9 +106,15 @@ public abstract class AbstractSdncOperationTask extends BaseTask { private GenericResourceApi getGenericResourceApiClient(DelegateExecution execution) { updateProgress(execution, null, null, "20", "getGenericResourceApiClient begin!"); + String msbIp = System.getenv().get(ONAP_IP); + int msbPort = DEFAULT_MSB_Port; Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); - String msbIp = getString(properties, "msb.address", DEFAULT_MSB_IP); - int msbPort = Integer.valueOf(getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_Port))); + if (properties != null) { + if (StringUtils.isBlank(msbIp)) { + msbIp = getString(properties, "msb.address", DEFAULT_MSB_IP); + } + msbPort = Integer.valueOf(getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_Port))); + } MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort); RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient); return restServiceCreater.createService(GenericResourceApi.class); diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn index 4b26e6b544..8fc761c0d3 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn @@ -29,17 +29,18 @@ ex.processJavaException(execution)]]></bpmn:script> <camunda:out source="rollbackData" target="rollbackData" /> <camunda:in source="serviceInstanceId" target="serviceInstanceId" /> <camunda:in source="serviceInstanceName" target="serviceInstanceName" /> - <camunda:in source="serviceModelInfo" target="serviceModelInfo" /> <camunda:in source="productFamilyId" target="productFamilyId" /> <camunda:in source="disableRollback" target="disableRollback" /> - <camunda:in source="serviceInputParams" target="serviceInputParams" /> + <camunda:in source="uuiRequest" target="uuiRequest" /> <camunda:out source="rolledBack" target="rolledBack" /> <camunda:out source="serviceInstanceName" target="serviceInstanceName" /> <camunda:in source="failIfExists" target="failIfExists" /> <camunda:in source="globalSubscriberId" target="globalSubscriberId" /> - <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" /> - <camunda:in sourceExpression="1610" target="sdncVersion" /> + <camunda:in source="serviceType" target="serviceType" /> <camunda:in source="initialStatus" target="initialStatus" /> + <camunda:in source="operationId" target="operationId" /> + <camunda:in source="operationType" target="operationType" /> + <camunda:in source="URN_mso_adapters_openecomp_db_endpoint" target="URN_mso_adapters_openecomp_db_endpoint" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing> @@ -152,7 +153,7 @@ csi.prepareInitServiceOperationStatus(execution)]]></bpmn:script> <bpmn:extensionElements> <camunda:connector> <camunda:inputOutput> - <camunda:inputParameter name="url">${URN_mso_adapters_openecomp_db_endpoint}</camunda:inputParameter> + <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> <camunda:entry key="content-type">application/soap+xml</camunda:entry> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn index f24acb4a51..c6a6d02e4c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn @@ -137,7 +137,7 @@ csi.sendSyncResponse(execution)]]></bpmn:script> </bpmn:process> <bpmn:error id="Error_1erlsmy" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> - <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteCustomE2EServiceInstance"> <bpmndi:BPMNShape id="StartEvent_00m8zen_di" bpmnElement="StartEvent_00m8zen"> <dc:Bounds x="577" y="209" width="36" height="36" /> <bpmndi:BPMNLabel> @@ -148,99 +148,95 @@ csi.sendSyncResponse(execution)]]></bpmn:script> <dc:Bounds x="834" y="660" width="394" height="188" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1vyx9hu_di" bpmnElement="CallActivity_1vyx9hu"> - <dc:Bounds x="1121" y="187" width="100" height="80" /> + <dc:Bounds x="1159" y="187" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_0db8bs6_di" bpmnElement="EndEvent_0db8bs6"> - <dc:Bounds x="1646" y="304" width="36" height="36" /> + <dc:Bounds x="1686" y="304" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1657" y="340" width="19" height="12" /> + <dc:Bounds x="1696" y="340" width="22" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0a63hms_di" bpmnElement="ScriptTask_0a63hms"> - <dc:Bounds x="741" y="187" width="100" height="80" /> + <dc:Bounds x="724" y="187" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1fzpbop_di" bpmnElement="ScriptTask_1fzpbop"> - <dc:Bounds x="1453" y="187" width="100" height="80" /> + <dc:Bounds x="1493" y="187" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_1wx4ihe_di" bpmnElement="CallActivity_1wx4ihe"> - <dc:Bounds x="1614" y="187" width="100" height="80" /> + <dc:Bounds x="1654" y="187" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="SubProcess_1vbcima_di" bpmnElement="SubProcess_1vbcima" isExpanded="true"> <dc:Bounds x="736" y="374" width="679" height="194" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_1mao77y_di" bpmnElement="ScriptTask_1mao77y"> - <dc:Bounds x="920" y="187" width="100" height="80" /> + <dc:Bounds x="936" y="187" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ExclusiveGateway_0vu8gx6_di" bpmnElement="ExclusiveGateway_0vu8gx6" isMarkerVisible="true"> - <dc:Bounds x="1318" y="202" width="50" height="50" /> + <dc:Bounds x="1358" y="202" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1318" y="174" width="49" height="12" /> + <dc:Bounds x="1358" y="174" width="50" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1i1g9s6_di" bpmnElement="EndEvent_1i1g9s6"> - <dc:Bounds x="1325" y="304" width="36" height="36" /> + <dc:Bounds x="1365" y="304" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1298" y="340" width="0" height="12" /> + <dc:Bounds x="1293" y="340" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wxumid_di" bpmnElement="SequenceFlow_1wxumid"> <di:waypoint xsi:type="dc:Point" x="613" y="227" /> - <di:waypoint xsi:type="dc:Point" x="741" y="227" /> + <di:waypoint xsi:type="dc:Point" x="724" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="587" y="212" width="90" height="12" /> + <dc:Bounds x="623.5" y="206" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0zf2qyk_di" bpmnElement="SequenceFlow_0zf2qyk"> - <di:waypoint xsi:type="dc:Point" x="1020" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1073" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1073" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1121" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1036" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1159" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1043" y="227" width="0" height="12" /> + <dc:Bounds x="1052.5" y="206" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_07hrbs0_di" bpmnElement="SequenceFlow_07hrbs0"> - <di:waypoint xsi:type="dc:Point" x="1221" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1318" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1259" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1358" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1225.5" y="212" width="0" height="12" /> + <dc:Bounds x="1263.5" y="206" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1ab5l2q_di" bpmnElement="SequenceFlow_1ab5l2q"> - <di:waypoint xsi:type="dc:Point" x="1664" y="267" /> - <di:waypoint xsi:type="dc:Point" x="1664" y="304" /> + <di:waypoint xsi:type="dc:Point" x="1704" y="267" /> + <di:waypoint xsi:type="dc:Point" x="1704" y="304" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1634" y="279.5" width="90" height="12" /> + <dc:Bounds x="1674" y="280" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0yowshs_di" bpmnElement="SequenceFlow_0yowshs"> - <di:waypoint xsi:type="dc:Point" x="841" y="227" /> - <di:waypoint xsi:type="dc:Point" x="920" y="227" /> + <di:waypoint xsi:type="dc:Point" x="824" y="227" /> + <di:waypoint xsi:type="dc:Point" x="936" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="835.5" y="206" width="90" height="12" /> + <dc:Bounds x="835" y="206" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_04urx2e_di" bpmnElement="SequenceFlow_04urx2e"> - <di:waypoint xsi:type="dc:Point" x="1368" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1453" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1408" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1493" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1370.25" y="203" width="18" height="12" /> + <dc:Bounds x="1410" y="203" width="20" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1ii935p_di" bpmnElement="SequenceFlow_1ii935p"> - <di:waypoint xsi:type="dc:Point" x="1553" y="227" /> - <di:waypoint xsi:type="dc:Point" x="1614" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1593" y="227" /> + <di:waypoint xsi:type="dc:Point" x="1654" y="227" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1495" y="212" width="90" height="12" /> + <dc:Bounds x="1535" y="212" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1t6ekab_di" bpmnElement="SequenceFlow_1t6ekab"> - <di:waypoint xsi:type="dc:Point" x="1343" y="252" /> - <di:waypoint xsi:type="dc:Point" x="1343" y="277" /> - <di:waypoint xsi:type="dc:Point" x="1343" y="277" /> - <di:waypoint xsi:type="dc:Point" x="1343" y="304" /> + <di:waypoint xsi:type="dc:Point" x="1383" y="252" /> + <di:waypoint xsi:type="dc:Point" x="1383" y="304" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1352" y="277" width="12" height="12" /> + <dc:Bounds x="1391" y="277" width="15" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1c6ogpt_di" bpmnElement="ScriptTask_1c6ogpt"> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn index 43c8aee766..2fbb898f7b 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn @@ -5,14 +5,6 @@ <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> </bpmn2:startEvent> <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="createSI_startEvent" targetRef="preProcessRequest_ScriptTask" /> - <bpmn2:scriptTask id="getAAICustomerById_scriptTask" name="Get AAI Customer By globalCustomerId " scriptFormat="groovy"> - <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -def dcsi = new DoCreateE2EServiceInstance() -dcsi.getAAICustomerById(execution)]]></bpmn2:script> - </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="getAAICustomerById_scriptTask" targetRef="ExclusiveGateway_09wkav2" /> <bpmn2:scriptTask id="preProcessRequest_ScriptTask" name="PreProcess Incoming Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> @@ -22,7 +14,7 @@ dcsi.preProcessRequest(execution) ]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_4" name="" sourceRef="CustomE2EGetService" targetRef="ScriptTask_0i8cqdy" /> - <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="preProcessRequest_ScriptTask" targetRef="getAAICustomerById_scriptTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="preProcessRequest_ScriptTask" targetRef="CustomE2EGetService" /> <bpmn2:callActivity id="CustomE2EGetService" name="Call Custom E2E Get Service" calledElement="CustomE2EGetService"> <bpmn2:extensionElements> <camunda:in source="serviceInstanceName" target="GENGS_serviceInstanceName" /> @@ -31,35 +23,26 @@ dcsi.preProcessRequest(execution) <camunda:out source="GENGS_FoundIndicator" target="GENGS_FoundIndicator" /> <camunda:out source="GENGS_SuccessIndicator" target="GENGS_SuccessIndicator" /> <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:in source="serviceType" target="GENGS_serviceType" /> </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_11fnnkb</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:callActivity id="CustomE2EPutService" name="Call Custom E2E Put Service" calledElement="CustomE2EPutService"> <bpmn2:extensionElements> <camunda:in source="globalSubscriberId" target="GENPS_globalSubscriberId" /> <camunda:in source="serviceInstanceId" target="GENPS_serviceInstanceId" /> - <camunda:in source="subscriptionServiceType" target="GENPS_serviceType" /> + <camunda:in source="serviceType" target="GENPS_serviceType" /> <camunda:in sourceExpression="service-instance" target="GENPS_type" /> <camunda:in source="serviceInstanceData" target="GENPS_payload" /> <camunda:out source="GENPS_SuccessIndicator" target="GENPS_SuccessIndicator" /> <camunda:in source="msoRequestId" target="GENPS_requesId" /> <camunda:out source="WorkflowException" target="WorkflowException" /> </bpmn2:extensionElements> - <bpmn2:incoming>SequenceFlow_1uw2p9a</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_1w01tqs</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_129ih1g</bpmn2:outgoing> </bpmn2:callActivity> <bpmn2:sequenceFlow id="SequenceFlow_129ih1g" sourceRef="CustomE2EPutService" targetRef="ScriptTask_0q37vn9" /> - <bpmn2:exclusiveGateway id="ExclusiveGateway_09wkav2" name="sdncVersion is 1610 or serviceInstance name is populated?" default="SequenceFlow_1uw2p9a"> - <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_11fnnkb</bpmn2:outgoing> - <bpmn2:outgoing>SequenceFlow_1uw2p9a</bpmn2:outgoing> - </bpmn2:exclusiveGateway> - <bpmn2:sequenceFlow id="SequenceFlow_11fnnkb" name="yes" sourceRef="ExclusiveGateway_09wkav2" targetRef="CustomE2EGetService"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{(execution.getVariable("serviceInstanceName" ) != null && execution.getVariable("serviceInstanceName" ) != "" ) || execution.getVariable("sdncVersion" ) == "1610" }]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> - <bpmn2:sequenceFlow id="SequenceFlow_1uw2p9a" name="no" sourceRef="ExclusiveGateway_09wkav2" targetRef="CustomE2EPutService" /> <bpmn2:subProcess id="SubProcess_06d8lk8" name="Sub-process for Application Errors" triggeredByEvent="true"> <bpmn2:startEvent id="StartEvent_0yljq9y"> <bpmn2:outgoing>SequenceFlow_0tgrn11</bpmn2:outgoing> @@ -100,17 +83,6 @@ dcsi.postProcessRollback(execution) </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1xzgv5k" sourceRef="ScriptTask_1p0vyip" targetRef="EndEvent_117lkk3" /> </bpmn2:subProcess> - <bpmn2:exclusiveGateway id="ExclusiveGateway_1nk6aol" name="sdncVersion is 1610?"> - <bpmn2:incoming>SequenceFlow_1dd86x8</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_00v4npo</bpmn2:outgoing> - <bpmn2:outgoing>SequenceFlow_1170ztf</bpmn2:outgoing> - </bpmn2:exclusiveGateway> - <bpmn2:endEvent id="EndEvent_10659gr"> - <bpmn2:incoming>SequenceFlow_00v4npo</bpmn2:incoming> - </bpmn2:endEvent> - <bpmn2:sequenceFlow id="SequenceFlow_00v4npo" name="yes" sourceRef="ExclusiveGateway_1nk6aol" targetRef="EndEvent_10659gr"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion" ) == "1610"}]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> <bpmn2:scriptTask id="ScriptTask_0i8cqdy" name="Post Process AAI GET" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1w01tqs</bpmn2:outgoing> @@ -121,27 +93,26 @@ dcsi.postProcessAAIGET(execution)]]></bpmn2:script> <bpmn2:sequenceFlow id="SequenceFlow_1w01tqs" sourceRef="ScriptTask_0i8cqdy" targetRef="CustomE2EPutService" /> <bpmn2:scriptTask id="ScriptTask_0q37vn9" name="Post Process AAI PUT" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_129ih1g</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_1dd86x8</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_03fabby</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def ddsi = new DoCreateE2EServiceInstance() ddsi.postProcessAAIPUT(execution)]]></bpmn2:script> </bpmn2:scriptTask> - <bpmn2:sequenceFlow id="SequenceFlow_1dd86x8" sourceRef="ScriptTask_0q37vn9" targetRef="ExclusiveGateway_1nk6aol" /> <bpmn2:scriptTask id="ScriptTask_0081lne" name="Prepare Resource Requst For overlay" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1pjr82f</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ofqw6v</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -String nsName = "overlay" +execution.setVariable("resourceType", "overlay") def csi = new DoCreateE2EServiceInstance() -csi.preResourceRequest(execution, nsName)]]></bpmn2:script> +csi.preResourceRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="ScriptTask_0wvq4t8" name="Prepare Resource Request for vEPC" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_05gdjox</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15zgrcq</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -String resourceName= "vEPC" +execution.setVariable("resourceType", "vEPC") def csi = new DoCreateE2EServiceInstance() -csi.preResourceRequest(execution, resourceName)]]></bpmn2:script> +csi.preResourceRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallActivity_0uwm4l1" name="Call DoCreateVFCNetworkServiceInstance For vEPC" calledElement="DoCreateVFCNetworkServiceInstance"> <bpmn2:extensionElements> @@ -170,14 +141,13 @@ csi.postConfigRequest(execution)]]></bpmn2:script> <bpmn2:sequenceFlow id="SequenceFlow_15zgrcq" sourceRef="ScriptTask_0wvq4t8" targetRef="CallActivity_0uwm4l1" /> <bpmn2:sequenceFlow id="SequenceFlow_1vvdkcs" sourceRef="CallActivity_09c3ajg" targetRef="ScriptTask_1xdjlzm" /> <bpmn2:sequenceFlow id="SequenceFlow_092ghvu" sourceRef="ScriptTask_1xdjlzm" targetRef="EndEvent_0kbbt94" /> - <bpmn2:sequenceFlow id="SequenceFlow_1170ztf" sourceRef="ExclusiveGateway_1nk6aol" targetRef="Task_0uiekmn" /> <bpmn2:endEvent id="EndEvent_0kbbt94"> <bpmn2:incoming>SequenceFlow_092ghvu</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:sequenceFlow id="SequenceFlow_0k4q7jm" sourceRef="CallActivity_0uwm4l1" targetRef="Task_0aidjmp" /> <bpmn2:sequenceFlow id="SequenceFlow_1qctzm0" sourceRef="Task_0uiekmn" targetRef="Task_0raqlqc" /> - <bpmn2:scriptTask id="Task_0uiekmn" name="Prepare Resource Oper Status"> - <bpmn2:incoming>SequenceFlow_1170ztf</bpmn2:incoming> + <bpmn2:scriptTask id="Task_0uiekmn" name="Prepare Resource Oper Status" scriptFormat="groovy"> + <bpmn2:incoming>SequenceFlow_03fabby</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1qctzm0</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* def ddsi = new DoCreateE2EServiceInstance() @@ -188,7 +158,7 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script> <bpmn2:extensionElements> <camunda:connector> <camunda:inputOutput> - <camunda:inputParameter name="url">${URN_mso_adapters_openecomp_db_endpoint}</camunda:inputParameter> + <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> <camunda:entry key="content-type">application/soap+xml</camunda:entry> @@ -211,9 +181,9 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_0k4q7jm</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ua1bbk</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -String nsName = "vIMS" +execution.setVariable("resourceType", "vIMS") def csi = new DoCreateE2EServiceInstance() -csi.preResourceRequest(execution, nsName)]]></bpmn2:script> +csi.preResourceRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1hgiln0" sourceRef="Task_03n6y9h" targetRef="Task_0io5qby" /> <bpmn2:callActivity id="Task_03n6y9h" name="Call DoCreateVFCNetworkServiceInstance For vIMS" calledElement="DoCreateVFCNetworkServiceInstance"> @@ -239,13 +209,13 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_17i1ors" sourceRef="Task_0pkhzoj" targetRef="Task_0gs55f1" /> <bpmn2:sequenceFlow id="SequenceFlow_1pjr82f" sourceRef="Task_0gs55f1" targetRef="ScriptTask_0081lne" /> - <bpmn2:scriptTask id="Task_0pkhzoj" name="Prepare Resource Request For underlay"> + <bpmn2:scriptTask id="Task_0pkhzoj" name="Prepare Resource Request For underlay" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1vo0235</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_17i1ors</bpmn2:outgoing> <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -String nsName = "underlay" +execution.setVariable("resourceType", "underlay") def csi = new DoCreateE2EServiceInstance() -csi.preResourceRequest(execution, nsName)]]></bpmn2:script> +csi.preResourceRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:serviceTask id="Task_0gs55f1" name="Call Underlay Create" camunda:class="org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.SdncNetworkTopologyOperationTask"> <bpmn2:incoming>SequenceFlow_17i1ors</bpmn2:incoming> @@ -255,53 +225,44 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> <bpmn2:incoming>SequenceFlow_0ofqw6v</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1vvdkcs</bpmn2:outgoing> </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_03fabby" sourceRef="ScriptTask_0q37vn9" targetRef="Task_0uiekmn" /> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateE2EServiceInstance"> <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createSI_startEvent"> - <dc:Bounds x="152" y="79" width="36" height="36" /> + <dc:Bounds x="34" y="79" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="147" y="120" width="48" height="14" /> + <dc:Bounds x="28" y="120" width="50" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask"> <dc:Bounds x="245" y="57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_47" targetElement="_BPMNShape_ScriptTask_61"> - <di:waypoint xsi:type="dc:Point" x="188" y="97" /> + <di:waypoint xsi:type="dc:Point" x="70" y="97" /> <di:waypoint xsi:type="dc:Point" x="245" y="97" /> <bpmndi:BPMNLabel> - <dc:Bounds x="217" y="82" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_62" bpmnElement="getAAICustomerById_scriptTask"> - <dc:Bounds x="393" y="57" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_ScriptTask_62"> - <di:waypoint xsi:type="dc:Point" x="493" y="97" /> - <di:waypoint xsi:type="dc:Point" x="565" y="97" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="529" y="82" width="0" height="0" /> + <dc:Bounds x="112.5" y="82" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_10" bpmnElement="SequenceFlow_4"> - <di:waypoint xsi:type="dc:Point" x="839" y="94" /> + <di:waypoint xsi:type="dc:Point" x="626" y="94" /> <di:waypoint xsi:type="dc:Point" x="971" y="94" /> <bpmndi:BPMNLabel> - <dc:Bounds x="905" y="79" width="0" height="0" /> + <dc:Bounds x="753.5" y="79" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_61" targetElement="_BPMNShape_ScriptTask_62"> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_61" targetElement="CallActivity_1md4kyb_di"> <di:waypoint xsi:type="dc:Point" x="345" y="97" /> - <di:waypoint xsi:type="dc:Point" x="393" y="97" /> + <di:waypoint xsi:type="dc:Point" x="526" y="97" /> <bpmndi:BPMNLabel> - <dc:Bounds x="369" y="82" width="0" height="0" /> + <dc:Bounds x="390.5" y="82" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1md4kyb_di" bpmnElement="CustomE2EGetService"> - <dc:Bounds x="739" y="57" width="100" height="80" /> + <dc:Bounds x="526" y="57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0khp0qc_di" bpmnElement="CustomE2EPutService"> <dc:Bounds x="972" y="206" width="100" height="80" /> @@ -313,27 +274,6 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> <dc:Bounds x="1023" y="296" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_09wkav2_di" bpmnElement="ExclusiveGateway_09wkav2" isMarkerVisible="true"> - <dc:Bounds x="565" y="72" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="547" y="7" width="81" height="62" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_11fnnkb_di" bpmnElement="SequenceFlow_11fnnkb"> - <di:waypoint xsi:type="dc:Point" x="615" y="97" /> - <di:waypoint xsi:type="dc:Point" x="739" y="97" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="635" y="76" width="18" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1uw2p9a_di" bpmnElement="SequenceFlow_1uw2p9a"> - <di:waypoint xsi:type="dc:Point" x="590" y="122" /> - <di:waypoint xsi:type="dc:Point" x="590" y="246" /> - <di:waypoint xsi:type="dc:Point" x="972" y="246" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="594" y="132.89706349694825" width="12" height="14" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="SubProcess_06d8lk8_di" bpmnElement="SubProcess_06d8lk8" isExpanded="true"> <dc:Bounds x="-155" y="387" width="783" height="195" /> </bpmndi:BPMNShape> @@ -366,47 +306,19 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> <dc:Bounds x="-18" y="467" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_1nk6aol_di" bpmnElement="ExclusiveGateway_1nk6aol" isMarkerVisible="true"> - <dc:Bounds x="997" y="460" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="905" y="472" width="72" height="24" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_10659gr_di" bpmnElement="EndEvent_10659gr"> - <dc:Bounds x="1103" y="467" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1121" y="508" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_00v4npo_di" bpmnElement="SequenceFlow_00v4npo"> - <di:waypoint xsi:type="dc:Point" x="1047" y="485" /> - <di:waypoint xsi:type="dc:Point" x="1103" y="485" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1063" y="461" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0i8cqdy_di" bpmnElement="ScriptTask_0i8cqdy"> <dc:Bounds x="971" y="57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1w01tqs_di" bpmnElement="SequenceFlow_1w01tqs"> <di:waypoint xsi:type="dc:Point" x="1021" y="137" /> - <di:waypoint xsi:type="dc:Point" x="1021" y="172" /> - <di:waypoint xsi:type="dc:Point" x="1021" y="172" /> <di:waypoint xsi:type="dc:Point" x="1021" y="206" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1036" y="172" width="0" height="0" /> + <dc:Bounds x="991" y="171.5" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0q37vn9_di" bpmnElement="ScriptTask_0q37vn9"> <dc:Bounds x="972" y="336" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1dd86x8_di" bpmnElement="SequenceFlow_1dd86x8"> - <di:waypoint xsi:type="dc:Point" x="1022" y="416" /> - <di:waypoint xsi:type="dc:Point" x="1022" y="460" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1037" y="438" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0ocetux_di" bpmnElement="ScriptTask_0ocetux"> <dc:Bounds x="76" y="442" width="100" height="80" /> </bpmndi:BPMNShape> @@ -469,13 +381,6 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> <dc:Bounds x="-809" y="838" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1170ztf_di" bpmnElement="SequenceFlow_1170ztf"> - <di:waypoint xsi:type="dc:Point" x="1022" y="510" /> - <di:waypoint xsi:type="dc:Point" x="1022" y="588" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="992" y="543" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="EndEvent_01p249c_di" bpmnElement="EndEvent_0kbbt94"> <dc:Bounds x="-823" y="841" width="36" height="36" /> <bpmndi:BPMNLabel> @@ -563,6 +468,13 @@ csi.preResourceRequest(execution, nsName)]]></bpmn2:script> <bpmndi:BPMNShape id="ServiceTask_1cnnn5b_di" bpmnElement="CallActivity_09c3ajg"> <dc:Bounds x="-578" y="819" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_03fabby_di" bpmnElement="SequenceFlow_03fabby"> + <di:waypoint xsi:type="dc:Point" x="1022" y="416" /> + <di:waypoint xsi:type="dc:Point" x="1022" y="588" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1037" y="496" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVFCNetworkServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVFCNetworkServiceInstance.bpmn index 58eb1f04f2..ffe9dcab3e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVFCNetworkServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateVFCNetworkServiceInstance.bpmn @@ -34,10 +34,10 @@ dcsi.instantiateNetworkService(execution)]]></bpmn:script> <bpmn:outgoing>createNSFailed_SequenceFlow</bpmn:outgoing> </bpmn:exclusiveGateway> <bpmn:sequenceFlow id="createNSSuccess_SequenceFlow" name="yes" sourceRef="ExclusiveGateway_0zfksms" targetRef="instantiate_NSTask"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceName" ) != null && execution.getVariable("nsInstanceName" ) != "" )}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceId" ) != null && execution.getVariable("nsInstanceId" ) != "" )}]]></bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="createNSFailed_SequenceFlow" name="no" sourceRef="ExclusiveGateway_0zfksms" targetRef="createNSFailed_EndEvent"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceName" ) == null || execution.getVariable("nsInstanceName" ) == "" )}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceId" ) == null || execution.getVariable("nsInstanceId" ) == "" )}]]></bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:exclusiveGateway id="ExclusiveGateway_1is7zys" name="Instantiate NS Success?"> <bpmn:incoming>SequenceFlow_1ywe21t</bpmn:incoming> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn index 581ab3a47d..22246316d2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn @@ -112,7 +112,7 @@ ex.processJavaException(execution)]]></bpmn:script> <bpmn:incoming>SequenceFlow_1wmjau1</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0qquvgc</bpmn:outgoing> </bpmn:callActivity> - <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="Task_0oriv78" /> + <bpmn:sequenceFlow id="SequenceFlow_1av166w" sourceRef="ExclusiveGateway_0veiutm" targetRef="ScriptTask_146jt8v" /> <bpmn:sequenceFlow id="SequenceFlow_0qquvgc" sourceRef="CallActivity_Del_VFC" targetRef="ScriptTask_0mdub03" /> <bpmn:scriptTask id="ScriptTask_0vcz9mj" name="Prepare Resource Delele For vEPC" scriptFormat="groovy"> <bpmn:incoming>SequenceFlow_1931m8u</bpmn:incoming> @@ -142,7 +142,7 @@ def ddsi = new DoCustomDeleteE2EServiceInstance() ddsi.postProcessSDNCDelete(execution, response, "delete")]]></bpmn:script> </bpmn:scriptTask> <bpmn:scriptTask id="ScriptTask_0z30dax" name="Prepare Resource Delele For Overlay" scriptFormat="groovy"> - <bpmn:incoming>SequenceFlow_13sc98g</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0l4w9nr</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1dza4q4</bpmn:outgoing> <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* String resourceName = "overlay" @@ -154,36 +154,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> <bpmn:sequenceFlow id="SequenceFlow_0uhpfcl" name="yes" sourceRef="ExclusiveGateway_0veiutm" targetRef="CallActivity_06izbke"> <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{ execution.getVariable("sdncVersion" ) == "1610" }]]></bpmn:conditionExpression> </bpmn:sequenceFlow> - <bpmn:sequenceFlow id="SequenceFlow_030y6yz" sourceRef="Task_0oriv78" targetRef="Task_0pkgoxn" /> - <bpmn:scriptTask id="Task_0oriv78" name="Prepare Resource Oper Status"> - <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_030y6yz</bpmn:outgoing> - <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* -def ddsi = new DoCustomDeleteE2EServiceInstance() -ddsi.preInitResourcesOperStatus(execution)]]></bpmn:script> - </bpmn:scriptTask> - <bpmn:serviceTask id="Task_0pkgoxn" name="Init Resource Oper Status"> - <bpmn:extensionElements> - <camunda:connector> - <camunda:inputOutput> - <camunda:inputParameter name="url">${URN_mso_adapters_openecomp_db_endpoint}</camunda:inputParameter> - <camunda:inputParameter name="headers"> - <camunda:map> - <camunda:entry key="content-type">application/soap+xml</camunda:entry> - <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry> - </camunda:map> - </camunda:inputParameter> - <camunda:inputParameter name="payload">${CVFMI_initResOperStatusRequest}</camunda:inputParameter> - <camunda:inputParameter name="method">POST</camunda:inputParameter> - <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter> - <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter> - </camunda:inputOutput> - <camunda:connectorId>http-connector</camunda:connectorId> - </camunda:connector> - </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_030y6yz</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_13sc98g</bpmn:outgoing> - </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1wnkgpx" sourceRef="Task_0z1x3sg" targetRef="Task_0963dho" /> <bpmn:sequenceFlow id="SequenceFlow_1931m8u" sourceRef="Task_0963dho" targetRef="ScriptTask_0vcz9mj" /> <bpmn:scriptTask id="Task_0z1x3sg" name="Prepare Resource Delele For vIMS"> @@ -195,7 +165,6 @@ def ddsi = new DoCustomDeleteE2EServiceInstance() ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_1m7tont" sourceRef="ScriptTask_1g0tsto" targetRef="Task_0z1x3sg" /> - <bpmn:sequenceFlow id="SequenceFlow_13sc98g" sourceRef="Task_0pkgoxn" targetRef="ScriptTask_0z30dax" /> <bpmn:callActivity id="Task_0963dho" name="Call Network Service Delete for vIMS" calledElement="DODeleteVFCNetworkServiceInstance"> <bpmn:extensionElements> <camunda:in source="globalSubscriberId" target="globalSubscriberId" /> @@ -234,6 +203,37 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> <bpmn:incoming>SequenceFlow_1g4djgh</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0uc2beq</bpmn:outgoing> </bpmn:serviceTask> + <bpmn:scriptTask id="ScriptTask_146jt8v" name="Prepare Resource Oper Status"> + <bpmn:incoming>SequenceFlow_1av166w</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1ym9otf</bpmn:outgoing> + <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.* +def ddsi = new DoCustomDeleteE2EServiceInstance() +ddsi.preInitResourcesOperStatus(execution)]]></bpmn:script> + </bpmn:scriptTask> + <bpmn:serviceTask id="ServiceTask_00tg69u" name="Init Resource Oper Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${URN_mso_openecomp_adapters_db_endpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${CVFMI_initResOperStatusRequest}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1ym9otf</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0l4w9nr</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="SequenceFlow_1ym9otf" sourceRef="ScriptTask_146jt8v" targetRef="ServiceTask_00tg69u" /> + <bpmn:sequenceFlow id="SequenceFlow_0l4w9nr" sourceRef="ServiceTask_00tg69u" targetRef="ScriptTask_0z30dax" /> </bpmn:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCustomDeleteE2EServiceInstance"> @@ -375,9 +375,9 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1av166w_di" bpmnElement="SequenceFlow_1av166w"> <di:waypoint xsi:type="dc:Point" x="42" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="87" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="83" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="19.5" y="-38" width="90" height="12" /> + <dc:Bounds x="17.5" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0qquvgc_di" bpmnElement="SequenceFlow_0qquvgc"> @@ -404,20 +404,20 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> <dc:Bounds x="1188" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ScriptTask_0z30dax_di" bpmnElement="ScriptTask_0z30dax"> - <dc:Bounds x="377" y="-57" width="100" height="80" /> + <dc:Bounds x="356" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1dza4q4_di" bpmnElement="SequenceFlow_1dza4q4"> - <di:waypoint xsi:type="dc:Point" x="477" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="523" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="456" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="524" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="455" y="-38" width="90" height="12" /> + <dc:Bounds x="445" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0rpu756_di" bpmnElement="SequenceFlow_0rpu756"> - <di:waypoint xsi:type="dc:Point" x="623" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="711" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="624" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="692" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="622" y="-38" width="90" height="12" /> + <dc:Bounds x="613" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0uhpfcl_di" bpmnElement="SequenceFlow_0uhpfcl"> @@ -428,19 +428,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> <dc:Bounds x="540.0043516100959" y="793" width="19" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_030y6yz_di" bpmnElement="SequenceFlow_030y6yz"> - <di:waypoint xsi:type="dc:Point" x="187" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="212" y="-17" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="199.5" y="-38" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ScriptTask_19o0tpz_di" bpmnElement="Task_0oriv78"> - <dc:Bounds x="87" y="-57" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_07erhm6_di" bpmnElement="Task_0pkgoxn"> - <dc:Bounds x="212" y="-57" width="100" height="80" /> - </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1wnkgpx_di" bpmnElement="SequenceFlow_1wnkgpx"> <di:waypoint xsi:type="dc:Point" x="1237" y="134" /> <di:waypoint xsi:type="dc:Point" x="1238" y="192" /> @@ -465,13 +452,6 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> <dc:Bounds x="1253" y="32.5" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_13sc98g_di" bpmnElement="SequenceFlow_13sc98g"> - <di:waypoint xsi:type="dc:Point" x="312" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="377" y="-17" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="344.5" y="-38" width="0" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_1mwacgl_di" bpmnElement="Task_0963dho"> <dc:Bounds x="1188" y="192" width="100" height="80" /> </bpmndi:BPMNShape> @@ -483,38 +463,58 @@ ddsi.preResourceDelete(execution, resourceName )]]></bpmn:script> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0v9q75y_di" bpmnElement="CallActivity_Del_SDNC_cust"> - <dc:Bounds x="523" y="-57" width="100" height="80" /> + <dc:Bounds x="524" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0d9lmlv_di" bpmnElement="SequenceFlow_0d9lmlv"> - <di:waypoint xsi:type="dc:Point" x="811" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="898" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="792" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="855" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="854.5" y="-38" width="0" height="12" /> + <dc:Bounds x="778.5" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1g4djgh_di" bpmnElement="SequenceFlow_1g4djgh"> - <di:waypoint xsi:type="dc:Point" x="998" y="-17" /> - <di:waypoint xsi:type="dc:Point" x="1052" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="955" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="1021" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1025" y="-38" width="0" height="12" /> + <dc:Bounds x="943" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0uc2beq_di" bpmnElement="SequenceFlow_0uc2beq"> - <di:waypoint xsi:type="dc:Point" x="1152" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="1121" y="-17" /> <di:waypoint xsi:type="dc:Point" x="1188" y="-17" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1170" y="-38" width="0" height="12" /> + <dc:Bounds x="1109.5" y="-38" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_1e5z0wu_di" bpmnElement="Task_14erap6"> - <dc:Bounds x="711" y="-57" width="100" height="80" /> + <dc:Bounds x="692" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0f0965f_di" bpmnElement="Task_1j1u666"> - <dc:Bounds x="898" y="-57" width="100" height="80" /> + <dc:Bounds x="855" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0p4b7e1_di" bpmnElement="Task_0edkv0m"> - <dc:Bounds x="1052" y="-57" width="100" height="80" /> + <dc:Bounds x="1021" y="-57" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_146jt8v_di" bpmnElement="ScriptTask_146jt8v"> + <dc:Bounds x="83" y="-57" width="100" height="80" /> </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_00tg69u_di" bpmnElement="ServiceTask_00tg69u"> + <dc:Bounds x="208" y="-57" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1ym9otf_di" bpmnElement="SequenceFlow_1ym9otf"> + <di:waypoint xsi:type="dc:Point" x="183" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="208" y="-17" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="151.5" y="-38" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0l4w9nr_di" bpmnElement="SequenceFlow_0l4w9nr"> + <di:waypoint xsi:type="dc:Point" x="308" y="-17" /> + <di:waypoint xsi:type="dc:Point" x="356" y="-17" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="332" y="-38" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json index dc4669e8d9..a0168bd96a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/request.json @@ -31,9 +31,12 @@ "subscriptionServiceType":"123456789", "aLaCarte":"false", "userParams": - { - "BRG_WAN_MAC_Address" : "brgmac" - } + [ + { + "name":"BRG_WAN_MAC_Address", + "value":"brgmac" + } + ] } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json index dc9ac49a4e..17c6d15fe7 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSIName.json @@ -29,10 +29,13 @@ { "subscriptionServiceType":"123456789", "aLaCarte":"false", - "userParams": - { - "BRG_WAN_MAC_Address" : "brgmac" - } + "userParams": + [ + { + "name":"BRG_WAN_MAC_Address", + "value":"brgmac" + } + ] } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json index d5b0713d9f..8583e66d33 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/CreateVcpeResCustService/requestNoSINameNoRollback.json @@ -29,10 +29,13 @@ { "subscriptionServiceType":"123456789", "aLaCarte":"false", - "userParams": - { - "BRG_WAN_MAC_Address" : "brgmac" - } + "userParams": + [ + { + "name":"BRG_WAN_MAC_Address", + "value":"brgmac" + } + ] } } diff --git a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json index dc4669e8d9..99941c99ce 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json +++ b/bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VCPE/DeleteVcpeResCustService/request.json @@ -30,10 +30,13 @@ { "subscriptionServiceType":"123456789", "aLaCarte":"false", - "userParams": - { - "BRG_WAN_MAC_Address" : "brgmac" - } + "userParams": + [ + { + "name":"BRG_WAN_MAC_Address", + "value":"brgmac" + } + ] } } diff --git a/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 0000000000..fb268917f2 --- /dev/null +++ b/bpmn/MSOMockServer/WebContent/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,21 @@ +<jboss-deployment-structure>
+ <deployment>
+ <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
+ <exclusions>
+ <module name="org.apache.log4j" />
+ <module name="org.slf4j" />
+ <module name="org.slf4j.impl" />
+ <module name="org.jboss.resteasy.resteasy-jackson-provider" />
+ <module name="org.jboss.resteasy.resteasy-jettison-provider" />
+ </exclusions>
+ <dependencies>
+ <module name="org.jboss.jandex" slot="main" />
+ <module name="org.javassist" slot="main" />
+ <module name="org.antlr" slot="main" />
+ <module name="org.dom4j" slot="main" />
+ <module name="org.jboss.resteasy.resteasy-jackson2-provider" services="import" />
+ <!-- This module contain the ProviderBase class: -->
+ <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" export="true" />
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index f33774faef..ecd0e4d4cc 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -29,6 +29,7 @@ import java.util.Map; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; +import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -40,13 +41,19 @@ import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.codehaus.jackson.map.ObjectMapper; import org.hibernate.Session; - +import org.json.JSONObject; import org.openecomp.mso.apihandler.common.ErrorNumbers; import org.openecomp.mso.apihandler.common.RequestClient; import org.openecomp.mso.apihandler.common.RequestClientFactory; import org.openecomp.mso.apihandler.common.ResponseHandler; +import org.openecomp.mso.apihandlerinfra.Messages; +import org.openecomp.mso.apihandlerinfra.MsoException; +import org.openecomp.mso.apihandlerinfra.MsoRequest; +import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp; +import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest; import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest; import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam; +import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse; import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.ModelInfo; import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestDetails; import org.openecomp.mso.apihandlerinfra.serviceinstancebeans.RequestInfo; @@ -112,7 +119,189 @@ public class E2EServiceInstances { instanceIdMap.put("serviceId", serviceId); - return processE2EserviceInstances(request, Action.deleteInstance, null, version); + return deleteE2EserviceInstances(request, Action.deleteInstance, instanceIdMap, version); + } + + @GET + @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}") + @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class) + @Produces(MediaType.APPLICATION_JSON) + public Response getE2EServiceInstances(@PathParam("serviceId") String serviceId, + @PathParam("version") String version, @PathParam("operationId") String operationId) { + RequestsDatabase requestsDB = RequestsDatabase.getInstance(); + + GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse(); + + MsoRequest msoRequest = new MsoRequest(serviceId); + + long startTime = System.currentTimeMillis(); + + OperationStatus operationStatus = null; + + try { + operationStatus = requestsDB.getOperationStatus(serviceId, operationId); + + } catch (Exception e) { + msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.AvailabilityError, + "Exception while communciate with Request DB - Infra Request Lookup", e); + msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); + Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND, + MsoException.ServiceException, e.getMessage(), ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null); + alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL, + Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB)); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, + "Exception while communciate with Request DB"); + msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); + return response; + + } + + if (operationStatus == null) { + Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NO_CONTENT, + MsoException.ServiceException, "E2E serviceId " + serviceId + " is not found in DB", + ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null); + msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.BusinessProcesssError, + "Null response from RequestDB when searching by serviceId"); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, + "Null response from RequestDB when searching by serviceId"); + msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity()); + return resp; + + } + + e2eServiceResponse.setE2eRequest(operationStatus); + + return Response.status(200).entity(e2eServiceResponse).build(); + } + + private Response deleteE2EserviceInstances(String requestJSON, Action action, + HashMap<String, String> instanceIdMap, String version) { + //TODO should be a new one or the same service instance Id + String requestId = instanceIdMap.get("serviceId"); + long startTime = System.currentTimeMillis(); + msoLogger.debug("requestId is: " + requestId); + E2EServiceInstanceDeleteRequest e2eDelReq = null; + + MsoRequest msoRequest = new MsoRequest(requestId); + + ObjectMapper mapper = new ObjectMapper(); + try { + e2eDelReq = mapper.readValue(requestJSON, E2EServiceInstanceDeleteRequest.class); + + } catch (Exception e) { + + msoLogger.debug("Mapping of request to JSON object failed : ", e); + Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST, + MsoException.ServiceException, "Mapping of request to JSON object failed. " + e.getMessage(), + ErrorNumbers.SVC_BAD_PARAMETER, null); + msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.SchemaError, requestJSON, e); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError, + "Mapping of request to JSON object failed"); + msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); + createOperationStatusRecordForError(action, requestId); + return response; + } + + CatalogDatabase db = null; + RecipeLookupResult recipeLookupResult = null; + try { + db = CatalogDatabase.getInstance(); + recipeLookupResult = getServiceInstanceOrchestrationURI(db, action); + } catch (Exception e) { + msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e); + msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); + Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND, + MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(), + ErrorNumbers.SVC_NO_SERVER_RESOURCES, null); + alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL, + Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB)); + msoRequest.createRequestRecord(Status.FAILED, action); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, + "Exception while communciate with DB"); + msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity()); + return response; + } finally { + closeCatalogDB(db); + } + if (recipeLookupResult == null) { + msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.DataError, "No recipe found in DB"); + msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); + Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND, + MsoException.ServiceException, "Recipe does not exist in catalog DB", + ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null); + msoRequest.createRequestRecord(Status.FAILED, action); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, + "No recipe found in DB"); + msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity()); + createOperationStatusRecordForError(action, requestId); + return response; + } + + + RequestClient requestClient = null; + HttpResponse response = null; + + long subStartTime = System.currentTimeMillis(); + //String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON); + + try { + requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(), + MsoPropertiesUtils.loadMsoProperties()); + + JSONObject jjo = new JSONObject(requestJSON); + jjo.put("operationId", UUIDChecker.generateUUID(msoLogger)); + + String bpmnRequest = jjo.toString(); + + // Capture audit event + msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl()); + String serviceId = instanceIdMap.get("serviceId"); + String serviceInstanceType = e2eDelReq.getServiceType(); + response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(), + serviceId, null, null, null, null, serviceInstanceType, null, null, null, bpmnRequest); + + msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, + "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(), + null); + } catch (Exception e) { + msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR, + MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN", + recipeLookupResult.getOrchestrationURI(), null); + Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, + MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(), + ErrorNumbers.SVC_NO_SERVER_RESOURCES, null); + alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL, + Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL)); + msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine"); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, + "Exception while communicate with BPMN engine"); + msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity()); + createOperationStatusRecordForError(action, requestId); + return resp; + } + + if (response == null) { + Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY, + MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null); + msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", + MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL"); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError, + "Null response from BPMN"); + msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity()); + createOperationStatusRecordForError(action, requestId); + return resp; + } + + ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType()); + int bpelStatus = respHandler.getStatus(); + + return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action); } private Response processE2EserviceInstances(String requestJSON, Action action, @@ -129,7 +318,9 @@ public class E2EServiceInstances { e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class); } catch (Exception e) { - + //TODO update the service name + this.createOperationStatusRecordForError(action, requestId); + msoLogger.debug("Mapping of request to JSON object failed : ", e); Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST, MsoException.ServiceException, "Mapping of request to JSON object failed. " + e.getMessage(), @@ -153,7 +344,8 @@ public class E2EServiceInstances { ErrorNumbers.SVC_BAD_PARAMETER, null); if (msoRequest.getRequestId() != null) { msoLogger.debug("Logging failed message to the database"); - msoRequest.createRequestRecord(Status.FAILED, action); + //TODO update the service name + this.createOperationStatusRecordForError(action, requestId); } msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", MsoLogger.ErrorCode.SchemaError, requestJSON, e); @@ -171,8 +363,10 @@ public class E2EServiceInstances { try { if (!(instanceName == null && "service".equals(requestScope) && (action == Action.createInstance || action == Action.activateInstance))) { - dup = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate(instanceIdMap, instanceName, - requestScope); + //TODO : Need to check for the duplicate record from the operation status, + //TODO : commenting this check for unblocking current testing for now... induces dead code... +// dup = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate(instanceIdMap, instanceName, +// requestScope); } } catch (Exception e) { msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", @@ -204,10 +398,12 @@ public class E2EServiceInstances { msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError, "Duplicate request - Subscriber already has a request for this service"); - msoRequest.createRequestRecord(Status.FAILED, action); + + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict, dupMessage); msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); + createOperationStatusRecordForError(action, requestId); return response; } @@ -225,10 +421,11 @@ public class E2EServiceInstances { ErrorNumbers.SVC_NO_SERVER_RESOURCES, null); alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL, Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB)); - msoRequest.createRequestRecord(Status.FAILED, action); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception while communciate with DB"); msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity()); + createOperationStatusRecordForError(action, requestId); return response; } finally { closeCatalogDB(db); @@ -241,36 +438,33 @@ public class E2EServiceInstances { Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND, MsoException.ServiceException, "Recipe does not exist in catalog DB", ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null); - msoRequest.createRequestRecord(Status.FAILED, action); + msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, "No recipe found in DB"); msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity()); - + createOperationStatusRecordForError(action, requestId); return response; } - try { - msoRequest.createRequestRecord(Status.PENDING, action); - createOperationStatusRecord(action, requestId); - } catch (Exception e) { - msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "", - MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e); - msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); - Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, - MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(), - ErrorNumbers.SVC_BAD_PARAMETER, null); - msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, - "Exception while creating record in DB"); - msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); - return response; - } - - String modelInfo = e2eSir.getService().getParameters().getNodeTemplateName(); - String[] arrayOfInfo = modelInfo.split(":"); - String serviceInstanceType = arrayOfInfo[0]; +// try { +// msoRequest.createRequestRecord(Status.PENDING, action); +// //createOperationStatusRecord(action, requestId); +// } catch (Exception e) { +// msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "", +// MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e); +// msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); +// Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, +// MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(), +// ErrorNumbers.SVC_BAD_PARAMETER, null); +// msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, +// "Exception while creating record in DB"); +// msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); +// return response; +// } + + String serviceInstanceType = e2eSir.getService().getParameters().getServiceType(); String serviceId = ""; - RequestClient requestClient = null; HttpResponse response = null; @@ -304,6 +498,7 @@ public class E2EServiceInstances { msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine"); msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity()); + createOperationStatusRecordForError(action, requestId); return resp; } @@ -321,7 +516,7 @@ public class E2EServiceInstances { ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType()); int bpelStatus = respHandler.getStatus(); - return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus); + return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action); } private void closeCatalogDB(CatalogDatabase db) { @@ -365,14 +560,28 @@ public class E2EServiceInstances { } private Response beplStatusUpdate(String requestId, long startTime, MsoRequest msoRequest, - RequestClient requestClient, ResponseHandler respHandler, int bpelStatus) { - // BPEL accepted the request, the request is in progress + RequestClient requestClient, ResponseHandler respHandler, int bpelStatus, Action action) { + // BPMN accepted the request, the request is in progress if (bpelStatus == HttpStatus.SC_ACCEPTED) { String camundaJSONResponseBody = respHandler.getResponseBody(); msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody); - (RequestsDatabase.getInstance()).updateInfraStatus(requestId, Status.IN_PROGRESS.toString(), - Constants.PROGRESS_REQUEST_IN_PROGRESS, Constants.MODIFIED_BY_APIHANDLER); - + + // currently only for delete case we update the status here + if(action == Action.deleteInstance){ + ObjectMapper mapper = new ObjectMapper(); + try{ + DelE2ESvcResp jo = mapper.readValue(camundaJSONResponseBody, DelE2ESvcResp.class); + String operationId = jo.getOperationId(); + + this.createOperationStatusRecord("DELETE", requestId, operationId); + } + catch(Exception ex) + { + msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR, requestClient.getUrl(), "", "", + MsoLogger.ErrorCode.BusinessProcesssError, + "Response from BPEL engine is failed with HTTP Status=" + bpelStatus); + } + } msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "BPMN accepted the request, the request is in progress"); msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody); @@ -468,11 +677,14 @@ public class E2EServiceInstances { // modelNameVersionId modelInfo.setModelNameVersionId(e2eSir.getService().getTemplateId()); - String modelInfoValue = e2eSir.getService().getParameters().getNodeTemplateName(); - String[] arrayOfInfo = modelInfoValue.split(":"); - String modelName = arrayOfInfo[0]; - String modelVersion = arrayOfInfo[1]; +// String modelInfoValue = e2eSir.getService().getParameters().getNodeTemplateName(); +// String[] arrayOfInfo = modelInfoValue.split(":"); +// String modelName = arrayOfInfo[0]; +// String modelVersion = arrayOfInfo[1]; +// TODO: To ensure, if we dont get the values from the UUI + String modelName = "voLTE"; + String modelVersion = "1.0"; // modelName modelInfo.setModelName(modelName); @@ -517,19 +729,19 @@ public class E2EServiceInstances { // Userparams List<E2EUserParam> userParams; - userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams(); + //userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams(); List<Map<String, String>> userParamList = new ArrayList<>(); Map<String, String> userParamMap = new HashMap<>(); //complete json request updated in the camunda userParamMap.put("UUIRequest", requestJSON); userParamMap.put("ServiceInstanceName", e2eSir.getService().getName()); - Map<String, String> userParamMap3 = null; - for (E2EUserParam userp : userParams) { - userParamMap.put(userp.getName(), userp.getValue()); - userParamList.add(userParamMap); - } - +// Map<String, String> userParamMap3 = null; +// for (E2EUserParam userp : userParams) { +// userParamMap.put(userp.getName(), userp.getValue()); +// +// } + userParamList.add(userParamMap); requestParameters.setUserParams(userParamList); // setting requestParameters to requestDetails @@ -548,8 +760,9 @@ public class E2EServiceInstances { return returnString; } - private void createOperationStatusRecord(Action action, String requestId) { - { + + private void createOperationStatusRecordForError(Action action, String requestId) { + AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager(); Session session = null; @@ -557,21 +770,18 @@ public class E2EServiceInstances { session = requestsDbSessionFactoryManager.getSessionFactory().openSession(); session.beginTransaction(); - - // if (null == sir) { - // sir = new ServiceInstancesRequest(); - // } - OperationStatus os = new OperationStatus(); - os.setOperation(action.name()); - os.setOperationContent(""); - os.setOperationId(""); - os.setProgress("0"); - os.setReason(""); - os.setResult("Processing"); - os.setServiceId(requestId); - os.setUserId(""); - os.setFinishedAt(new Timestamp(System.currentTimeMillis())); - os.setOperateAt(new Timestamp(System.currentTimeMillis())); + + OperationStatus os = new OperationStatus(); + os.setOperation(action.name()); + os.setOperationContent(""); + os.setOperationId(""); + os.setProgress("100"); + os.setReason(""); + os.setResult("error"); + os.setServiceId(requestId); + os.setUserId(""); + os.setFinishedAt(new Timestamp(System.currentTimeMillis())); + os.setOperateAt(new Timestamp(System.currentTimeMillis())); session.save(os); session.getTransaction().commit(); @@ -584,5 +794,38 @@ public class E2EServiceInstances { } } } + private void createOperationStatusRecord(String actionNm, String serviceId, String operationId) { + + AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager(); + + Session session = null; + try { + + session = requestsDbSessionFactoryManager.getSessionFactory().openSession(); + session.beginTransaction(); + + OperationStatus os = new OperationStatus(); + os.setOperation(actionNm); + os.setOperationContent(""); + os.setOperationId(operationId); + os.setProgress("0"); + os.setReason(""); + os.setResult("processing"); + os.setServiceId(serviceId); + //TODO : to be updated... + os.setUserId(""); + os.setFinishedAt(new Timestamp(System.currentTimeMillis())); + os.setOperateAt(new Timestamp(System.currentTimeMillis())); + + session.save(os); + session.getTransaction().commit(); + + } catch (Exception e) { + msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception when creation record request in Operation", e); + } finally { + if (null != session) { + session.close(); + } + } } }
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java index 92a45a71dd..2f32e80dc1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java @@ -134,58 +134,7 @@ public class OrchestrationRequests { return Response.status(200).entity(orchestrationResponse).build(); } - @GET - @Path("e2eServiceInstances/{version:[vV][3-5]}/{serviceId}/operations/{operationId}") - @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class) - @Produces(MediaType.APPLICATION_JSON) - public Response getE2EServiceInstances(@PathParam("serviceId") String serviceId, - @PathParam("version") String version, @PathParam("operationId") String operationId) { - - GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse(); - - MsoRequest msoRequest = new MsoRequest(serviceId); - - long startTime = System.currentTimeMillis(); - - OperationStatus requestDB = null; - - try { - requestDB = requestsDB.getOperationStatus(serviceId, operationId); - - } catch (Exception e) { - msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "", - MsoLogger.ErrorCode.AvailabilityError, - "Exception while communciate with Request DB - Infra Request Lookup", e); - msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED); - Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND, - MsoException.ServiceException, e.getMessage(), ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null); - alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL, - Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB)); - msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, - "Exception while communciate with Request DB"); - msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity()); - return response; - - } - - if (requestDB == null) { - Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NO_CONTENT, - MsoException.ServiceException, "E2E serviceId " + serviceId + " is not found in DB", - ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null); - msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "", - MsoLogger.ErrorCode.BusinessProcesssError, - "Null response from RequestDB when searching by serviceId"); - msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound, - "Null response from RequestDB when searching by serviceId"); - msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity()); - return resp; - - } - - e2eServiceResponse.setE2eRequest(requestDB); - - return Response.status(200).entity(e2eServiceResponse).build(); - } + @GET @Path("orchestrationRequests/{version:[vV][2-5]}") @@ -242,7 +191,7 @@ public class OrchestrationRequests { } @POST - @Path("/{version: [vV][3-5]}/{requestId}/unlock") + @Path("orchestrationRequests/{version: [vV][3-5]}/{requestId}/unlock") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Unlock Orchestrated Requests for a given requestId", response = Response.class) @@ -437,29 +386,4 @@ public class OrchestrationRequests { return request; } - private E2ERequest mapInfraActiveRequestToE2ERequest(InfraActiveRequests requestDB) { - - E2ERequest e2erequest = new E2ERequest(); - - e2erequest.setOperationId(requestDB.getRequestId()); - // e2erequest.setRequestScope(requestDB.getRequestScope()); - e2erequest.setOperation(requestDB.getRequestAction()); - e2erequest.setResult(requestDB.getRequestStatus()); - e2erequest.setReason(requestDB.getStatusMessage()); - e2erequest.setUserId(requestDB.getRequestorId()); - e2erequest.setOperationContent(requestDB.getStatusMessage()); - e2erequest.setProgress(requestDB.getProgress()); - - String startTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(requestDB.getStartTime()) - + " GMT"; - e2erequest.setOperateAt(startTimeStamp); - - if (requestDB.getEndTime() != null) { - String endTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(requestDB.getEndTime()) - + " GMT"; - e2erequest.setFinishedAt(endTimeStamp); - } - - return e2erequest; - } }
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java new file mode 100644 index 0000000000..c05b0977ba --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/DelE2ESvcResp.java @@ -0,0 +1,37 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; + +import org.codehaus.jackson.map.annotate.JsonSerialize; + +@JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT) +public class DelE2ESvcResp { + + private String operationId; + + public String getOperationId() { + return operationId; + } + + public void setOperationId(String operationId) { + this.operationId = operationId; + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java index 0e2067e448..bcad1f33cc 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EParameters.java @@ -21,6 +21,7 @@ package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.codehaus.jackson.annotate.JsonIgnore; @@ -30,52 +31,55 @@ import org.codehaus.jackson.annotate.JsonProperty; @JsonIgnoreProperties({ "additionalProperties" }) public class E2EParameters { - @JsonProperty("domainHost") - private String domainHost; - - @JsonProperty("nodeTemplateName") - private String nodeTemplateName; - - @JsonProperty("nodeType") - private String nodeType; - @JsonProperty("globalSubscriberId") private String globalSubscriberId; @JsonProperty("subscriberName") private String subscriberName; + + @JsonProperty("serviceType") + private String serviceType; + + @JsonProperty("templateName") + private String templateName; + - @JsonProperty("requestParameters") - private E2ERequestParameters requestParameters; + @JsonProperty("resources") + private List<ResourceRequest> resources; @JsonIgnore private Map<String, Object> additionalProperties = new HashMap<>(); - public String getDomainHost() { - return domainHost; - } - - public void setDomainHost(String domainHost) { - this.domainHost = domainHost; - } - - public String getNodeTemplateName() { - return nodeTemplateName; - } - - public void setNodeTemplateName(String nodeTemplateName) { - this.nodeTemplateName = nodeTemplateName; - } - - public String getNodeType() { - return nodeType; - } - - public void setNodeType(String nodeType) { - this.nodeType = nodeType; - } - - public String getGlobalSubscriberId() { + + /** + * @return Returns the serviceType. + */ + public String getServiceType() { + return serviceType; + } + + /** + * @param serviceType The serviceType to set. + */ + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + /** + * @return Returns the templateName. + */ + public String getTemplateName() { + return templateName; + } + + /** + * @param templateName The templateName to set. + */ + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getGlobalSubscriberId() { return globalSubscriberId; } @@ -91,14 +95,6 @@ public class E2EParameters { this.subscriberName = subscriberName; } - public E2ERequestParameters getRequestParameters() { - return requestParameters; - } - - public void setRequestParameters(E2ERequestParameters requestParameters) { - this.requestParameters = requestParameters; - } - public Map<String, Object> getAdditionalProperties() { return additionalProperties; } @@ -106,5 +102,19 @@ public class E2EParameters { public void setAdditionalProperties(Map<String, Object> additionalProperties) { this.additionalProperties = additionalProperties; } + + /** + * @return Returns the resources. + */ + public List<ResourceRequest> getResources() { + return resources; + } + + /** + * @param resources The resources to set. + */ + public void setResources(List<ResourceRequest> resources) { + this.resources = resources; + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EServiceInstanceDeleteRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EServiceInstanceDeleteRequest.java new file mode 100644 index 0000000000..157ee72535 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2EServiceInstanceDeleteRequest.java @@ -0,0 +1,46 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans;
+
+
+public class E2EServiceInstanceDeleteRequest {
+
+ private String globalSubscriberId;
+
+ private String serviceType;
+
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+ public void setGlobalSubscriberId(String globalSubscriberId) {
+ this.globalSubscriberId = globalSubscriberId;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java new file mode 100644 index 0000000000..c4c0c534ac --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/LocationConstraint.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; + +/** + * <br> + * <p> + * </p> + * + * @author + * @version ONAP Amsterdam Release 2017-9-6 + */ +public class LocationConstraint { + + /** + * vnf profile id + */ + private String vnfProfileId; + + /** + * location constraints: vimId + */ + private VimLocation locationConstraints; + + /** + * @return Returns the vnfProfileId. + */ + public String getVnfProfileId() { + return vnfProfileId; + } + + /** + * @param vnfProfileId The vnfProfileId to set. + */ + public void setVnfProfileId(String vnfProfileId) { + this.vnfProfileId = vnfProfileId; + } + + + /** + * @return Returns the locationConstraints. + */ + public VimLocation getLocationConstraints() { + return locationConstraints; + } + + + /** + * @param locationConstraints The locationConstraints to set. + */ + public void setLocationConstraints(VimLocation locationConstraints) { + this.locationConstraints = locationConstraints; + } + +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java index ae8fe808f2..6121e47f83 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/E2ERequestParameters.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/NsParameters.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,49 +17,52 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.codehaus.jackson.annotate.JsonIgnore; -import org.codehaus.jackson.annotate.JsonProperty; - -public class E2ERequestParameters { - - @JsonProperty("subscriptionServiceType") - private String subscriptionServiceType; - - @JsonProperty("userParams") - private List<E2EUserParam> userParams = null; - - @JsonIgnore - private Map<String, Object> additionalProperties = new HashMap<>(); - - public String getSubscriptionServiceType() { - return subscriptionServiceType; - } - - public void setSubscriptionServiceType(String subscriptionServiceType) { - this.subscriptionServiceType = subscriptionServiceType; - } +/** + * <br> + * <p> + * </p> + * + * @author + * @version ONAP Amsterdam Release 2017-9-6 + */ +public class NsParameters { - public List<E2EUserParam> getUserParams() { - return userParams; - } + private List<LocationConstraint> locationConstraints; - public void setUserParams(List<E2EUserParam> userParams) { - this.userParams = userParams; - } + private Map<String, Object> additionalParamForNs = new HashMap<String,Object>(); + /** + * @return Returns the locationConstraints. + */ + public List<LocationConstraint> getLocationConstraints() { + return locationConstraints; + } - public Map<String, Object> getAdditionalProperties() { - return additionalProperties; - } + /** + * @param locationConstraints The locationConstraints to set. + */ + public void setLocationConstraints(List<LocationConstraint> locationConstraints) { + this.locationConstraints = locationConstraints; + } - public void setAdditionalProperties(Map<String, Object> additionalProperties) { - this.additionalProperties = additionalProperties; - } + + /** + * @return Returns the additionalParamForNs. + */ + public Map<String, Object> getAdditionalParamForNs() { + return additionalParamForNs; + } + + /** + * @param additionalParamForNs The additionalParamForNs to set. + */ + public void setAdditionalParamForNs(Map<String, Object> additionalParamForNs) { + this.additionalParamForNs = additionalParamForNs; + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java new file mode 100644 index 0000000000..5db3c3f73d --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/ResourceRequest.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans; + +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.jackson.annotate.JsonIgnore; +import org.codehaus.jackson.annotate.JsonProperty; + +public class ResourceRequest { + + @JsonProperty("resourceName") + private String resourceName; + + @JsonProperty("resourceDefId") + private String resourceDefId; + + @JsonProperty("resourceId") + private String resourceId; + + @JsonProperty("nsParameters") + private NsParameters nsParameters = null; + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + /** + * @return Returns the resourceName. + */ + public String getResourceName() { + return resourceName; + } + + /** + * @param resourceName The resourceName to set. + */ + public void setResourceName(String resourceName) { + this.resourceName = resourceName; + } + + /** + * @return Returns the resourceDefId. + */ + public String getResourceDefId() { + return resourceDefId; + } + + /** + * @param resourceDefId The resourceDefId to set. + */ + public void setResourceDefId(String resourceDefId) { + this.resourceDefId = resourceDefId; + } + + /** + * @return Returns the resourceId. + */ + public String getResourceId() { + return resourceId; + } + + /** + * @param resourceId The resourceId to set. + */ + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + /** + * @return Returns the nsParameters. + */ + public NsParameters getNsParameters() { + return nsParameters; + } + + /** + * @param nsParameters The nsParameters to set. + */ + public void setNsParameters(NsParameters nsParameters) { + this.nsParameters = nsParameters; + } + + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java new file mode 100644 index 0000000000..3a72f03157 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/e2eserviceinstancebeans/VimLocation.java @@ -0,0 +1,50 @@ +/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans;
+
+/**
+ *
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-10-18
+ */
+public class VimLocation {
+ private String vimId;
+
+
+ /**
+ * @return Returns the vimId.
+ */
+ public String getVimId() {
+ return vimId;
+ }
+
+
+ /**
+ * @param vimId The vimId to set.
+ */
+ public void setVimId(String vimId) {
+ this.vimId = vimId;
+ }
+
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java index b247d81d7f..eef597e931 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java @@ -34,9 +34,13 @@ import org.apache.http.HttpResponse; import org.apache.http.ProtocolVersion;
import org.apache.http.entity.BasicHttpEntity;
import org.apache.http.message.BasicHttpResponse;
+import org.hibernate.HibernateException;
+import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
+import org.hibernate.internal.SessionFactoryImpl;
import org.junit.Test;
+import org.mockito.Mockito;
import org.openecomp.mso.apihandler.common.CamundaClient;
import org.openecomp.mso.apihandler.common.RequestClient;
import org.openecomp.mso.apihandler.common.RequestClientFactory;
@@ -111,10 +115,10 @@ public class E2EServiceInstancesTest { };
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("success") != -1);
}
@Test
@@ -175,10 +179,10 @@ public class E2EServiceInstancesTest { };
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("SVC2000") != -1);
}
@Test
@@ -239,10 +243,10 @@ public class E2EServiceInstancesTest { };
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("SVC2000") != -1);
}
@Test
@@ -291,10 +295,10 @@ public class E2EServiceInstancesTest { };
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
@Test
@@ -340,10 +344,10 @@ public class E2EServiceInstancesTest { };
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
@Test
@@ -370,10 +374,10 @@ public class E2EServiceInstancesTest { }
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("Exception while creating record in DB null") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
@Test
@@ -422,10 +426,10 @@ public class E2EServiceInstancesTest { }
};
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("The existing request must finish or be cleaned up before proceeding.") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
@Test
@@ -447,10 +451,10 @@ public class E2EServiceInstancesTest { @Test
public void createE2EServiceInstanceTestDBQueryFail(){
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"globalSubscriberId\":\"123457\", \"subscriberName\":\"Customer1\",\"serviceType\":\"voLTE\",\"templateName\":\"voLTE Service:1.0\",\"resources\":[{\"resourceName\":\"MOG\",\"resourceDefId\":\"MOG\",\"resourceId\":\"MOG\",\"nsParameters\":{\"locationConstraints\":[{\"vnfProfileId\":\"zte-vBAS-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}},{\"vnfProfileId\":\"zte-vMME-1.0\",\"locationConstraints\":{\"vimId\":\"4050083f-465f-4838-af1e-47a545222ad0\"}}],\"additionalParamForNs\":{}}}]}}}";
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("SVC2000") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
@Test
@@ -465,9 +469,9 @@ public class E2EServiceInstancesTest { @Test
public void deleteE2EServiceInstanceTestNormal(){
E2EServiceInstances instance = new E2EServiceInstances();
- String request = "{\"service\":{\"name\":\"service\",\"description\":\"so_test1\",\"serviceDefId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"templateId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"parameters\":{\"domainHost\":\"localhost\",\"nodeTemplateName\":\"modelName:v3\",\"nodeType\":\"service\",\"globalSubscriberId\":\"4050083f-465f-4838-af1e-47a545222ad1\",\"subscriberName\":\"NEED THIS UUI - AAI\",\"requestParameters\":{\"subscriptionServiceType\":\"MOG\",\"userParams\":[{\"name\":\"someUserParam\",\"value\":\"someValue\"},{\"name\":\"segments\",\"value\":\"value\"},{\"name\":\"nsParameters\",\"value\":\"othervalue\"}]}}}}";
+ String request = "{\"globalSubscriberId\":\"299392392\",\"serviceType\":\"VoLTE\"}";
Response resp = instance.deleteE2EServiceInstance(request, "v3", "12345678");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.indexOf("SVC2000") != -1);
+ assertTrue(respStr.indexOf("SVC1000") != -1);
}
}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java index 796a3f90fe..ddf6b44cc2 100644 --- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java +++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java @@ -42,6 +42,8 @@ public class OperationStatus implements Serializable{ private String operationId;
+ private String serviceName;
+
private String operation;
private String userId;
@@ -159,6 +161,24 @@ public class OperationStatus implements Serializable{ }
+
+ /**
+ * @return Returns the serviceName.
+ */
+ public String getServiceName() {
+ return serviceName;
+ }
+
+
+
+ /**
+ * @param serviceName The serviceName to set.
+ */
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+
/**
* <br>
*
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml index 8d80f76649..a433ab5a8b 100644 --- a/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml +++ b/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml @@ -32,6 +32,7 @@ <key-property name="serviceId" type="string" column="SERVICE_ID"/> <key-property name="operationId" column="OPERATION_ID" type="string" length="256"/> </composite-id> + <property name="serviceName" column="SERVICE_NAME" type="string" length="256"/> <property name="operation" column="OPERATION_TYPE" type="string" length="256"/> <property name="userId" column="USER_ID" type="string" length="256"/> <property name="result" column="RESULT" type="string" length="256"/> diff --git a/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml b/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml index 4674239a99..5a2c4aa537 100644 --- a/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml +++ b/mso-catalog-db/src/main/resources/HeatFiles.hbm.xml @@ -36,7 +36,7 @@ <property name="version" type="java.lang.String" length="20" not-null="true">
<column name="VERSION" />
</property>
- <property name="fileBody" type="java.lang.String" not-null="true">
+ <property name="fileBody" type="text" not-null="true">
<column name="BODY" />
</property>
<property name="created" type="java.sql.Timestamp" generated="insert" update="false" insert="false" not-null="true">
diff --git a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml index 7f4698e82b..1599cf5c66 100644 --- a/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml +++ b/mso-catalog-db/src/main/resources/NetworkResource.hbm.xml @@ -29,7 +29,7 @@ <id name="modelUUID" column="MODEL_UUID" type="string" length="200"/> <property name="modelName" column="MODEL_NAME" type="string" length="200" not-null="true" /> - <property name="modelInvariantUUID" column="MODEL_INVARIANT_UUID" type="string" length="20"/> + <property name="modelInvariantUUID" column="MODEL_INVARIANT_UUID" type="string" length="200"/> <property name="modelVersion" column="MODEL_VERSION" type="string" length="20"/> <property name="toscaNodeType" column="TOSCA_NODE_TYPE" type="string" length="200"/> <property name="neutronNetworkType" column="NEUTRON_NETWORK_TYPE" type="string" length="20"/> @@ -50,4 +50,4 @@ </class> -</hibernate-mapping>
\ No newline at end of file +</hibernate-mapping> diff --git a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg511NfmService.csar b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg511NfmService.csar Binary files differindex 2686e4ba57..a383359ca0 100644 --- a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg511NfmService.csar +++ b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg511NfmService.csar diff --git a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar Binary files differindex d2983ce609..edbd8d8fcc 100644 --- a/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar +++ b/packages/arquillian-unit-tests/src/test/resources/resource-examples/asdc/service_Rg516VmmscSrvc_csar.csar diff --git a/packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql b/packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql index bbb632fbc3..49378cab61 100644 --- a/packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql +++ b/packages/root-pack-extras/config-resources/mariadb/db-sql-scripts/bulkload-files/default/create_mso_db-default.sql @@ -90,9 +90,9 @@ INSERT INTO vnf_recipe (VNF_TYPE, ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATIO INSERT INTO vnf_components_recipe (VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES (NULL, 'volumeGroup', 'createInstance', '1', 'VID_DEFAULT recipe to create volume-group if no custom BPMN flow is found', '/mso/async/services/CreateVfModuleVolumeInfraV1', '180', 'VID_DEFAULT'); INSERT INTO vnf_components_recipe (VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES (NULL, 'volumeGroup', 'deleteInstance', '1', 'VID_DEFAULT recipe to delete volume-group if no custom BPMN flow is found', '/mso/async/services/DeleteVfModuleVolumeInfraV1', '180', 'VID_DEFAULT'); INSERT INTO vnf_components_recipe (VNF_TYPE, VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES (NULL, 'volumeGroup', 'updateInstance', '1', 'VID_DEFAULT recipe to update volume-group if no custom BPMN flow is found', '/mso/async/services/UpdateVfModuleVolumeInfraV1', '180', 'VID_DEFAULT'); -INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES ('vfModule', 'createInstance', '1', 'VID_DEFAULT recipe to create vf-module if no custom BPMN flow is found', '/mso/async/services/CreateVfModuleInfra', '180', 'VID_DEFAULT'); -INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES ('vfModule', 'deleteInstance', '1', 'VID_DEFAULT recipe to delete vf-module if no custom BPMN flow is found', '/mso/async/services/DeleteVfModuleInfra', '180', 'VID_DEFAULT'); -INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_ID) VALUES ('vfModule', 'updateInstance', '1', 'VID_DEFAULT recipe to update vf-module if no custom BPMN flow is found', '/mso/async/services/UpdateVfModuleInfra', '180', 'VID_DEFAULT'); +INSERT INTO vnf_components_recipe (VNF_TYPE, VF_MODULE_MODEL_UUID, VNF_COMPONENT_TYPE, ACTION, SERVICE_TYPE, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) values (NULL, 'VID_DEFAULT', 'vfModule', 'createInstance', 'service_type', '1.0', 'VID_DEFAULT recipe to create vf-module if no custom BPMN flow is found', '/mso/async/services/CreateVfModuleInfra', '180'); +INSERT INTO vnf_components_recipe (VNF_TYPE, VF_MODULE_MODEL_UUID, VNF_COMPONENT_TYPE, ACTION, SERVICE_TYPE, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) values (NULL, 'VID_DEFAULT', 'vfModule', 'deleteInstance', 'service_type', '1.0', 'VID_DEFAULT recipe to delete vf-module if no custom BPMN flow is found', '/mso/async/services/DeleteVfModuleInfra', '180'); +INSERT INTO vnf_components_recipe (VNF_TYPE, VF_MODULE_MODEL_UUID, VNF_COMPONENT_TYPE, ACTION, SERVICE_TYPE, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) values (NULL, 'VID_DEFAULT', 'vfModule', 'updateInstance', 'service_type', '1.0', 'VID_DEFAULT recipe to update vf-module if no custom BPMN flow is found', '/mso/async/services/UpdateVfModuleInfra', '180'); INSERT INTO network_recipe (NETWORK_TYPE, ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) VALUES ('VID_DEFAULT', 'createInstance', '1.0', 'VID_DEFAULT recipe to create network if no custom BPMN flow is found', '/mso/async/services/CreateNetworkInstance', '180'); INSERT INTO network_recipe (NETWORK_TYPE, ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) VALUES ('VID_DEFAULT', 'updateInstance', '1.0', 'VID_DEFAULT recipe to update network if no custom BPMN flow is found', '/mso/async/services/UpdateNetworkInstance', '180'); INSERT INTO network_recipe (NETWORK_TYPE, ACTION, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT) VALUES ('VID_DEFAULT', 'deleteInstance', '1.0', 'VID_DEFAULT recipe to delete network if no custom BPMN flow is found', '/mso/async/services/DeleteNetworkInstance', '180'); |