summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-vfc-adapter/README1
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnParam.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java7
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/appc/payload/PayloadClientTest.java81
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/util/CryptoHandlerTest.java42
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java83
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy69
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy32
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy1110
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy10
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy12
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java12
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java3
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java23
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java13
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CompareModelofE2EServiceInstance.bpmn6
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVfModuleInfra.bpmn299
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelVersions.bpmn4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelofE2EServiceInstance.bpmn10
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn10
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn4
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/web.xml10
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java22
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java11
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java38
-rw-r--r--cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTest.java103
-rw-r--r--cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTokenProviderTest.java56
-rw-r--r--cloudify-client/src/test/java/org/openecomp/mso/cloudify/connector/http/HttpClientConnectorTest.java113
-rw-r--r--cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/BlueprintsResourceTest.java132
-rw-r--r--cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/ExecutionsResourceTest.java170
-rw-r--r--common/src/test/java/org/openecomp/mso/utils/UUIDCheckerTest.java44
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml1
-rw-r--r--mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java2
-rw-r--r--pom.xml2
40 files changed, 1831 insertions, 744 deletions
diff --git a/adapters/mso-vfc-adapter/README b/adapters/mso-vfc-adapter/README
index e69de29bb2..233430c16a 100644
--- a/adapters/mso-vfc-adapter/README
+++ b/adapters/mso-vfc-adapter/README
@@ -0,0 +1 @@
+This is the adapter for VFC \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy
index ca7eef8aa1..535b65e187 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AppCClient.groovy
@@ -74,13 +74,15 @@ public class AppCClient extends AbstractServiceTaskProcessor{
String vnfHostIpAddress = execution.getVariable('vnfHostIpAddress')
String vmIdList = execution.getVariable("vmIdList")
String identityUrl = execution.getVariable("identityUrl")
- String controllerType = execution.getVariable("controllerType")
+ String controllerType = execution.getVariable("controllerType")
+ String vfModuleId = execution.getVariable("vfModuleId")
HashMap<String, String> payloadInfo = new HashMap<String, String>();
payloadInfo.put("vnfName", vnfName)
payloadInfo.put("aicIdentity", aicIdentity)
payloadInfo.put("vnfHostIpAddress", vnfHostIpAddress)
payloadInfo.put("vmIdList", vmIdList)
payloadInfo.put("identityUrl", identityUrl)
+ payloadInfo.put("vfModuleId",vfModuleId)
Optional<String> payload
logDebug("Running APP-C action: " + action.toString(), isDebugLogEnabled)
utils.log("DEBUG", "VNFID: " + vnfId, isDebugLogEnabled)
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnParam.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnParam.java
index f4ebd0615a..4b58b51560 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnParam.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnParam.java
@@ -41,7 +41,7 @@ public class BpmnParam {
return value;
}
- @JsonProperty("type")
+ @JsonProperty("value")
public void setValue(String value) {
this.value = value;
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
index e43af18ceb..016afa8537 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
@@ -181,6 +181,7 @@ public class BpmnRestClient {
requestIdInput.setValue(requestId);
requestActionInput.setValue(requestAction);
serviceInstanceIdInput.setValue(serviceInstanceId);
+ serviceTypeInput.setValue(serviceType);
recipeParamsInput.setValue(recipeParams);
resourceInput.setValue(requestDetails);
recipeRequest.setHost(host);
@@ -189,6 +190,7 @@ public class BpmnRestClient {
recipeRequest.setServiceInstanceId(serviceInstanceIdInput);
recipeRequest.setServiceType(serviceTypeInput);
recipeRequest.setRecipeParams(recipeParamsInput);
+ recipeRequest.setResourceInput(resourceInput);
jsonReq = recipeRequest.toString();
msoLogger.debug("request body is " + jsonReq);
} catch(Exception e) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
index 36585717fa..74a3252768 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
@@ -55,7 +55,7 @@ public class ResourceRequestBuilder {
public static String CUSTOMIZATION_UUID = "customizationUUID";
- public static String SERVICE_URL_TOSCA_CSAR = "http://localhost:8080/ecomp/mso/catalog/v3/serviceToscaCsar?serviceModelUuid=";
+ public static String SERVICE_URL_TOSCA_CSAR = "http://mso:8080/ecomp/mso/catalog/v3/serviceToscaCsar?serviceModelUuid=";
private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
@@ -69,9 +69,10 @@ public class ResourceRequestBuilder {
* "requestInputs":{K,V}
* }
* <br>
- *
+ *
+ * @param execution Execution context
* @param serviceUuid The service template uuid
- * @param resourceucstomizationUuid The resource customization uuid
+ * @param resourceCustomizationUuid The resource customization uuid
* @param serviceParameters the service parameters passed from the API
* @return the resource instantiate parameters
* @since ONAP Beijing Release
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/appc/payload/PayloadClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/appc/payload/PayloadClientTest.java
new file mode 100644
index 0000000000..95af260ac6
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/appc/payload/PayloadClientTest.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.bpmn.appc.payload;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Optional;
+
+import org.json.JSONObject;
+import org.junit.Test;
+
+public class PayloadClientTest {
+
+ @Test
+ public void upgradeFormatTest() throws Exception {
+ String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\",\"existing-software-version\":\"existingVersion\",\"new-software-version\":\"newVersion\"}}";
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("existing-software-version", "existingVersion");
+ jsonObject.put("new-software-version", "newVersion");
+ Optional<String> payload = Optional.of(jsonObject.toString());
+ Optional<String> payloadClient = PayloadClient.upgradeFormat(payload, "vnfName1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+ @Test
+ public void resumeTrafficFormatTest() throws Exception {
+ String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\"}}";
+ Optional<String> payloadClient = PayloadClient.resumeTrafficFormat("vnfName1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+ @Test
+ public void quiesceTrafficFormatTest() throws Exception {
+ String payloadResult = "{\"configuration-parameters\":{\"vnf_name\":\"vnfName1\",\"operations_timeout\":\"operationTimeout\"}}";
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("operations-timeout", "operationTimeout");
+ Optional<String> payload = Optional.of(jsonObject.toString());
+ Optional<String> payloadClient = PayloadClient.quiesceTrafficFormat(payload, "vnfName1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+ @Test
+ public void startStopFormatTest() throws Exception {
+ String payloadResult = "{\" AICIdentity \":\"aicIdentity1\"}";
+ Optional<String> payloadClient = PayloadClient.startStopFormat("aicIdentity1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+ @Test
+ public void healthCheckFormatTest() throws Exception {
+ String payloadResult = "{\"request-parameters\":{\"vnf-name\":\"vnfName1\"},\"configuration-parameters\":{\"vnf_name\":\"vnfName1\"}}";
+ Optional<String> payloadClient = PayloadClient.healthCheckFormat("vnfName1", "vnfHostIpAddress1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+ @Test
+ public void snapshotFormatTest() throws Exception {
+ String payloadResult = "{\"vm-id\":\"vmId1\",\"identity-url\":\"identityUrl1\"}";
+ Optional<String> payloadClient = PayloadClient.snapshotFormat("vmId1", "identityUrl1");
+ assertEquals(payloadResult, payloadClient.get());
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/util/CryptoHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/util/CryptoHandlerTest.java
new file mode 100644
index 0000000000..724d3edf4d
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/util/CryptoHandlerTest.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.bpmn.common.util;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class CryptoHandlerTest {
+
+ @Test
+ public void test() throws Exception {
+ String plainPswd = "mso0206";
+ String encryptPwd = "C1FC4A39E16419DD41DFC1212843F440";
+ CryptoHandler cryptoHandler = new CryptoHandler();
+ String aaiPassword = cryptoHandler.getMsoAaiPassword();
+ assertEquals(plainPswd, aaiPassword);
+ String encryptPassword = cryptoHandler.encryptMsoPassword(plainPswd);
+ assertEquals(encryptPwd, encryptPassword);
+ String decryptPassword = cryptoHandler.decryptMsoPassword(encryptPwd);
+ assertEquals(plainPswd, decryptPassword);
+ }
+
+} \ No newline at end of file
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java
new file mode 100644
index 0000000000..90cb7362cf
--- /dev/null
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/domain/CompareModelsResultTest.java
@@ -0,0 +1,83 @@
+/*
+* ============LICENSE_START=======================================================
+* ONAP : SO
+* ================================================================================
+* Copyright (C) 2018 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=========================================================
+*/
+package org.openecomp.mso.bpmn.core.domain;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class CompareModelsResultTest {
+
+ private CompareModelsResult modelsResult;
+ private List<ResourceModelInfo> addedResourceList;
+ private List<ResourceModelInfo> deletedResourceList;
+ private ResourceModelInfo resourceModelInfo1;
+ private ResourceModelInfo resourceModelInfo2;
+ private List<String> requestInputs;
+
+ @Before
+ public void before() {
+ resourceModelInfo1 = new ResourceModelInfo();
+ resourceModelInfo1.setResourceCustomizationUuid("f1d563e8-e714-4393-8f99-cc480144a05e");
+ resourceModelInfo1.setResourceInvariantUuid("e1d563e8-e714-4393-8f99-cc480144a05f");
+ resourceModelInfo1.setResourceName("resourceName1");
+ resourceModelInfo1.setResourceUuid("f1d563e8-e714-4393-8f99-cc480144a05g");
+ resourceModelInfo2 = new ResourceModelInfo();
+ resourceModelInfo2.setResourceCustomizationUuid("a1d563e8-e714-4393-8f99-cc480144a05d");
+ resourceModelInfo2.setResourceInvariantUuid("b1d563e8-e714-4393-8f99-cc480144a05e");
+ resourceModelInfo2.setResourceName("resourceName2");
+ resourceModelInfo2.setResourceUuid("c1d563e8-e714-4393-8f99-cc480144a05f");
+ }
+
+ @Test
+ public void testSetAddedResourceList() {
+ addedResourceList = new ArrayList<ResourceModelInfo>();
+ addedResourceList.add(resourceModelInfo1);
+ addedResourceList.add(resourceModelInfo2);
+ modelsResult = new CompareModelsResult();
+ modelsResult.setAddedResourceList(addedResourceList);
+ assertEquals(addedResourceList, modelsResult.getAddedResourceList());
+ }
+
+ @Test
+ public void testSetDeletedResourceList() {
+ deletedResourceList = new ArrayList<ResourceModelInfo>();
+ deletedResourceList.add(resourceModelInfo1);
+ deletedResourceList.add(resourceModelInfo2);
+ modelsResult = new CompareModelsResult();
+ modelsResult.setDeletedResourceList(deletedResourceList);
+ assertEquals(deletedResourceList, modelsResult.getDeletedResourceList());
+ }
+
+ @Test
+ public void testSetRequestInputs() {
+ requestInputs = new ArrayList<String>();
+ requestInputs.add("requestInput1");
+ requestInputs.add("requestInput2");
+ modelsResult = new CompareModelsResult();
+ modelsResult.setRequestInputs(requestInputs);
+ assertEquals(requestInputs, modelsResult.getRequestInputs());
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
index c70c971bc7..3652d56303 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CompareModelofE2EServiceInstance.groovy
@@ -101,32 +101,49 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
if (isBlank(serviceInstanceId)) {
msg = "Input serviceInstanceId' is null"
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- }
-
- /*
- * 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.toString())
- }
}
- execution.setVariable("operationType", "CompareModel")
- utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
- execution.setVariable("serviceInputParams", inputMap)
-
- } catch (BpmnError e) {
- throw e;
+ //subscriberInfo
+ String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
+ if (isBlank(globalSubscriberId)) {
+ msg = "Input globalSubscriberId' is null"
+ utils.log("INFO", msg, isDebugEnabled)
+ } else {
+ execution.setVariable("globalSubscriberId", globalSubscriberId)
+ }
+
+ //subscriptionServiceType
+ String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "serviceType")
+ if (isBlank(subscriptionServiceType)) {
+ msg = "Input subscriptionServiceType is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("serviceType", subscriptionServiceType)
+ }
+
+ //modelInvariantIdTarget
+ String modelInvariantIdTarget = jsonUtil.getJsonValue(siRequest, "modelInvariantIdTarget")
+ if (isBlank(modelInvariantIdTarget)) {
+ msg = "Input modelInvariantIdTarget' is null"
+ utils.log("INFO", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("modelInvariantIdTarget", modelInvariantIdTarget)
+ }
+
+ //modelVersionIdTarget
+ String modelVersionIdTarget = jsonUtil.getJsonValue(siRequest, "modelVersionIdTarget")
+ if (isBlank(modelVersionIdTarget)) {
+ msg = "Input modelVersionIdTarget is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("modelVersionIdTarget", modelVersionIdTarget)
+ }
+
+ execution.setVariable("operationType", "CompareModel")
+
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
utils.log("INFO", msg, isDebugEnabled)
@@ -143,13 +160,13 @@ public class CompareModelofE2EServiceInstance extends AbstractServiceTaskProcess
CompareModelsResult compareModelsResult = execution.getVariable("compareModelsResult")
// RESTResponse (for API Handler(APIH) Reply Task)
- String syncResponse = compareModelsResult.toString()
+ String syncResponse = compareModelsResult.toJsonStringNoRootName()
utils.log("INFO", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
String msg = "Exception in sendSyncResponse: " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
}
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 1464aedc5c..3903e12ba2 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
@@ -129,17 +129,20 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
Map reqMap = jsonSlurper.parseText(siRequest)
//InputParams
- def userParams = reqMap.requestDetails?.requestParameters?.userParams
+ def userParamsList = reqMap.requestDetails?.requestParameters?.userParams
Map<String, String> inputMap = [:]
- if (userParams) {
- userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value.toString())
+ if (userParamsList) {
+ for (def i=0; i<userParamsList.size(); i++) {
+ def userParams1 = userParamsList.get(i)
+ userParams1.each { param -> inputMap.put(param.key, param.value)}
}
}
+
- utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ utils.log("DEBUG", "User Input Parameters map: " + inputMap.toString(), isDebugEnabled)
execution.setVariable("serviceInputParams", inputMap)
+ execution.setVariable("uuiRequest", inputMap.get("UUIRequest"))
execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
//TODO
//execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams"))
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 0279c2cbc8..b29c4dc101 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -28,7 +28,6 @@ import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.rest.APIResponse
-
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
@@ -62,24 +61,36 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
* generate the nsParameters
*/
public void preProcessRequest (DelegateExecution execution) {
+ JsonUtils jsonUtil = new JsonUtils()
+
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
try {
//deal with nsName and Description
- String nsServiceName = execution.getVariable("nsServiceName")
+ String resourceInput = execution.getVariable("resourceInput")
+
+ // get service name
+ String resourceName = jsonUtil.getJsonValue(resourceInput, "resourceInstanceName")
+ String nsServiceName = resourceName.substring(resourceName.indexOf("_") + 1)
+ execution.setVariable("nsServiceName", nsServiceName)
+
String nsServiceDescription = execution.getVariable("nsServiceDescription")
utils.log("INFO", "nsServiceName:" + nsServiceName + " nsServiceDescription:" + nsServiceDescription, isDebugEnabled)
//deal with operation key
- String globalSubscriberId = execution.getVariable("globalSubscriberId")
+ String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")
utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+
String serviceType = execution.getVariable("serviceType")
utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
- String serviceId = execution.getVariable("serviceId")
+
+ String serviceId = execution.getVariable("serviceInstanceId")
utils.log("INFO", "serviceId:" + serviceId, isDebugEnabled)
- String operationId = execution.getVariable("operationId")
+
+ String operationId = execution.getVariable("requestId")
utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
- String nodeTemplateUUID = execution.getVariable("resourceUUID")
+
+ String nodeTemplateUUID = jsonUtil.getJsonValue(resourceInput, "resourceModelInfo.modelCustomizationUuid")
utils.log("INFO", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)
/*
* segmentInformation needed as a object of segment
@@ -92,7 +103,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
* }
* }
*/
- String nsParameters = execution.getVariable("resourceParameters")
+ String nsParameters = jsonUtil.getJsonValue(resourceInput, "resourceParameters")
utils.log("INFO", "nsParameters:" + nsParameters, isDebugEnabled)
String nsOperationKey = """{
"globalSubscriberId":"${globalSubscriberId}",
@@ -125,11 +136,16 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
String nsParameters = execution.getVariable("nsParameters");
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
+ String locationConstraints = jsonUtil.getJsonValue(nsParameters, "locationConstraints")
+ String requestInputs = jsonUtil.getJsonValue(nsParameters, "requestInputs")
String reqBody ="""{
"nsServiceName":"${nsServiceName}",
"nsServiceDescription":"${nsServiceDescription}",
"nsOperationKey":${nsOperationKey},
- "nsParameters":${nsParameters}
+ "nsParameters":{
+ "locationConstraints":${locationConstraints},
+ "additionalParamForNs":${requestInputs}
+ }
}"""
APIResponse apiResponse = postRequest(execution, host + vfcUrl + "/ns", reqBody)
String returnCode = apiResponse.getStatusCode()
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
index 3b2c4ea2f8..3f0b8d11f1 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
@@ -1,552 +1,558 @@
-/*-
- * ============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=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure.scripts;
-
-import groovy.json.JsonSlurper
-import groovy.json.JsonOutput
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.delegate.DelegateExecution
-import org.apache.commons.lang3.*
-import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.common.scripts.NetworkUtils;
-import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils;
-import org.openecomp.mso.bpmn.common.scripts.VidUtils;
-import org.openecomp.mso.bpmn.core.RollbackData
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.core.json.JsonUtils
-
-public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
-
- ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtil = new JsonUtils()
-
- /**
- * Validates the request message and sets up the workflow.
- * @param execution the execution
- */
- public void preProcessRequest(DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.preProcessRequest(' +
- 'execution=' + execution.getId() +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
- execution.setVariable("CVFMI_sentSyncResponse", false)
-
- def prefix = 'CVFMI_'
- logDebug('Entered 1' + method, isDebugLogEnabled)
- execution.setVariable('prefix', prefix)
- logDebug('Entered 2' + method, isDebugLogEnabled)
- execution.setVariable("isVidRequest", "false")
-
- logDebug("Set variables", isDebugLogEnabled)
-
- def rollbackData = execution.getVariable("RollbackData")
- if (rollbackData == null) {
- rollbackData = new RollbackData()
- }
- execution.setVariable("RollbackData", rollbackData)
-
- logDebug("Set rollback data", isDebugLogEnabled)
- def incomingRequest = execution.getVariable('bpmnRequest')
-
- utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)
- utils.logAudit("CreateVfModule Infra incoming Request: " + incomingRequest)
-
- setBasicDBAuthHeader(execution, isDebugLogEnabled)
-
- // check if request is xml or json
- try {
- def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
- Map reqMap = jsonSlurper.parseText(incomingRequest)
- utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)
-
- def serviceInstanceId = execution.getVariable('serviceInstanceId')
- def vnfId = execution.getVariable('vnfId')
-
- execution.setVariable(prefix + 'serviceInstanceId', serviceInstanceId)
- execution.setVariable(prefix+'vnfId', vnfId)
- execution.setVariable("isVidRequest", "true")
-
- def vnfName = ''
- def asdcServiceModelVersion = ''
- def serviceModelInfo = null
- def vnfModelInfo = null
-
- def relatedInstanceList = reqMap.requestDetails?.relatedInstanceList
-
- if (relatedInstanceList != null) {
- relatedInstanceList.each {
- if (it.relatedInstance.modelInfo?.modelType == 'service') {
- asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
- serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
-
- }
- if (it.relatedInstance.modelInfo.modelType == 'vnf') {
- vnfName = it.relatedInstance.instanceName ?: ''
- vnfModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
- }
- }
- }
-
- execution.setVariable(prefix + 'vnfName', vnfName)
- execution.setVariable(prefix + 'asdcServiceModelVersion', asdcServiceModelVersion)
- execution.setVariable(prefix + 'serviceModelInfo', serviceModelInfo)
- execution.setVariable(prefix + 'vnfModelInfo', vnfModelInfo)
-
-
- def vnfType = execution.getVariable('vnfType')
- execution.setVariable(prefix + 'vnfType', vnfType)
- def vfModuleId = execution.getVariable('vfModuleId')
- execution.setVariable(prefix + 'vfModuleId', vfModuleId)
- def volumeGroupId = execution.getVariable('volumeGroupId')
- execution.setVariable(prefix + 'volumeGroupId', volumeGroupId)
- def userParams = reqMap.requestDetails?.requestParameters?.userParams
-
- Map<String, String> userParamsMap = [:]
- if (userParams != null) {
- userParams.each { userParam ->
- userParamsMap.put(userParam.name, jsonOutput.toJson(userParam.value).toString())
- }
- }
-
- utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled)
-
- execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
-
- def isBaseVfModule = "false"
- if (execution.getVariable('isBaseVfModule') == true) {
- isBaseVfModule = "true"
- }
-
- execution.setVariable(prefix + 'isBaseVfModule', isBaseVfModule)
-
- def requestId = execution.getVariable("mso-request-id")
- execution.setVariable(prefix + 'requestId', requestId)
-
- def vfModuleModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)
- execution.setVariable(prefix + 'vfModuleModelInfo', vfModuleModelInfo)
-
- def suppressRollback = reqMap.requestDetails?.requestInfo?.suppressRollback
-
-
- def backoutOnFailure = ""
- if(suppressRollback != null){
- if ( suppressRollback == true) {
- backoutOnFailure = "false"
- } else if ( suppressRollback == false) {
- backoutOnFailure = "true"
- }
- }
-
- execution.setVariable('disableRollback', suppressRollback)
-
- def vfModuleName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
- execution.setVariable(prefix + 'vfModuleName', vfModuleName)
-
- def serviceId = reqMap.requestDetails?.requestParameters?.serviceId ?: ''
- execution.setVariable(prefix + 'serviceId', serviceId)
-
- def usePreload = reqMap.requestDetails?.requestParameters?.usePreload
- execution.setVariable(prefix + 'usePreload', usePreload)
-
- // This is aLaCarte flow, so aLaCarte flag is always on
- execution.setVariable(prefix + 'aLaCarte', true)
-
- def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration
- def lcpCloudRegionId = cloudConfiguration.lcpCloudRegionId
- execution.setVariable(prefix + 'lcpCloudRegionId', lcpCloudRegionId)
- def tenantId = cloudConfiguration.tenantId
- execution.setVariable(prefix + 'tenantId', tenantId)
-
- def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''
- execution.setVariable(prefix + 'globalSubscriberId', globalSubscriberId)
-
- execution.setVariable(prefix + 'sdncVersion', '1702')
-
- execution.setVariable("CreateVfModuleInfraSuccessIndicator", false)
- execution.setVariable("RollbackCompleted", false)
-
- execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)
-
-
- def source = reqMap.requestDetails?.requestInfo?.source
- execution.setVariable("CVFMI_source", source)
-
- //For Completion Handler & Fallout Handler
- String requestInfo =
- """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- <request-id>${requestId}</request-id>
- <action>CREATE</action>
- <source>${source}</source>
- </request-info>"""
-
- execution.setVariable("CVFMI_requestInfo", requestInfo)
-
- //backoutOnFailure
-
- execution.setVariable("CVFMI_originalWorkflowException", null)
-
-
- def newVfModuleId = UUID.randomUUID().toString()
- execution.setVariable("newVfModuleId", newVfModuleId)
- execution.setVariable(prefix + 'vfModuleId', newVfModuleId)
-
- logDebug('RequestInfo: ' + execution.getVariable("CVFMI_requestInfo"), isDebugLogEnabled)
-
- logDebug('rollbackEnabled: ' + execution.getVariable("CVFMI_rollbackEnabled"), isDebugLogEnabled)
-
- logDebug('Exited ' + method, isDebugLogEnabled)
- } catch (BpmnError bpmnError) {
- throw bpmnError
- }
- catch(groovy.json.JsonException je) {
- utils.log("DEBUG", " Request is not in JSON format.", isDebugLogEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
- }
- catch(Exception e) {
- String restFaultMessage = e.getMessage()
- //execution.setVariable("CVFMODVOL2_RESTFault", restFaultMessage)
- //execution.setVariable("CVFMODVOL2_isDataOk", false)
- utils.log("ERROR", " Exception Encountered - " + "\n" + restFaultMessage, isDebugLogEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
- }
-
- }
-
- /**
- * Validates a workflow response.
- * @param execution the execution
- * @param responseVar the execution variable in which the response is stored
- * @param responseCodeVar the execution variable in which the response code is stored
- * @param errorResponseVar the execution variable in which the error response is stored
- */
- public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
- String responseCodeVar, String errorResponseVar) {
- SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
- sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
- }
-
-
- /**
- * Sends the empty, synchronous response back to the API Handler.
- * @param execution the execution
- */
- public void sendResponse(DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.sendResponse(' +
- 'execution=' + execution.getId() +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
- try {
- def requestInfo = execution.getVariable('CVFMI_requestInfo')
- def requestId = execution.getVariable('CVFMI_requestId')
- def source = execution.getVariable('CVFMI_source')
-
- // RESTResponse (for API Handler (APIH) Reply Task)
- def newVfModuleId = execution.getVariable("newVfModuleId")
- String synchResponse = """{"requestReferences":{"instanceId":"${newVfModuleId}","requestId":"${requestId}"}}""".trim()
-
- sendWorkflowResponse(execution, 200, synchResponse)
-
- execution.setVariable("CVFMI_sentSyncResponse", true)
- utils.logAudit("CreateVfModule Infra Response: " + synchResponse)
- logDebug('Exited ' + method, isDebugLogEnabled)
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logError('Caught exception in ' + method, e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
- }
- }
-
- /**
- *
- * @param execution the execution
- */
- public void postProcessResponse(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-
- utils.log("DEBUG", " ======== STARTED PostProcessResponse Process ======== ", isDebugEnabled)
- try{
- def requestInfo = execution.getVariable("CVFMI_requestInfo")
- def action = utils.getNodeText1(requestInfo, "action")
-
- utils.log("DEBUG", "requestInfo is: " + requestInfo, isDebugEnabled)
- utils.log("DEBUG", "action is: " + action, isDebugEnabled)
-
- String payload =
- """ <aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:ns="http://org.openecomp/mso/request/types/v1"
- xmlns:ns8="http://org.openecomp/mso/workflow/schema/v1">
- <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
- ${requestInfo}
- </request-info>
- <ns8:status-message>Vf Module has been created successfully.</ns8:status-message>
- <ns8:mso-bpel-name>BPMN</ns8:mso-bpel-name>
- </aetgt:MsoCompletionRequest>"""
-
- payload = utils.formatXml(payload)
- execution.setVariable("CVFMI_SuccessFlag", true)
- execution.setVariable("CVFMI_msoCompletionRequest", payload)
- utils.logAudit("CreateVfModuleInfra completion request: " + payload)
- utils.log("DEBUG", "Outgoing MsoCompletionRequest: \n" + payload, isDebugEnabled)
-
- }catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing PostProcessResponse. Exception is:\n" + e, isDebugEnabled)
- execution.setVariable("CVFMI_ErrorResponse", "Error Occured during PostProcessResponse Method:\n" + e.getMessage())
- }
- utils.log("DEBUG", "======== COMPLETED PostProcessResponse Process ======== ", isDebugEnabled)
- }
-
-
-
-
-
- /**
- * Validates the request, request id and service instance id. If a problem is found,
- * a WorkflowException is generated and an MSOWorkflowException event is thrown. This
- * method also sets up the log context for the workflow.
- * @param execution the execution
- * @return the validated request
- */
- public String validateInfraRequest(DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.validateInfraRequest(' +
- 'execution=' + execution.getId() +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
- String processKey = getProcessKey(execution);
- def prefix = execution.getVariable("prefix")
-
- if (prefix == null) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " prefix is null")
- }
-
- try {
- def request = execution.getVariable(prefix + 'Request')
-
- if (request == null) {
- request = execution.getVariable(processKey + 'Request')
-
- if (request == null) {
- request = execution.getVariable('bpmnRequest')
- }
-
- setVariable(execution, processKey + 'Request', null);
- setVariable(execution, 'bpmnRequest', null);
- setVariable(execution, prefix + 'Request', request);
- }
-
- if (request == null) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request is null")
- }
-
- /*
-
- def requestId = execution.getVariable("mso-request-id")
-
- if (requestId == null) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request has no mso-request-id")
- }
-
- setVariable(execution, prefix + 'requestId', requestId)
-
- def serviceInstanceId = execution.getVariable("mso-service-instance-id")
-
- if (serviceInstanceId == null) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request message has no mso-service-instance-id")
- }
-
- utils.logContext(requestId, serviceInstanceId)
- */
- utils.logAudit("CreateVfModule incoming request: " + request)
- logDebug('Incoming message: ' + System.lineSeparator() + request, isDebugLogEnabled)
- logDebug('Exited ' + method, isDebugLogEnabled)
- return request
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logError('Caught exception in ' + method, e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
- }
- }
-
- public void prepareUpdateInfraRequest(DelegateExecution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-
- utils.log("DEBUG", " ======== STARTED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
- try{
-
-
- String requestInfo = execution.getVariable("CVFMI_requestInfo")
- def aicCloudRegion = execution.getVariable("CVFMI_lcpCloudRegionId")
- def tenantId = execution.getVariable("CVFMI_tenantId")
- def requestId = utils.getNodeText1(requestInfo, "request-id")
- def vnfId = execution.getVariable("CVFMI_vnfId")
- def vfModuleId = execution.getVariable("CVFMI_vfModuleId")
- // vfModuleName may be generated by DoCreateVfModule subprocess if it is not specified on the input
- def vfModuleName = execution.getVariable("CVFMI_vfModuleName")
-
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
- execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
-
- String payload =
- """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:ns="http://org.openecomp.mso/requestsdb">
- <soapenv:Header/>
- <soapenv:Body>
- <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
- <requestId>${requestId}</requestId>
- <lastModifiedBy>BPMN</lastModifiedBy>
- <statusMessage>VF Module successfully created</statusMessage>
- <responseBody></responseBody>
- <requestStatus>COMPLETE</requestStatus>
- <progress>100</progress>
- <vnfOutputs>&lt;vnf-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"&gt;&lt;vnf-id&gt;${vnfId}&lt;/vnf-id&gt;&lt;vf-module-id&gt;${vfModuleId}&lt;/vf-module-id&gt;&lt;/vnf-outputs&gt;</vnfOutputs>
- <vfModuleId>${vfModuleId}</vfModuleId>
- <vfModuleName>${vfModuleName}</vfModuleName>
- </ns:updateInfraRequest>
- </soapenv:Body>
- </soapenv:Envelope>"""
-
- payload = utils.formatXml(payload)
- execution.setVariable("CVFMI_updateInfraRequest", payload)
- utils.log("DEBUG", "Outgoing UpdateInfraRequest: \n" + payload, isDebugEnabled)
- utils.logAudit("CreateVfModuleInfra Outgoing UpdateInfra Request: " + payload)
-
- }catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing prepareUpdateInfraRequest. Exception is:\n" + e, isDebugEnabled)
- execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateInfraRequest Method:\n" + e.getMessage())
- }
- utils.log("DEBUG", "======== COMPLETED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
- }
-
- /**
- * Builds a "FalloutHandler" request and stores it in the specified execution variable.
- *
- * @param execution the execution
- * @param resultVar the execution variable in which the result will be stored
- */
- public void falloutHandlerPrep(DelegateExecution execution, String resultVar) {
- def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +
- 'execution=' + execution.getId() +
- ', resultVar=' + resultVar +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
-
- try {
- def WorkflowException workflowException = execution.getVariable("WorkflowException")
- def requestInformation = execution.getVariable("CVFMI_requestInfo")
- def errorResponseCode = workflowException.getErrorCode()
- def errorResponseMsg = workflowException.getErrorMessage()
- def encErrorResponseMsg = ""
- if (errorResponseMsg != null) {
- encErrorResponseMsg = errorResponseMsg.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
- }
-
- String content = """
- <aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
- xmlns:reqtype="http://org.openecomp/mso/request/types/v1"
- xmlns:msoservtypes="http://org.openecomp/mso/request/types/v1"
- xmlns:structuredtypes="http://org.openecomp/mso/structured/types/v1">
- ${requestInformation}
- <aetgt:WorkflowException>
- <aetgt:ErrorMessage>${encErrorResponseMsg}</aetgt:ErrorMessage>
- <aetgt:ErrorCode>${errorResponseCode}</aetgt:ErrorCode>
- </aetgt:WorkflowException>
- </aetgt:FalloutHandlerRequest>
- """
-
- logDebug("CONTENT before translation: " + content, isDebugLogEnabled)
- content = utils.formatXml(content)
- logDebug(resultVar + ' = ' + System.lineSeparator() + content, isDebugLogEnabled)
- utils.logAudit("CreateVfModuleInfra FallOutHander Request: " + content)
- execution.setVariable(resultVar, content)
-
- logDebug('Exited ' + method, isDebugLogEnabled)
- } catch (BpmnError e) {
- throw e;
- } catch (Exception e) {
- logError('Caught exception in ' + method, e)
- exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
- }
- }
-
- public void logAndSaveOriginalException(DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
- 'execution=' + execution.getId() +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
- logWorkflowException(execution, 'CreateVfModuleInfra caught an event')
- saveWorkflowException(execution, 'CVFMI_originalWorkflowException')
- }
-
- public void validateRollbackResponse(DelegateExecution execution) {
- def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
- 'execution=' + execution.getId() +
- ')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
- logDebug('Entered ' + method, isDebugLogEnabled)
-
- def originalException = execution.getVariable("CVFMI_originalWorkflowException")
- execution.setVariable("WorkflowException", originalException)
-
- execution.setVariable("RollbackCompleted", true)
-
- }
-
- public void sendErrorResponse(DelegateExecution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- utils.log("DEBUG", " *** STARTED CreateVfModulenfra sendErrorResponse Process *** ", isDebugEnabled)
- try {
- def sentSyncResponse = execution.getVariable("CVFMI_sentSyncResponse")
- if(sentSyncResponse == false){
- WorkflowException wfex = execution.getVariable("WorkflowException")
- String response = exceptionUtil.buildErrorResponseXml(wfex)
-
- utils.logAudit(response)
- sendWorkflowResponse(execution, 500, response)
- }else{
- utils.log("DEBUG", "Not Sending Error Response. Sync Response Already Sent", isDebugEnabled)
- }
-
- } catch (Exception ex) {
- utils.log("DEBUG", "Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage(), isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVfModuleInfra sendErrorResponse Process")
-
- }
- utils.log("DEBUG", "*** COMPLETED CreateVfModuleInfra sendErrorResponse Process ***", isDebugEnabled)
- }
-
-
-}
+/*-
+ * ============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=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure.scripts;
+
+import groovy.json.JsonSlurper
+import groovy.json.JsonOutput
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.appc.client.lcm.model.Action
+import org.apache.commons.lang3.*
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
+import org.openecomp.mso.bpmn.common.scripts.NetworkUtils;
+import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils;
+import org.openecomp.mso.bpmn.common.scripts.VidUtils;
+import org.openecomp.mso.bpmn.core.RollbackData
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+
+public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+
+ /**
+ * Validates the request message and sets up the workflow.
+ * @param execution the execution
+ */
+ public void preProcessRequest(DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.preProcessRequest(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ execution.setVariable("CVFMI_sentSyncResponse", false)
+
+ def prefix = 'CVFMI_'
+ logDebug('Entered 1' + method, isDebugLogEnabled)
+ execution.setVariable('prefix', prefix)
+ logDebug('Entered 2' + method, isDebugLogEnabled)
+ execution.setVariable("isVidRequest", "false")
+
+ logDebug("Set variables", isDebugLogEnabled)
+
+ def rollbackData = execution.getVariable("RollbackData")
+ if (rollbackData == null) {
+ rollbackData = new RollbackData()
+ }
+ execution.setVariable("RollbackData", rollbackData)
+
+ logDebug("Set rollback data", isDebugLogEnabled)
+ def incomingRequest = execution.getVariable('bpmnRequest')
+
+ utils.log("DEBUG", "Incoming Infra Request: " + incomingRequest, isDebugLogEnabled)
+ utils.logAudit("CreateVfModule Infra incoming Request: " + incomingRequest)
+
+ setBasicDBAuthHeader(execution, isDebugLogEnabled)
+
+ // check if request is xml or json
+ try {
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+ Map reqMap = jsonSlurper.parseText(incomingRequest)
+ utils.log("DEBUG", " Request is in JSON format.", isDebugLogEnabled)
+
+ def serviceInstanceId = execution.getVariable('serviceInstanceId')
+ def vnfId = execution.getVariable('vnfId')
+
+ execution.setVariable(prefix + 'serviceInstanceId', serviceInstanceId)
+ execution.setVariable(prefix+'vnfId', vnfId)
+ execution.setVariable("isVidRequest", "true")
+
+ def vnfName = ''
+ def asdcServiceModelVersion = ''
+ def serviceModelInfo = null
+ def vnfModelInfo = null
+
+ def relatedInstanceList = reqMap.requestDetails?.relatedInstanceList
+
+ if (relatedInstanceList != null) {
+ relatedInstanceList.each {
+ if (it.relatedInstance.modelInfo?.modelType == 'service') {
+ asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion
+ serviceModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
+
+ }
+ if (it.relatedInstance.modelInfo.modelType == 'vnf') {
+ vnfName = it.relatedInstance.instanceName ?: ''
+ vnfModelInfo = jsonOutput.toJson(it.relatedInstance.modelInfo)
+ }
+ }
+ }
+
+ execution.setVariable(prefix + 'vnfName', vnfName)
+ execution.setVariable(prefix + 'asdcServiceModelVersion', asdcServiceModelVersion)
+ execution.setVariable(prefix + 'serviceModelInfo', serviceModelInfo)
+ execution.setVariable(prefix + 'vnfModelInfo', vnfModelInfo)
+
+
+ def vnfType = execution.getVariable('vnfType')
+ execution.setVariable(prefix + 'vnfType', vnfType)
+ def vfModuleId = execution.getVariable('vfModuleId')
+ execution.setVariable(prefix + 'vfModuleId', vfModuleId)
+ def volumeGroupId = execution.getVariable('volumeGroupId')
+ execution.setVariable(prefix + 'volumeGroupId', volumeGroupId)
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
+
+ Map<String, String> userParamsMap = [:]
+ if (userParams != null) {
+ userParams.each { userParam ->
+ userParamsMap.put(userParam.name, jsonOutput.toJson(userParam.value).toString())
+ }
+ }
+
+ utils.log("DEBUG", 'Processed user params: ' + userParamsMap, isDebugLogEnabled)
+
+ execution.setVariable(prefix + 'vfModuleInputParams', userParamsMap)
+
+ def isBaseVfModule = "false"
+ if (execution.getVariable('isBaseVfModule') == true) {
+ isBaseVfModule = "true"
+ }
+
+ execution.setVariable(prefix + 'isBaseVfModule', isBaseVfModule)
+
+ def requestId = execution.getVariable("mso-request-id")
+ execution.setVariable(prefix + 'requestId', requestId)
+
+ def vfModuleModelInfo = jsonOutput.toJson(reqMap.requestDetails?.modelInfo)
+ execution.setVariable(prefix + 'vfModuleModelInfo', vfModuleModelInfo)
+
+ def suppressRollback = reqMap.requestDetails?.requestInfo?.suppressRollback
+
+
+ def backoutOnFailure = ""
+ if(suppressRollback != null){
+ if ( suppressRollback == true) {
+ backoutOnFailure = "false"
+ } else if ( suppressRollback == false) {
+ backoutOnFailure = "true"
+ }
+ }
+
+ execution.setVariable('disableRollback', suppressRollback)
+
+ def vfModuleName = reqMap.requestDetails?.requestInfo?.instanceName ?: null
+ execution.setVariable(prefix + 'vfModuleName', vfModuleName)
+
+ def serviceId = reqMap.requestDetails?.requestParameters?.serviceId ?: ''
+ execution.setVariable(prefix + 'serviceId', serviceId)
+
+ def usePreload = reqMap.requestDetails?.requestParameters?.usePreload
+ execution.setVariable(prefix + 'usePreload', usePreload)
+
+ // This is aLaCarte flow, so aLaCarte flag is always on
+ execution.setVariable(prefix + 'aLaCarte', true)
+
+ def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration
+ def lcpCloudRegionId = cloudConfiguration.lcpCloudRegionId
+ execution.setVariable(prefix + 'lcpCloudRegionId', lcpCloudRegionId)
+ def tenantId = cloudConfiguration.tenantId
+ execution.setVariable(prefix + 'tenantId', tenantId)
+
+ def globalSubscriberId = reqMap.requestDetails?.subscriberInfo?.globalSubscriberId ?: ''
+ execution.setVariable(prefix + 'globalSubscriberId', globalSubscriberId)
+
+ execution.setVariable(prefix + 'sdncVersion', '1702')
+
+ execution.setVariable("CreateVfModuleInfraSuccessIndicator", false)
+ execution.setVariable("RollbackCompleted", false)
+
+ execution.setVariable("isDebugLogEnabled", isDebugLogEnabled)
+
+
+ def source = reqMap.requestDetails?.requestInfo?.source
+ execution.setVariable("CVFMI_source", source)
+
+ //For Completion Handler & Fallout Handler
+ String requestInfo =
+ """<request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ <request-id>${requestId}</request-id>
+ <action>CREATE</action>
+ <source>${source}</source>
+ </request-info>"""
+
+ execution.setVariable("CVFMI_requestInfo", requestInfo)
+
+ //backoutOnFailure
+
+ execution.setVariable("CVFMI_originalWorkflowException", null)
+
+
+ def newVfModuleId = UUID.randomUUID().toString()
+ execution.setVariable("newVfModuleId", newVfModuleId)
+ execution.setVariable(prefix + 'vfModuleId', newVfModuleId)
+ execution.setVariable('actionHealthCheck', Action.HealthCheck)
+ execution.setVariable('actionConfigScaleOut', Action.ConfigScaleOut)
+ def controllerType = execution.getVariable('controllerType')
+ execution.setVariable(prefix + 'controllerType', controllerType)
+ execution.setVariable('healthCheckIndex0', 0)
+
+ logDebug('RequestInfo: ' + execution.getVariable("CVFMI_requestInfo"), isDebugLogEnabled)
+
+ logDebug('rollbackEnabled: ' + execution.getVariable("CVFMI_rollbackEnabled"), isDebugLogEnabled)
+
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ } catch (BpmnError bpmnError) {
+ throw bpmnError
+ }
+ catch(groovy.json.JsonException je) {
+ utils.log("DEBUG", " Request is not in JSON format.", isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
+ }
+ catch(Exception e) {
+ String restFaultMessage = e.getMessage()
+ //execution.setVariable("CVFMODVOL2_RESTFault", restFaultMessage)
+ //execution.setVariable("CVFMODVOL2_isDataOk", false)
+ utils.log("ERROR", " Exception Encountered - " + "\n" + restFaultMessage, isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, "Internal Error - During PreProcessRequest")
+ }
+
+ }
+
+ /**
+ * Validates a workflow response.
+ * @param execution the execution
+ * @param responseVar the execution variable in which the response is stored
+ * @param responseCodeVar the execution variable in which the response code is stored
+ * @param errorResponseVar the execution variable in which the error response is stored
+ */
+ public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
+ String responseCodeVar, String errorResponseVar) {
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
+ }
+
+
+ /**
+ * Sends the empty, synchronous response back to the API Handler.
+ * @param execution the execution
+ */
+ public void sendResponse(DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.sendResponse(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ try {
+ def requestInfo = execution.getVariable('CVFMI_requestInfo')
+ def requestId = execution.getVariable('CVFMI_requestId')
+ def source = execution.getVariable('CVFMI_source')
+
+ // RESTResponse (for API Handler (APIH) Reply Task)
+ def newVfModuleId = execution.getVariable("newVfModuleId")
+ String synchResponse = """{"requestReferences":{"instanceId":"${newVfModuleId}","requestId":"${requestId}"}}""".trim()
+
+ sendWorkflowResponse(execution, 200, synchResponse)
+
+ execution.setVariable("CVFMI_sentSyncResponse", true)
+ utils.logAudit("CreateVfModule Infra Response: " + synchResponse)
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in ' + method, e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in sendResponse(): ' + e.getMessage())
+ }
+ }
+
+ /**
+ *
+ * @param execution the execution
+ */
+ public void postProcessResponse(DelegateExecution execution){
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+
+ utils.log("DEBUG", " ======== STARTED PostProcessResponse Process ======== ", isDebugEnabled)
+ try{
+ def requestInfo = execution.getVariable("CVFMI_requestInfo")
+ def action = utils.getNodeText1(requestInfo, "action")
+
+ utils.log("DEBUG", "requestInfo is: " + requestInfo, isDebugEnabled)
+ utils.log("DEBUG", "action is: " + action, isDebugEnabled)
+
+ String payload =
+ """ <aetgt:MsoCompletionRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:ns="http://org.openecomp/mso/request/types/v1"
+ xmlns:ns8="http://org.openecomp/mso/workflow/schema/v1">
+ <request-info xmlns="http://org.openecomp/mso/infra/vnf-request/v1">
+ ${requestInfo}
+ </request-info>
+ <ns8:status-message>Vf Module has been created successfully.</ns8:status-message>
+ <ns8:mso-bpel-name>BPMN</ns8:mso-bpel-name>
+ </aetgt:MsoCompletionRequest>"""
+
+ payload = utils.formatXml(payload)
+ execution.setVariable("CVFMI_SuccessFlag", true)
+ execution.setVariable("CVFMI_msoCompletionRequest", payload)
+ utils.logAudit("CreateVfModuleInfra completion request: " + payload)
+ utils.log("DEBUG", "Outgoing MsoCompletionRequest: \n" + payload, isDebugEnabled)
+
+ }catch(Exception e){
+ utils.log("ERROR", "Exception Occured Processing PostProcessResponse. Exception is:\n" + e, isDebugEnabled)
+ execution.setVariable("CVFMI_ErrorResponse", "Error Occured during PostProcessResponse Method:\n" + e.getMessage())
+ }
+ utils.log("DEBUG", "======== COMPLETED PostProcessResponse Process ======== ", isDebugEnabled)
+ }
+
+
+
+
+
+ /**
+ * Validates the request, request id and service instance id. If a problem is found,
+ * a WorkflowException is generated and an MSOWorkflowException event is thrown. This
+ * method also sets up the log context for the workflow.
+ * @param execution the execution
+ * @return the validated request
+ */
+ public String validateInfraRequest(DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.validateInfraRequest(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ String processKey = getProcessKey(execution);
+ def prefix = execution.getVariable("prefix")
+
+ if (prefix == null) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " prefix is null")
+ }
+
+ try {
+ def request = execution.getVariable(prefix + 'Request')
+
+ if (request == null) {
+ request = execution.getVariable(processKey + 'Request')
+
+ if (request == null) {
+ request = execution.getVariable('bpmnRequest')
+ }
+
+ setVariable(execution, processKey + 'Request', null);
+ setVariable(execution, 'bpmnRequest', null);
+ setVariable(execution, prefix + 'Request', request);
+ }
+
+ if (request == null) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request is null")
+ }
+
+ /*
+
+ def requestId = execution.getVariable("mso-request-id")
+
+ if (requestId == null) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request has no mso-request-id")
+ }
+
+ setVariable(execution, prefix + 'requestId', requestId)
+
+ def serviceInstanceId = execution.getVariable("mso-service-instance-id")
+
+ if (serviceInstanceId == null) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, processKey + " request message has no mso-service-instance-id")
+ }
+
+ utils.logContext(requestId, serviceInstanceId)
+ */
+ utils.logAudit("CreateVfModule incoming request: " + request)
+ logDebug('Incoming message: ' + System.lineSeparator() + request, isDebugLogEnabled)
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ return request
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in ' + method, e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Invalid Message")
+ }
+ }
+
+ public void prepareUpdateInfraRequest(DelegateExecution execution){
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+
+ utils.log("DEBUG", " ======== STARTED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
+ try{
+
+
+ String requestInfo = execution.getVariable("CVFMI_requestInfo")
+ def aicCloudRegion = execution.getVariable("CVFMI_lcpCloudRegionId")
+ def tenantId = execution.getVariable("CVFMI_tenantId")
+ def requestId = utils.getNodeText1(requestInfo, "request-id")
+ def vnfId = execution.getVariable("CVFMI_vnfId")
+ def vfModuleId = execution.getVariable("CVFMI_vfModuleId")
+ // vfModuleName may be generated by DoCreateVfModule subprocess if it is not specified on the input
+ def vfModuleName = execution.getVariable("CVFMI_vfModuleName")
+
+ def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+ utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+
+ String payload =
+ """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateInfraRequest xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <requestId>${requestId}</requestId>
+ <lastModifiedBy>BPMN</lastModifiedBy>
+ <statusMessage>VF Module successfully created</statusMessage>
+ <responseBody></responseBody>
+ <requestStatus>COMPLETE</requestStatus>
+ <progress>100</progress>
+ <vnfOutputs>&lt;vnf-outputs xmlns="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:aetgt="http://org.openecomp/mso/infra/vnf-request/v1" xmlns:rest="http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd"&gt;&lt;vnf-id&gt;${vnfId}&lt;/vnf-id&gt;&lt;vf-module-id&gt;${vfModuleId}&lt;/vf-module-id&gt;&lt;/vnf-outputs&gt;</vnfOutputs>
+ <vfModuleId>${vfModuleId}</vfModuleId>
+ <vfModuleName>${vfModuleName}</vfModuleName>
+ </ns:updateInfraRequest>
+ </soapenv:Body>
+ </soapenv:Envelope>"""
+
+ payload = utils.formatXml(payload)
+ execution.setVariable("CVFMI_updateInfraRequest", payload)
+ utils.log("DEBUG", "Outgoing UpdateInfraRequest: \n" + payload, isDebugEnabled)
+ utils.logAudit("CreateVfModuleInfra Outgoing UpdateInfra Request: " + payload)
+
+ }catch(Exception e){
+ utils.log("ERROR", "Exception Occured Processing prepareUpdateInfraRequest. Exception is:\n" + e, isDebugEnabled)
+ execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareUpdateInfraRequest Method:\n" + e.getMessage())
+ }
+ utils.log("DEBUG", "======== COMPLETED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
+ }
+
+ /**
+ * Builds a "FalloutHandler" request and stores it in the specified execution variable.
+ *
+ * @param execution the execution
+ * @param resultVar the execution variable in which the result will be stored
+ */
+ public void falloutHandlerPrep(DelegateExecution execution, String resultVar) {
+ def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +
+ 'execution=' + execution.getId() +
+ ', resultVar=' + resultVar +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+
+ try {
+ def WorkflowException workflowException = execution.getVariable("WorkflowException")
+ def requestInformation = execution.getVariable("CVFMI_requestInfo")
+ def errorResponseCode = workflowException.getErrorCode()
+ def errorResponseMsg = workflowException.getErrorMessage()
+ def encErrorResponseMsg = ""
+ if (errorResponseMsg != null) {
+ encErrorResponseMsg = errorResponseMsg.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
+ }
+
+ String content = """
+ <aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
+ xmlns:reqtype="http://org.openecomp/mso/request/types/v1"
+ xmlns:msoservtypes="http://org.openecomp/mso/request/types/v1"
+ xmlns:structuredtypes="http://org.openecomp/mso/structured/types/v1">
+ ${requestInformation}
+ <aetgt:WorkflowException>
+ <aetgt:ErrorMessage>${encErrorResponseMsg}</aetgt:ErrorMessage>
+ <aetgt:ErrorCode>${errorResponseCode}</aetgt:ErrorCode>
+ </aetgt:WorkflowException>
+ </aetgt:FalloutHandlerRequest>
+ """
+
+ logDebug("CONTENT before translation: " + content, isDebugLogEnabled)
+ content = utils.formatXml(content)
+ logDebug(resultVar + ' = ' + System.lineSeparator() + content, isDebugLogEnabled)
+ utils.logAudit("CreateVfModuleInfra FallOutHander Request: " + content)
+ execution.setVariable(resultVar, content)
+
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in ' + method, e)
+ exceptionUtil.buildWorkflowException(execution, 2000, 'Internal Error')
+ }
+ }
+
+ public void logAndSaveOriginalException(DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ logWorkflowException(execution, 'CreateVfModuleInfra caught an event')
+ saveWorkflowException(execution, 'CVFMI_originalWorkflowException')
+ }
+
+ public void validateRollbackResponse(DelegateExecution execution) {
+ def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ def originalException = execution.getVariable("CVFMI_originalWorkflowException")
+ execution.setVariable("WorkflowException", originalException)
+
+ execution.setVariable("RollbackCompleted", true)
+
+ }
+
+ public void sendErrorResponse(DelegateExecution execution){
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ utils.log("DEBUG", " *** STARTED CreateVfModulenfra sendErrorResponse Process *** ", isDebugEnabled)
+ try {
+ def sentSyncResponse = execution.getVariable("CVFMI_sentSyncResponse")
+ if(sentSyncResponse == false){
+ WorkflowException wfex = execution.getVariable("WorkflowException")
+ String response = exceptionUtil.buildErrorResponseXml(wfex)
+
+ utils.logAudit(response)
+ sendWorkflowResponse(execution, 500, response)
+ }else{
+ utils.log("DEBUG", "Not Sending Error Response. Sync Response Already Sent", isDebugEnabled)
+ }
+
+ } catch (Exception ex) {
+ utils.log("DEBUG", "Error Occured in CreateVfModuleInfra sendErrorResponse Process " + ex.getMessage(), isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in CreateVfModuleInfra sendErrorResponse Process")
+
+ }
+ utils.log("DEBUG", "*** COMPLETED CreateVfModuleInfra sendErrorResponse Process ***", isDebugEnabled)
+ }
+
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
index a49a0664e8..77b0657514 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelVersions.groovy
@@ -149,7 +149,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
"modelUuid":"${modelUuid}",
"modelVersion":""
}"""
- execution.setVariable("serviceModelInfo", serviceModelInfo)
+
execution.setVariable("serviceModelInfo_Target", serviceModelInfo)
utils.log("DEBUG", " ***** Completed prepareDecomposeService_Target of update generic e2e service ***** ", isDebugEnabled)
@@ -187,7 +187,7 @@ public class DoCompareModelVersions extends AbstractServiceTaskProcessor {
"modelUuid":"${modelUuid}",
"modelVersion":""
}"""
- execution.setVariable("serviceModelInfo", serviceModelInfo)
+
execution.setVariable("serviceModelInfo_Original", serviceModelInfo)
utils.log("DEBUG", " ***** Completed prepareDecomposeService_Original of update generic e2e service ***** ", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
index 30db8c53eb..0172402185 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy
@@ -34,6 +34,7 @@ import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
+import org.openecomp.mso.bpmn.common.resource.ResourceRequestBuilder
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.rest.APIResponse;
@@ -84,13 +85,12 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
JsonUtils jsonUtil = new JsonUtils()
public void preProcessRequest (DelegateExecution execution) {
- execution.setVariable("isDebugLogEnabled","true")
def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
String msg = ""
- utils.log("INFO"," ***** Enter CompareModelofE2EServiceInstance preProcessRequest *****", isDebugEnabled)
+ utils.log("INFO"," ***** Enter DoCompareModelofE2EServiceInstance preProcessRequest *****", isDebugEnabled)
execution.setVariable("prefix", Prefix)
//Inputs
@@ -121,14 +121,14 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
- String modelInvariantUuid = execution.getVariable('modelInvariantIdTarget')
+ String modelInvariantUuid = execution.getVariable("modelInvariantIdTarget")
if (isBlank(modelInvariantUuid)){
msg = "Input modelInvariantUuid is null"
utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
- String modelUuid = execution.getVariable('modelVersionIdTarget')
+ String modelUuid = execution.getVariable("modelVersionIdTarget")
if (isBlank(modelUuid)){
msg = "Input modelUuid is null"
utils.log("INFO", msg, isDebugEnabled)
@@ -238,7 +238,7 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce
requestInputs.addAll(resourceParameters.keySet())
}
- for(Resource rc : deletedResourceList) {
+ for(Resource rc : delResourceList) {
mi = rc.getModelInfo()
String resourceCustomizationUuid = mi.getModelCustomizationUuid()
ResourceModelInfo rmodel = new ResourceModelInfo()
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 4ad58fb669..267673d9fd 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
@@ -137,8 +137,8 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
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")
+ String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
+ String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
execution.setVariable("serviceModelName", serviceModelName)
//aai serviceType and Role can be setted as fixed value now.
@@ -189,7 +189,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try {
- utils.log("DEBUG", " ***** Inside prepareDecomposeService of create generic e2e service ***** ", isDebugEnabled)
+ utils.log("INFO", " ***** Inside prepareDecomposeService of create generic e2e service ***** ", isDebugEnabled)
String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
String modelUuid = execution.getVariable("modelUuid")
//here modelVersion is not set, we use modelUuid to decompose the service.
@@ -211,12 +211,12 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
public void processDecomposition(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ***** Inside processDecomposition() of create generic e2e service flow ***** ", isDebugEnabled)
+ utils.log("INFO", " ***** Inside processDecomposition() of create generic e2e service flow ***** ", isDebugEnabled)
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
} catch (Exception ex) {
String exceptionMessage = "Bpmn error encountered in create generic e2e service flow. processDecomposition() - " + ex.getMessage()
- utils.log("DEBUG", exceptionMessage, isDebugEnabled)
+ utils.log("INFO", exceptionMessage, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -396,7 +396,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
try{
String serviceId = execution.getVariable("serviceInstanceId")
- String operationId = execution.getVariable("operationId")
+ String operationId = execution.getVariable("msoRequestId")
String operationType = execution.getVariable("operationType")
String resourceTemplateUUIDs = ""
String result = "processing"
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
index a53540ac89..5dd33c9181 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -137,6 +137,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
def currentIndex = execution.getVariable("currentResourceIndex")
List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
+ execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
utils.log("INFO", "Now we deal with resouce:" + currentResource.getModelInfo().getModelName(), isDebugEnabled)
utils.log("INFO", "======== COMPLETED getCurrentResoure Process ======== ", isDebugEnabled)
}
@@ -161,6 +162,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
utils.log("INFO", "======== Start prepareResourceRecipeRequest Process ======== ", isDebugEnabled)
ResourceInput resourceInput = new ResourceInput()
String serviceInstanceName = execution.getVariable("serviceInstanceName")
+ String resourceType = execution.getVariable("resourceType")
String resourceInstanceName = resourceType + "_" + serviceInstanceName
resourceInput.setResourceInstanceName(resourceInstanceName)
utils.log("INFO", "Prepare Resource Request resourceInstanceName:" + resourceInstanceName, isDebugEnabled)
@@ -180,11 +182,12 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
resourceInput.setResourceModelInfo(currentResource.getModelInfo());
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
resourceInput.setServiceModelInfo(serviceDecomposition.getModelInfo());
+ def String resourceCustomizationUuid = currentResource.getModelInfo().getModelCustomizationUuid();
String incomingRequest = execution.getVariable("uuiRequest")
//set the requestInputs from tempalte To Be Done
- String serviceModelUuid = execution.getVariable("modelUuid")
- String serviceParameters = jsonUtil.getJsonValue(incomingRequest, "service.parameters")
+ String serviceModelUuid = jsonUtil.getJsonValue(incomingRequest,"service.serviceUuid")
+ String serviceParameters = jsonUtil.getJsonValue(incomingRequest, "service.parameters")
String resourceParameters = ResourceRequestBuilder.buildResourceRequestParameters(execution, serviceModelUuid, resourceCustomizationUuid, serviceParameters)
resourceInput.setResourceParameters(resourceParameters)
execution.setVariable("resourceInput", resourceInput)
@@ -201,10 +204,10 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
String requestAction = resourceInput.getOperationType()
JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceInput.getResourceModelInfo().getModelUuid(), requestAction)
String recipeUri = resourceRecipe.getString("orchestrationUri")
- String recipeTimeOut = resourceRecipe.getString("recipeTimeout")
+ int recipeTimeOut = resourceRecipe.getInt("recipeTimeout")
String recipeParamXsd = resourceRecipe.get("paramXSD")
HttpResponse resp = BpmnRestClient.post(recipeUri, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput.toString(), recipeParamXsd)
-
+ utils.log("INFO", "======== end executeResourceRecipe Process ======== ", isDebugEnabled)
}
public void postConfigRequest(DelegateExecution execution){
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
index f4483f5923..417bb4668e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
@@ -28,6 +28,7 @@ import java.io.IOException;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection;
import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiResponse;
import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.CheckAaiForCorrelationIdImplementation;
@@ -58,21 +59,16 @@ public class CheckAaiForCorrelationIdDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
String correlationId = (String) execution.getVariable(CORRELATION_ID);
if (correlationId == null) {
- //todo: fix Execution -> DelegateExecution in ALL groovy scripts
-// new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, CORRELATION_ID + " is not set");
- throw new BpmnError("MSOWorkflowException");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, CORRELATION_ID + " is not set");
}
try {
AaiResponse aaiResponse = implementation.check(correlationId, aaiConnection);
execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, aaiResponse.getContainsInfoAboutPnf());
- aaiResponse.getContainsInfoAboutIp().ifPresent(
- isIp -> execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, isIp)
- );
+ execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, aaiResponse.getContainsInfoAboutIp());
} catch (IOException e) {
- //todo: log this
- throw new BpmnError("MSOWorkflowException");
+ new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage());
}
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
index 6b49908a0f..0d64f2c8b7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java
@@ -23,6 +23,9 @@ package org.openecomp.mso.bpmn.infrastructure.pnf.delegate;
@SuppressWarnings("ALL")
public class ExecutionVariableNames {
+ private ExecutionVariableNames() {
+ }
+
public final static String CORRELATION_ID = "correlationId";
public final static String AAI_CONTAINS_INFO_ABOUT_PNF = "aaiContainsInfoAboutPnf";
public final static String AAI_CONTAINS_INFO_ABOUT_IP = "aaiContainsInfoAboutIp";
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java
index bbb7adc143..5fb7a43e00 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java
@@ -24,28 +24,25 @@ import java.util.Optional;
import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
-public class AaiResponse {
+public enum AaiResponse {
+ NO_ENTRY(false, false),
+ ENTRY_NO_IP(true, false),
+ ENTRY_WITH_IP(true, true);
- private Boolean containsInfoAboutPnf;
- private Boolean containsInfoAboutIp;
- private String ipAddress;
+ private boolean containsInfoAboutPnf;
+ private boolean containsInfoAboutIp;
- public AaiResponse(@NotNull Boolean containsInfoAboutPnf, @Nullable Boolean containsInfoAboutIp,
- @Nullable String ipAddress) {
+ AaiResponse(boolean containsInfoAboutPnf, boolean containsInfoAboutIp) {
this.containsInfoAboutPnf = containsInfoAboutPnf;
this.containsInfoAboutIp = containsInfoAboutIp;
- this.ipAddress = ipAddress;
}
- public Boolean getContainsInfoAboutPnf() {
+ public boolean getContainsInfoAboutPnf() {
return containsInfoAboutPnf;
}
- public Optional<Boolean> getContainsInfoAboutIp() {
- return Optional.ofNullable(containsInfoAboutIp);
+ public boolean getContainsInfoAboutIp() {
+ return containsInfoAboutIp;
}
- public Optional<String> getIpAddress() {
- return Optional.ofNullable(ipAddress);
- }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
index 353a3bd5d3..b982a693da 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java
@@ -29,15 +29,14 @@ public class CheckAaiForCorrelationIdImplementation {
public AaiResponse check(String correlationId, AaiConnection aaiConnection) throws IOException {
Optional<Pnf> pnf = aaiConnection.getEntryFor(correlationId);
if (!pnf.isPresent()) {
- return new AaiResponse(false, null, null);
+ return AaiResponse.NO_ENTRY;
}
- Optional<String> ip = extractIp(pnf.get());
- return ip.map(
- s -> new AaiResponse(true, true, s)
- ).orElseGet(
- () -> new AaiResponse(true, false, null)
- );
+ if(extractIp(pnf.get()).isPresent()) {
+ return AaiResponse.ENTRY_WITH_IP;
+ } else {
+ return AaiResponse.ENTRY_NO_IP;
+ }
}
private Optional<String> extractIp(Pnf pnf) {
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CompareModelofE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CompareModelofE2EServiceInstance.bpmn
index 074b48a62c..7aecd23cb2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CompareModelofE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CompareModelofE2EServiceInstance.bpmn
@@ -30,11 +30,11 @@ ex.processJavaException(execution)]]></bpmn:script>
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
<camunda:in source="serviceInstanceName" target="serviceInstanceName" />
<camunda:in source="productFamilyId" target="productFamilyId" />
- <camunda:in source="disableRollback" target="disableRollback" />
+ <camunda:in source="modelInvariantIdTarget" target="modelInvariantIdTarget" />
<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:out source="compareModelsResult" target="compareModelsResult" />
+ <camunda:in source="modelVersionIdTarget" target="modelVersionIdTarget" />
<camunda:in source="globalSubscriberId" target="globalSubscriberId" />
<camunda:in source="serviceType" target="serviceType" />
<camunda:in source="initialStatus" target="initialStatus" />
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
index 99244c54d2..c0637a3e1a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
@@ -22,7 +22,7 @@ ex.processJavaException(execution)]]></bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_1dsbjjb" name="" sourceRef="StartEvent_0v1ffn4" targetRef="ScriptTask_0u3lw39" />
<bpmn:sequenceFlow id="SequenceFlow_1yay321" name="" sourceRef="ScriptTask_0u3lw39" targetRef="EndEvent_0eznq6x" />
</bpmn:subProcess>
- <bpmn:callActivity id="DoCreateE2EServiceInstance" name="Call DoCreateE2EServiceInstance&#10;" calledElement="DoCreateE2EServiceInstance">
+ <bpmn:callActivity id="DoCreateE2EServiceInstance" name="Call DoCreateE2EServiceInstance&#10;" calledElement="DoCreateE2EServiceInstanceV3">
<bpmn:extensionElements>
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:in source="msoRequestId" target="msoRequestId" />
@@ -41,6 +41,8 @@ ex.processJavaException(execution)]]></bpmn:script>
<camunda:in sourceExpression="1610" target="sdncVersion" />
<camunda:in source="initialStatus" target="initialStatus" />
<camunda:in source="serviceType" target="serviceType" />
+ <camunda:in source="uuiRequest" target="uuiRequest" />
+ <camunda:in source="requestAction" target="operationType" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVfModuleInfra.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVfModuleInfra.bpmn
index 0abbdd1c6d..70cfa7dfcf 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVfModuleInfra.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVfModuleInfra.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_pNTO8MRhEeWv36YLr7PC3Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_pNTO8MRhEeWv36YLr7PC3Q" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="CreateVfModuleInfra" name="CreateVfModuleInfra" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1" name="Start">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
@@ -39,17 +39,16 @@
<camunda:in source="CVFMI_vfModuleInputParams" target="vfModuleInputParams" />
<camunda:in source="CVFMI_aLaCarte" target="aLaCarte" />
</bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1vx081s</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:scriptTask id="SendResponse" name="Send Response" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def createVfModule = new CreateVfModuleInfra()
+ <bpmn2:outgoing>SequenceFlow_0e2ta6w</bpmn2:outgoing>
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def createVfModule = new CreateVfModuleInfra()
createVfModule.sendResponse(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:sequenceFlow id="SequenceFlow_7" name="" sourceRef="SendResponse" targetRef="DoCreateVfModuleSubprocess" />
<bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1" name="To FinishLine">
<bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
<bpmn2:linkEventDefinition id="_LinkEventDefinition_34" name="FinishLine" />
@@ -63,8 +62,8 @@ createVfModule.sendResponse(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="PrepareUpdateInfraRequest" name="Prepare Update Infra Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def createVfModule = new CreateVfModuleInfra()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def createVfModule = new CreateVfModuleInfra()
createVfModule.prepareUpdateInfraRequest(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:serviceTask id="ServiceTask_1" name="Update Infra Request">
@@ -87,15 +86,14 @@ createVfModule.prepareUpdateInfraRequest(execution)]]></bpmn2:script>
</camunda:connector>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_1crl7uf</bpmn2:outgoing>
</bpmn2:serviceTask>
<bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="PrepareUpdateInfraRequest" targetRef="ServiceTask_1" />
- <bpmn2:sequenceFlow id="SequenceFlow_8" name="" sourceRef="ServiceTask_1" targetRef="UpdateInfraRequestResponseCheck" />
<bpmn2:scriptTask id="PrepareMSOCompletionHandler" name="Prepare MSO Completion Handler" scriptFormat="groovy">
- <bpmn2:incoming>updateInfraRequestResponseGood</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_0td7d9m</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def createVfModule = new CreateVfModuleInfra()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def createVfModule = new CreateVfModuleInfra()
createVfModule.postProcessResponse(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_12" name="" sourceRef="PrepareMSOCompletionHandler" targetRef="MSOCompletionHandler" />
@@ -112,12 +110,12 @@ createVfModule.postProcessResponse(execution)]]></bpmn2:script>
<bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:exclusiveGateway id="UpdateInfraRequestResponseCheck" name="Success? " default="updateInfraRequestResponseBad">
- <bpmn2:incoming>SequenceFlow_8</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1crl7uf</bpmn2:incoming>
<bpmn2:outgoing>updateInfraRequestResponseBad</bpmn2:outgoing>
<bpmn2:outgoing>updateInfraRequestResponseGood</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:sequenceFlow id="updateInfraRequestResponseBad" name="no" sourceRef="UpdateInfraRequestResponseCheck" targetRef="EndEvent_2" />
- <bpmn2:sequenceFlow id="updateInfraRequestResponseGood" name="yes" sourceRef="UpdateInfraRequestResponseCheck" targetRef="PrepareMSOCompletionHandler">
+ <bpmn2:sequenceFlow id="updateInfraRequestResponseGood" name="yes" sourceRef="UpdateInfraRequestResponseCheck" targetRef="CallActivity_17ukiqm">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CVFMI_dbResponseCode" ) == '200'}]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:endEvent id="EndEvent_2">
@@ -147,8 +145,8 @@ createVfModule.postProcessResponse(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="PrepareFalloutHandler" name="Prepare Fallout Handler" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_018p5wf</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_10</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def cvfm = new CreateVfModuleInfra()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def cvfm = new CreateVfModuleInfra()
cvfm.falloutHandlerPrep(execution, 'CVFMI_FalloutHandlerRequest')]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_10" name="" sourceRef="PrepareFalloutHandler" targetRef="FalloutHandler" />
@@ -157,8 +155,8 @@ cvfm.falloutHandlerPrep(execution, 'CVFMI_FalloutHandlerRequest')]]></bpmn2:scri
<bpmn2:scriptTask id="SendErrorResponse" name="Send Error Response" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0wsgnab</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_018p5wf</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def createVfModule = new CreateVfModuleInfra()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def createVfModule = new CreateVfModuleInfra()
createVfModule.sendErrorResponse(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
</bpmn2:subProcess>
@@ -185,8 +183,8 @@ createVfModule.sendErrorResponse(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="PreProcessRequest" name="Pre-Process Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def createVfModule = new CreateVfModuleInfra()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def createVfModule = new CreateVfModuleInfra()
createVfModule.preProcessRequest(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="PreProcessRequest" targetRef="SendResponse" />
@@ -194,8 +192,8 @@ createVfModule.preProcessRequest(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ProcessError" name="Process Error" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1qvgrvq</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1jqizzo</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.common.scripts.*
-ExceptionUtil exceptionUtil = new ExceptionUtil()
+ <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.common.scripts.*
+ExceptionUtil exceptionUtil = new ExceptionUtil()
exceptionUtil.processJavaException(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:endEvent id="EndEvent_0100eju">
@@ -208,6 +206,71 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_1qvgrvq" name="" sourceRef="StartEvent_1mov8he" targetRef="ProcessError" />
<bpmn2:sequenceFlow id="SequenceFlow_1jqizzo" name="" sourceRef="ProcessError" targetRef="EndEvent_0100eju" />
</bpmn2:subProcess>
+ <bpmn2:callActivity id="CallActivity_0i3men0" name="APP-C Healthcheck" calledElement="AppCClient">
+ <bpmn2:extensionElements>
+ <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+ <camunda:in source="actionHealthCheck" target="action" />
+ <camunda:in source="CVFMI_vnfId" target="vnfId" />
+ <camunda:in source="CVFMI_requestId" target="msoRequestId" />
+ <camunda:in source="CVFMI_vnfName" target="vnfName" />
+ <camunda:in source="CVFMO_controllerType" target="controllerType" />
+ <camunda:in source="healthCheckIndex0" target="healthCheckIndex" />
+ <camunda:out source="errorCode" target="errorCode" />
+ <camunda:out source="errorText" target="errorText" />
+ <camunda:out source="workStep" target="workStep" />
+ <camunda:out source="failedActivity" target="failedActivity" />
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>SequenceFlow_0e2ta6w</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_07llpjo</bpmn2:outgoing>
+ </bpmn2:callActivity>
+ <bpmn2:sequenceFlow id="SequenceFlow_0e2ta6w" sourceRef="SendResponse" targetRef="CallActivity_0i3men0" />
+ <bpmn2:exclusiveGateway id="ExclusiveGateway_09h60ub" name="Error on Pre Health Check?" default="SequenceFlow_1vx081s">
+ <bpmn2:incoming>SequenceFlow_07llpjo</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_1vx081s</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_0nszq2o</bpmn2:outgoing>
+ </bpmn2:exclusiveGateway>
+ <bpmn2:sequenceFlow id="SequenceFlow_1vx081s" name="no" sourceRef="ExclusiveGateway_09h60ub" targetRef="DoCreateVfModuleSubprocess" />
+ <bpmn2:sequenceFlow id="SequenceFlow_07llpjo" sourceRef="CallActivity_0i3men0" targetRef="ExclusiveGateway_09h60ub" />
+ <bpmn2:endEvent id="EndEvent_0n6bb71">
+ <bpmn2:incoming>SequenceFlow_0nszq2o</bpmn2:incoming>
+ <bpmn2:errorEventDefinition errorRef="Error_1" />
+ </bpmn2:endEvent>
+ <bpmn2:sequenceFlow id="SequenceFlow_0nszq2o" name="yes" sourceRef="ExclusiveGateway_09h60ub" targetRef="EndEvent_0n6bb71">
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("errorCode") != "0"]]></bpmn2:conditionExpression>
+ </bpmn2:sequenceFlow>
+ <bpmn2:callActivity id="CallActivity_17ukiqm" name="APP-C ConfigScaleOut" calledElement="AppCClient">
+ <bpmn2:extensionElements>
+ <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+ <camunda:in source="actionConfigScaleOut" target="action" />
+ <camunda:in source="CVFMI_vnfId" target="vnfId" />
+ <camunda:in source="CVFMI_requestId" target="msoRequestId" />
+ <camunda:in source="CVFMI_vnfName" target="vnfName" />
+ <camunda:in source="CVFMO_controllerType" target="controllerType" />
+ <camunda:in source="healthCheckIndex0" target="healthCheckIndex" />
+ <camunda:out source="errorCode" target="errorConfigScaleOutCode" />
+ <camunda:out source="errorText" target="errorText" />
+ <camunda:out source="workStep" target="workStep" />
+ <camunda:out source="failedActivity" target="failedActivity" />
+ <camunda:in source="CVFMI_vfModuleId" target="vfModuleId" />
+ </bpmn2:extensionElements>
+ <bpmn2:incoming>updateInfraRequestResponseGood</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_1tk5ru7</bpmn2:outgoing>
+ </bpmn2:callActivity>
+ <bpmn2:sequenceFlow id="SequenceFlow_1crl7uf" sourceRef="ServiceTask_1" targetRef="UpdateInfraRequestResponseCheck" />
+ <bpmn2:exclusiveGateway id="ExclusiveGateway_1hncvjy" name="Error on ConfigScaleOut?" default="SequenceFlow_0td7d9m">
+ <bpmn2:incoming>SequenceFlow_1tk5ru7</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_0td7d9m</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_0h5cld9</bpmn2:outgoing>
+ </bpmn2:exclusiveGateway>
+ <bpmn2:sequenceFlow id="SequenceFlow_1tk5ru7" sourceRef="CallActivity_17ukiqm" targetRef="ExclusiveGateway_1hncvjy" />
+ <bpmn2:sequenceFlow id="SequenceFlow_0td7d9m" name="no" sourceRef="ExclusiveGateway_1hncvjy" targetRef="PrepareMSOCompletionHandler" />
+ <bpmn2:endEvent id="EndEvent_0a97jcr">
+ <bpmn2:incoming>SequenceFlow_0h5cld9</bpmn2:incoming>
+ <bpmn2:errorEventDefinition errorRef="Error_1" />
+ </bpmn2:endEvent>
+ <bpmn2:sequenceFlow id="SequenceFlow_0h5cld9" name="yes" sourceRef="ExclusiveGateway_1hncvjy" targetRef="EndEvent_0a97jcr">
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="groovy"><![CDATA[execution.getVariable("errorConfigScaleOutCode") != "0"]]></bpmn2:conditionExpression>
+ </bpmn2:sequenceFlow>
</bpmn2:process>
<bpmn2:error id="Error_1" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_2" name="REST Fault" errorCode="RESTFault" />
@@ -218,40 +281,41 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_50" targetElement="_BPMNShape_ScriptTask_124">
<di:waypoint xsi:type="dc:Point" x="77" y="249" />
- <di:waypoint xsi:type="dc:Point" x="226" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="142" y="249" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="99" y="249" width="6" height="6" />
+ <dc:Bounds x="110" y="234" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_124" bpmnElement="PreProcessRequest">
- <dc:Bounds x="226" y="209" width="100" height="80" />
+ <dc:Bounds x="142" y="209" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ServiceTask_86" bpmnElement="SendResponse">
- <dc:Bounds x="432" y="209" width="100" height="80" />
+ <dc:Bounds x="309" y="209" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="_BPMNShape_ScriptTask_124" targetElement="_BPMNShape_ServiceTask_86">
- <di:waypoint xsi:type="dc:Point" x="326" y="249" />
- <di:waypoint xsi:type="dc:Point" x="432" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="242" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="309" y="249" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="348" y="249" width="6" height="6" />
+ <dc:Bounds x="276" y="234" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_178" bpmnElement="DoCreateVfModuleSubprocess">
- <dc:Bounds x="612" y="209" width="145" height="80" />
+ <dc:Bounds x="816" y="209" width="145" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="_BPMNShape_ServiceTask_86" targetElement="_BPMNShape_ScriptTask_178">
- <di:waypoint xsi:type="dc:Point" x="532" y="249" />
- <di:waypoint xsi:type="dc:Point" x="612" y="249" />
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_IntermediateThrowEvent_47" bpmnElement="IntermediateThrowEvent_1">
- <dc:Bounds x="823" y="231" width="36" height="36" />
+ <dc:Bounds x="1031" y="231" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="841" y="272" width="0" height="0" />
+ <dc:Bounds x="1016" y="272" width="65" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ScriptTask_178" targetElement="_BPMNShape_IntermediateThrowEvent_47">
- <di:waypoint xsi:type="dc:Point" x="756" y="249" />
- <di:waypoint xsi:type="dc:Point" x="823" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="961" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="995" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="995" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="1031" y="249" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1010" y="249" width="0" height="0" />
+ </bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_32" bpmnElement="IntermediateCatchEvent_1">
<dc:Bounds x="39" y="349" width="36" height="36" />
@@ -266,27 +330,27 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
<dc:Bounds x="277" y="327" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_179" bpmnElement="UpdateInfraRequestResponseCheck" isMarkerVisible="true">
- <dc:Bounds x="443" y="341" width="50" height="50" />
+ <dc:Bounds x="406" y="342" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="435" y="308" width="68" height="22" />
+ <dc:Bounds x="407" y="309" width="49" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_220" bpmnElement="PrepareMSOCompletionHandler">
- <dc:Bounds x="552" y="327" width="100" height="80" />
+ <dc:Bounds x="810" y="327" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_221" bpmnElement="MSOCompletionHandler">
- <dc:Bounds x="708" y="327" width="100" height="80" />
+ <dc:Bounds x="948" y="327" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_177" bpmnElement="EndEvent_1">
- <dc:Bounds x="1020" y="349" width="36" height="36" />
+ <dc:Bounds x="1237" y="349" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1038" y="390" width="0" height="0" />
+ <dc:Bounds x="1210" y="390" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_EndEvent_178" bpmnElement="EndEvent_2">
- <dc:Bounds x="452" y="469" width="36" height="36" />
+ <dc:Bounds x="413" y="454" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="470" y="510" width="0" height="0" />
+ <dc:Bounds x="386" y="495" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_IntermediateCatchEvent_32" targetElement="_BPMNShape_ScriptTask_219">
@@ -300,38 +364,25 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
<di:waypoint xsi:type="dc:Point" x="227" y="367" />
<di:waypoint xsi:type="dc:Point" x="277" y="367" />
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ServiceTask_103" targetElement="_BPMNShape_ExclusiveGateway_179">
- <di:waypoint xsi:type="dc:Point" x="377" y="367" />
- <di:waypoint xsi:type="dc:Point" x="410" y="367" />
- <di:waypoint xsi:type="dc:Point" x="410" y="366" />
- <di:waypoint xsi:type="dc:Point" x="443" y="366" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="407" y="366" width="6" height="6" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="updateInfraRequestResponseBad" sourceElement="_BPMNShape_ExclusiveGateway_179" targetElement="_BPMNShape_EndEvent_178">
- <di:waypoint xsi:type="dc:Point" x="468" y="391" />
- <di:waypoint xsi:type="dc:Point" x="469" y="421" />
- <di:waypoint xsi:type="dc:Point" x="470" y="421" />
- <di:waypoint xsi:type="dc:Point" x="470" y="469" />
+ <di:waypoint xsi:type="dc:Point" x="430" y="391" />
+ <di:waypoint xsi:type="dc:Point" x="431" y="454" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="459" y="419" width="20" height="22" />
+ <dc:Bounds x="423.56413838294776" y="426.8392769104355" width="12" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="updateInfraRequestResponseGood" sourceElement="_BPMNShape_ExclusiveGateway_179" targetElement="_BPMNShape_ScriptTask_220">
- <di:waypoint xsi:type="dc:Point" x="493" y="366" />
- <di:waypoint xsi:type="dc:Point" x="523" y="366" />
- <di:waypoint xsi:type="dc:Point" x="523" y="367" />
- <di:waypoint xsi:type="dc:Point" x="552" y="367" />
+ <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="updateInfraRequestResponseGood" sourceElement="_BPMNShape_ExclusiveGateway_179" targetElement="CallActivity_17ukiqm_di">
+ <di:waypoint xsi:type="dc:Point" x="456" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="525" y="367" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="510" y="367" width="27" height="22" />
+ <dc:Bounds x="482.10526315789474" y="367.00000000000006" width="18" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_ScriptTask_220" targetElement="_BPMNShape_ScriptTask_221">
- <di:waypoint xsi:type="dc:Point" x="652" y="367" />
- <di:waypoint xsi:type="dc:Point" x="708" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="910" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="948" y="367" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="678" y="367" width="6" height="6" />
+ <dc:Bounds x="884" y="349" width="90" height="6" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_SubProcess_20" bpmnElement="ErrorHandler" isExpanded="true">
@@ -389,15 +440,21 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_241" bpmnElement="SetSuccessIndicator">
- <dc:Bounds x="858" y="328" width="103" height="79" />
+ <dc:Bounds x="1105" y="327" width="103" height="79" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_221" targetElement="_BPMNShape_ScriptTask_241">
- <di:waypoint xsi:type="dc:Point" x="808" y="367" />
- <di:waypoint xsi:type="dc:Point" x="858" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="1048" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="1105" y="366" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1031.5" y="341.5" width="90" height="20" />
+ </bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ScriptTask_241" targetElement="_BPMNShape_EndEvent_177">
- <di:waypoint xsi:type="dc:Point" x="960" y="367" />
- <di:waypoint xsi:type="dc:Point" x="1020" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="1208" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="1237" y="367" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1177.5" y="342" width="90" height="20" />
+ </bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_0pgv3l6_di" bpmnElement="SubProcess_0pgv3l6" isExpanded="true">
<dc:Bounds x="160" y="1001" width="313" height="169" />
@@ -450,6 +507,98 @@ exceptionUtil.processJavaException(execution)]]></bpmn2:script>
<bpmndi:BPMNShape id="ScriptTask_036ipyg_di" bpmnElement="SendErrorResponse">
<dc:Bounds x="296" y="698" width="100" height="80" />
</bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="CallActivity_0i3men0_di" bpmnElement="CallActivity_0i3men0">
+ <dc:Bounds x="478" y="209" width="145" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0e2ta6w_di" bpmnElement="SequenceFlow_0e2ta6w">
+ <di:waypoint xsi:type="dc:Point" x="409" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="478" y="249" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="444" y="224" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_09h60ub_di" bpmnElement="ExclusiveGateway_09h60ub" isMarkerVisible="true">
+ <dc:Bounds x="690.4550758459743" y="224.00350058343057" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="679" y="274.00350058343054" width="73" height="25" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1vx081s_di" bpmnElement="SequenceFlow_1vx081s">
+ <di:waypoint xsi:type="dc:Point" x="740" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="775" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="775" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="816" y="249" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="784" y="249" width="12" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_07llpjo_di" bpmnElement="SequenceFlow_07llpjo">
+ <di:waypoint xsi:type="dc:Point" x="623" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="653" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="653" y="249" />
+ <di:waypoint xsi:type="dc:Point" x="690" y="249" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="668" y="249" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0n6bb71_di" bpmnElement="EndEvent_0n6bb71">
+ <dc:Bounds x="697" y="118" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="715" y="159" width="0" height="0" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0nszq2o_di" bpmnElement="SequenceFlow_0nszq2o">
+ <di:waypoint xsi:type="dc:Point" x="715" y="224" />
+ <di:waypoint xsi:type="dc:Point" x="715" y="154" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="721" y="179" width="17" height="13" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_17ukiqm_di" bpmnElement="CallActivity_17ukiqm">
+ <dc:Bounds x="525" y="327" width="145" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1crl7uf_di" bpmnElement="SequenceFlow_1crl7uf">
+ <di:waypoint xsi:type="dc:Point" x="377" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="406" y="367" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="391.5" y="346" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1hncvjy_di" bpmnElement="ExclusiveGateway_1hncvjy" isMarkerVisible="true">
+ <dc:Bounds x="712" y="342" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="696" y="308" width="82" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1tk5ru7_di" bpmnElement="SequenceFlow_1tk5ru7">
+ <di:waypoint xsi:type="dc:Point" x="670" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="712" y="367" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="691" y="346" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0td7d9m_di" bpmnElement="SequenceFlow_0td7d9m">
+ <di:waypoint xsi:type="dc:Point" x="762" y="367" />
+ <di:waypoint xsi:type="dc:Point" x="810" y="367" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="780" y="346" width="12" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="EndEvent_0a97jcr_di" bpmnElement="EndEvent_0a97jcr">
+ <dc:Bounds x="719" y="454" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="692" y="495" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0h5cld9_di" bpmnElement="SequenceFlow_0h5cld9">
+ <di:waypoint xsi:type="dc:Point" x="737" y="392" />
+ <di:waypoint xsi:type="dc:Point" x="737" y="423" />
+ <di:waypoint xsi:type="dc:Point" x="737" y="423" />
+ <di:waypoint xsi:type="dc:Point" x="737" y="454" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="743" y="417" width="18" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelVersions.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelVersions.bpmn
index 4779b0acde..3833e646c5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelVersions.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelVersions.bpmn
@@ -50,7 +50,7 @@ dcsi.processDecomposition_Target(execution)]]></bpmn2:script>
<bpmn2:extensionElements>
<camunda:in source="msoRequestId" target="msoRequestId" />
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
- <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
+ <camunda:in source="serviceModelInfo_Target" target="serviceModelInfo" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
<camunda:out source="serviceDecomposition" target="serviceDecomposition" />
<camunda:out source="WorkflowException" target="WorkflowException" />
@@ -88,7 +88,7 @@ dcsi.processDecomposition_Original(execution)]]></bpmn2:script>
<bpmn2:extensionElements>
<camunda:in source="msoRequestId" target="msoRequestId" />
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
- <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
+ <camunda:in source="serviceModelInfo_Original" target="serviceModelInfo" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
<camunda:out source="serviceDecomposition" target="serviceDecomposition" />
<camunda:out source="WorkflowException" target="WorkflowException" />
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelofE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelofE2EServiceInstance.bpmn
index f5a87b0c3e..df9ef116e4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelofE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCompareModelofE2EServiceInstance.bpmn
@@ -40,10 +40,16 @@ ex.processJavaException(execution)]]></bpmn2:script>
<bpmn2:extensionElements>
<camunda:in source="msoRequestId" target="msoRequestId" />
<camunda:in source="serviceInstanceId" target="serviceInstanceId" />
- <camunda:in source="serviceModelInfo" target="serviceModelInfo" />
<camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
- <camunda:out source="serviceDecomposition" target="serviceDecomposition" />
+ <camunda:out source="serviceDecomposition_Target" target="serviceDecomposition_Target" />
<camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:in source="model-invariant-id-target" target="model-invariant-id-target" />
+ <camunda:in source="model-version-id-target" target="model-version-id-target" />
+ <camunda:in source="model-invariant-id-original" target="model-invariant-id-original" />
+ <camunda:in source="model-version-id-original" target="model-version-id-original" />
+ <camunda:out source="addResourceList" target="addResourceList" />
+ <camunda:out source="delResourceList" target="delResourceList" />
+ <camunda:out source="serviceDecomposition_Original" target="serviceDecomposition_Original" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_1rebkae</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1pe6r93</bpmn2:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
index d6dbf58594..8fe6b70d1a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
@@ -22,6 +22,7 @@ dcsi.preProcessRequest(execution)
<camunda:out source="GENGS_SuccessIndicator" target="GENGS_SuccessIndicator" />
<camunda:out source="WorkflowException" target="WorkflowException" />
<camunda:in source="serviceType" target="GENGS_serviceType" />
+ <camunda:in source="serviceInstanceId" target="GENGS_serviceInstanceId" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_1i7t9hq</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
@@ -193,18 +194,23 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
def dcsi= new DoCreateE2EServiceInstance()
dcsi.doServiceHoming(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:callActivity id="CallActivity_1ojtwas" name="Call DoCreateResources" calledElement="DoCreateResources">
+ <bpmn2:callActivity id="CallActivity_1ojtwas" name="Call DoCreateResources" calledElement="DoCreateResourcesV3">
<bpmn2:extensionElements>
<camunda:in source="nsServiceName" target="nsServiceName" />
<camunda:in source="nsServiceDescription" target="nsServiceDescription" />
<camunda:in source="globalSubscriberId" target="globalSubscriberId" />
<camunda:in source="serviceType" target="serviceType" />
- <camunda:in source="serviceId" target="serviceId" />
+ <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
<camunda:in source="operationId" target="operationId" />
<camunda:in source="resourceType" target="resourceType" />
<camunda:in source="resourceUUID" target="resourceUUID" />
<camunda:in source="resourceParameters" target="resourceParameters" />
<camunda:in source="operationType" target="operationType" />
+ <camunda:in source="addResourceList" target="addResourceList" />
+ <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
+ <camunda:in source="serviceDecomposition" target="serviceDecomposition" />
+ <camunda:in source="uuiRequest" target="uuiRequest" />
+ <camunda:in source="msoRequestId" target="msoRequestId" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0bf6bzp</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0d0c20n</bpmn2:outgoing>
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
index 2ad563af96..9ed1431ed8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
+++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateResourcesV3" name="DoCreateResourcesV3" isExecutable="true">
<bpmn2:startEvent id="createSI_startEvent" name="Start Flow">
<bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing>
@@ -67,7 +67,7 @@ ddsi.getCurrentResoure(execution)]]></bpmn2:script>
def ddsi = new DoCreateResources()
ddsi.prepareResourceRecipeRequest(execution)]]></bpmn2:script>
</bpmn2:scriptTask>
- <bpmn2:scriptTask id="Task_12ghoph" name="Execute Resource Recipe">
+ <bpmn2:scriptTask id="Task_12ghoph" name="Execute Resource Recipe" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1u9k0dm</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_13c7bhn</bpmn2:outgoing>
<bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/web.xml b/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/web.xml
index 62a2748c8c..cd688479a5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/web.xml
+++ b/bpmn/MSOInfrastructureBPMN/src/main/webapp/WEB-INF/web.xml
@@ -48,9 +48,19 @@
<param-name>resteasy.resources</param-name>
<param-value>org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler</param-value>
</context-param>
+ <context-param>
+ <param-name>mso.configuration</param-name>
+ <param-value>MSO_PROP_APIHANDLER_INFRA=mso.apihandler-infra.properties</param-value>
+ </context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
+
+ <context-param>
+ <param-name>resteasy.jndi.resources</param-name>
+ <param-value>java:module/MsoPropertiesFactory</param-value>
+ </context-param>
<filter>
<filter-name>LogFilter</filter-name>
<filter-class>org.openecomp.mso.logger.LogFilter</filter-class>
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
index 390882e660..de2ae771a5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/CreateVfModuleInfraTest.java
@@ -26,6 +26,7 @@ import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockAAIVfModule;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockSDNCAdapterVfModule;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockVNFAdapterRestVfModule;
import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockDBUpdateVfModule;
+import static org.openecomp.mso.bpmn.mock.StubResponseAPPC.MockAppcError;
import java.io.IOException;
import java.util.HashMap;
@@ -41,6 +42,7 @@ import org.openecomp.mso.bpmn.mock.FileUtil;
/**
* Unit test cases for CreateVfModuleInfra.bpmn
*/
+@Ignore
public class CreateVfModuleInfraTest extends WorkflowTest {
private final CallbackSet callbacks = new CallbackSet();
@@ -65,6 +67,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
@Test
@Deployment(resources = {
"process/CreateVfModuleInfra.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn",
"subprocess/DoCreateVfModule.bpmn",
"subprocess/GenericGetVnf.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
@@ -76,7 +79,8 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
"subprocess/UpdateAAIVfModule.bpmn",
"subprocess/UpdateAAIGenericVnf.bpmn",
"subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn"
})
public void sunnyDayVIDWithPreloads() throws Exception {
@@ -88,6 +92,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
MockSDNCAdapterVfModule();
MockVNFAdapterRestVfModule();
MockDBUpdateVfModule();
+ MockAppcError();
String businessKey = UUID.randomUUID().toString();
String createVfModuleRequest =
@@ -123,6 +128,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
@Test
@Deployment(resources = {
"process/CreateVfModuleInfra.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn",
"subprocess/DoCreateVfModule.bpmn",
"subprocess/GenericGetVnf.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
@@ -134,7 +140,8 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
"subprocess/UpdateAAIVfModule.bpmn",
"subprocess/UpdateAAIGenericVnf.bpmn",
"subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn"
})
public void sunnyDayVIDNoPreloads() throws Exception {
@@ -146,6 +153,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
MockSDNCAdapterVfModule();
MockVNFAdapterRestVfModule();
MockDBUpdateVfModule();
+ MockAppcError();
String businessKey = UUID.randomUUID().toString();
String createVfModuleRequest =
@@ -208,6 +216,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
@Ignore
@Deployment(resources = {
"process/CreateVfModuleInfra.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn",
"subprocess/DoCreateVfModule.bpmn",
"subprocess/GenericGetVnf.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
@@ -220,7 +229,8 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
"subprocess/UpdateAAIVfModule.bpmn",
"subprocess/UpdateAAIGenericVnf.bpmn",
"subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn"
})
public void sunnyDayVIDWithVolumeGroupAttach() throws Exception {
@@ -234,6 +244,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
MockSDNCAdapterVfModule();
MockVNFAdapterRestVfModule();
MockDBUpdateVfModule();
+ MockAppcError();
String businessKey = UUID.randomUUID().toString();
String createVfModuleRequest =
@@ -294,6 +305,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
@Test
@Deployment(resources = {
"process/CreateVfModuleInfra.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn",
"subprocess/DoCreateVfModule.bpmn",
"subprocess/GenericGetVnf.bpmn",
"subprocess/SDNCAdapterV1.bpmn",
@@ -305,7 +317,8 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
"subprocess/UpdateAAIVfModule.bpmn",
"subprocess/UpdateAAIGenericVnf.bpmn",
"subprocess/CompleteMsoProcess.bpmn",
- "subprocess/FalloutHandler.bpmn"
+ "subprocess/FalloutHandler.bpmn",
+ "subprocess/BuildingBlock/AppCClient.bpmn"
})
public void sunnyDayVIDMultipleUserParamValues() throws Exception {
@@ -317,6 +330,7 @@ public class CreateVfModuleInfraTest extends WorkflowTest {
MockSDNCAdapterVfModule();
MockVNFAdapterRestVfModule();
MockDBUpdateVfModule();
+ MockAppcError();
String businessKey = UUID.randomUUID().toString();
String createVfModuleRequest =
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
index d98a395838..75a7450434 100644
--- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegateTest.java
@@ -21,10 +21,11 @@
package org.openecomp.mso.bpmn.infrastructure.pnf.delegate;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.DEFAULT_IP;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITHOUT_ENTRY;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_AND_IP;
import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.AaiConnectionTestImpl.ID_WITH_ENTRY_NO_IP;
@@ -38,6 +39,7 @@ import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
+import org.openecomp.mso.bpmn.core.WorkflowException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@@ -60,8 +62,7 @@ public class CheckAaiForCorrelationIdDelegateTest {
when(execution.getVariable("testProcessKey")).thenReturn("testProcessKeyValue");
// when, then
assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class);
- // todo: uncomment line below after fixing Execution -> DelecateExecution in groovy scripts
-// verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
+ verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
}
@Test
@@ -118,12 +119,14 @@ public class CheckAaiForCorrelationIdDelegateTest {
private CheckAaiForCorrelationIdDelegate delegate;
@Test
- public void shouldThrowExceptionWhenSSADFDSADSFDS() throws Exception {
+ public void shouldThrowExceptionWhenIoExceptionOnConnectionToAai() throws Exception {
// given
DelegateExecution execution = mock(DelegateExecution.class);
when(execution.getVariable(CORRELATION_ID)).thenReturn(ID_WITH_ENTRY_NO_IP);
+ when(execution.getVariable("testProcessKey")).thenReturn("testProcessKey");
// when, then
assertThatThrownBy(() -> delegate.execute(execution)).isInstanceOf(BpmnError.class);
+ verify(execution).setVariable(eq("WorkflowException"), any(WorkflowException.class));
}
}
} \ No newline at end of file
diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java
new file mode 100644
index 0000000000..c667dbf4bb
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplicationTest.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+package org.openecomp.mso.bpmn.infrastructure.workflow.service;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Set;
+
+import org.junit.Test;
+
+public class WorkflowResourceApplicationTest {
+
+ @Test
+ public void test() throws Exception {
+ WorkflowResourceApplication workflowResourceApp = new WorkflowResourceApplication();
+ Set<Class<?>> classes = workflowResourceApp.getClasses();
+ assertEquals(0, classes.size());
+ Set<Object> singleton = workflowResourceApp.getSingletons();
+ assertEquals(3, singleton.size());
+ }
+} \ No newline at end of file
diff --git a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTest.java b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTest.java
new file mode 100644
index 0000000000..1836bc5d6e
--- /dev/null
+++ b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTest.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.cloudify.base.client;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.openecomp.mso.cloudify.v3.model.Execution;
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+public class CloudifyClientTest {
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void clientCreate(){
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("{\"id\": \"123\"}").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ CloudifyClient cc = new CloudifyClient("http://localhost:"+port);
+ cc.setToken("token");
+ CloudifyRequest<Execution> crx = cc.get("/testUrl", Execution.class);
+ Execution x = crx.execute();
+ assertEquals("123", x.getId());
+ }
+
+ @Test
+ public void clientCreateWithBadConnector(){
+ thrown.expect(CloudifyResponseException.class);
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("{\"id\": \"123\"}").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ CloudifyClientConnector ccc = new CloudifyClientConnector(){
+ @Override
+ public <T> CloudifyResponse request(CloudifyRequest<T> request) {
+ throw new CloudifyResponseException("test case", 401);
+ }};
+ CloudifyClient cc = new CloudifyClient("http://localhost:"+port, ccc);
+// cc.setToken("token");
+ CloudifyRequest<Execution> crx = cc.get("/testUrl", Execution.class);
+ Execution x = crx.execute();
+ }
+
+ @Test
+ public void clientCreateWithBadConnectorAndToken(){
+ thrown.expect(CloudifyResponseException.class);
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("{\"id\": \"123\"}").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ CloudifyClientConnector ccc = new CloudifyClientConnector(){
+ @Override
+ public <T> CloudifyResponse request(CloudifyRequest<T> request) {
+ throw new CloudifyResponseException("test case", 401);
+ }};
+ CloudifyClient cc = new CloudifyClient("http://localhost:"+port, ccc);
+ cc.setToken("token");
+ CloudifyRequest<Execution> crx = cc.get("/testUrl", Execution.class);
+ Execution x = crx.execute();
+ }
+
+ @Test
+ public void clientCreateWithTenant(){
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("{\"id\": \"123\"}").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ CloudifyClient cc = new CloudifyClient("http://localhost:"+port, "other_tenant");
+ cc.setToken("token");
+ cc.property("property", "value");
+ CloudifyRequest<Execution> crx = cc.get("/testUrl", Execution.class);
+ Execution x = crx.execute();
+ assertEquals("123", x.getId());
+ }
+
+}
diff --git a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTokenProviderTest.java b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTokenProviderTest.java
new file mode 100644
index 0000000000..c28b6b91aa
--- /dev/null
+++ b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/base/client/CloudifyClientTokenProviderTest.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.cloudify.base.client;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+public class CloudifyClientTokenProviderTest {
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void createTokenProvider() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("{\"role\": \"user\", \"value\": \"tokenVal\"}").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+
+ CloudifyClientTokenProvider cctp = new CloudifyClientTokenProvider("http://localhost:"+port+"/testUrl", "user", "pswd");
+ String token = cctp.getToken();
+ assertEquals("tokenVal", token);
+ token = cctp.getToken();
+ assertEquals("tokenVal", token);
+ cctp.expireToken();
+ }
+}
diff --git a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/connector/http/HttpClientConnectorTest.java b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/connector/http/HttpClientConnectorTest.java
index b768c93168..72d2de6e9d 100644
--- a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/connector/http/HttpClientConnectorTest.java
+++ b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/connector/http/HttpClientConnectorTest.java
@@ -25,6 +25,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import com.github.tomakehurst.wiremock.http.Fault;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
@@ -41,8 +42,16 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.openecomp.mso.cloudify.base.client.CloudifyConnectException;
import org.openecomp.mso.cloudify.base.client.CloudifyRequest;
import org.openecomp.mso.cloudify.base.client.CloudifyResponseException;
+import org.openecomp.mso.cloudify.base.client.Entity;
import org.openecomp.mso.cloudify.base.client.HttpMethod;
import org.openecomp.mso.cloudify.v3.model.Deployment;
@@ -53,7 +62,7 @@ public class HttpClientConnectorTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
-
+
@Test
public void sunnyDay_POST(){
wireMockRule.stubFor(post(urlPathEqualTo("/testUrl")).willReturn(aResponse()
@@ -71,8 +80,8 @@ public class HttpClientConnectorTest {
conector.request(request);
verify(postRequestedFor(urlEqualTo("/testUrl")));
}
-
-
+
+
@Test
public void sunnyDay_GET(){
wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(aResponse()
@@ -118,7 +127,7 @@ public class HttpClientConnectorTest {
@Test
- public void rainydDay_PATCH(){
+ public void rainyDay_PATCH(){
thrown.expect(HttpClientException.class);
thrown.expectMessage("Unrecognized HTTP Method: PATCH");
HttpClientConnector conector = new HttpClientConnector();
@@ -130,9 +139,8 @@ public class HttpClientConnectorTest {
}
-
@Test
- public void rainydDay_RunTimeException(){
+ public void rainyDayRunTimeException(){
wireMockRule.stubFor(post(urlEqualTo("/503")).willReturn(
aResponse().withStatus(503).withHeader("Content-Type", "text/plain").withBody("failure")));
thrown.expect(RuntimeException.class);
@@ -145,6 +153,99 @@ public class HttpClientConnectorTest {
conector.request(request);
}
+
+ @Test
+ public void rainyDayBadUri() {
+ wireMockRule.stubFor(post(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("TEST").withStatus(HttpStatus.SC_OK)));
+ thrown.expect(HttpClientException.class);
+ int port = wireMockRule.port();
+ HttpClientConnector conector = new HttpClientConnector();
+ CloudifyRequest<Deployment> request = new CloudifyRequest<Deployment>();
+ Deployment deployment = new Deployment();
+ deployment.setId("id");
+ request.entity(deployment, "application/json");
+ request.endpoint("(@#$@(#*$&asfasdf");
+ request.setBasicAuthentication("USER","PASSWORD");
+ request.header("Content-Type","application/json");
+ request.method(HttpMethod.POST);
+ conector.request(request);
+ }
+
+ @Test
+ public void sunnyDayWithJsonEntity_POST(){
+ wireMockRule.stubFor(post(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("TEST").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ HttpClientConnector conector = new HttpClientConnector();
+
+ Deployment deployment = new Deployment();
+ deployment.setId("id");
+
+ CloudifyRequest<Deployment> request = new CloudifyRequest<Deployment>(null, HttpMethod.POST, "/", Entity.json(deployment), null);
+
+ request.endpoint("http://localhost:"+port);
+ request.path("testUrl");
+ request.header("Content-Type","application/json");
+ request.header("Content-Type", null);
+
+ request.returnType(Deployment.class);
+ assertEquals(Deployment.class, request.returnType());
+
+ Entity<Deployment> t = request.json(deployment);
+ assertEquals(t.getEntity().getId(), "id");
+
+ request.queryParam("test", "one").queryParam("test", "two");
+
+ conector.request(request);
+
+ verify(postRequestedFor(urlEqualTo("/testUrl?test=two")));
+ }
+
+ @Test
+ public void sunnyDayWithStreamEntity_POST() {
+ wireMockRule.stubFor(post(urlPathEqualTo("/testUrl")).willReturn(aResponse()
+ .withHeader("Content-Type", "application/json").withBody("TEST").withStatus(HttpStatus.SC_OK)));
+ int port = wireMockRule.port();
+ HttpClientConnector conector = new HttpClientConnector();
+
+ InputStream is = new ByteArrayInputStream("{}".getBytes(StandardCharsets.UTF_8));
+ CloudifyRequest<Deployment> request = new CloudifyRequest<Deployment>(null, HttpMethod.POST, "/testUrl", Entity.stream(is), null);
+
+ request.endpoint("http://localhost:"+port);
+ request.setBasicAuthentication("USER","PASSWORD");
+ request.header("Content-Type","application/json");
+
+ conector.request(request);
+ verify(postRequestedFor(urlEqualTo("/testUrl")));
+ }
+
+ @Test
+ public void rainyDayGarbageData(){
+ wireMockRule.stubFor(get(urlPathEqualTo("/testUrl")).willReturn(
+ aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));
+ thrown.expect(CloudifyConnectException.class);
+ int port = wireMockRule.port();
+ HttpClientConnector conector = new HttpClientConnector();
+ CloudifyRequest<Deployment> request = new CloudifyRequest<Deployment>();
+ request.endpoint("http://localhost:"+port+"/testUrl");
+ request.setBasicAuthentication("USER","PASSWORD");
+ request.method(HttpMethod.GET);
+ conector.request(request);
+ }
+
+ @Test
+ public void rainyDayEmptyResponse(){
+ thrown.expect(HttpClientException.class);
+ int port = wireMockRule.port();
+ HttpClientConnector conector = new HttpClientConnector();
+ CloudifyRequest<Deployment> request = new CloudifyRequest<Deployment>();
+ request.endpoint("http://localhost:"+port+"/testUrl");
+ request.setBasicAuthentication("USER","PASSWORD");
+ request.method(HttpMethod.GET);
+ conector.request(request); // gets down to "Get here on an error response (4XX-5XX)", then tries to throw a CloudifyResponseException, which calls getEntity, which tries to parse an HTML error page as a JSON, which causes the HttpClientException.
+ }
+
} \ No newline at end of file
diff --git a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/BlueprintsResourceTest.java b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/BlueprintsResourceTest.java
new file mode 100644
index 0000000000..ec7435fca5
--- /dev/null
+++ b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/BlueprintsResourceTest.java
@@ -0,0 +1,132 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.cloudify.v3.client;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.delete;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.openecomp.mso.cloudify.v3.client.BlueprintsResource.DeleteBlueprint;
+import org.openecomp.mso.cloudify.v3.client.BlueprintsResource.GetBlueprint;
+import org.openecomp.mso.cloudify.v3.client.BlueprintsResource.ListBlueprints;
+import org.openecomp.mso.cloudify.v3.client.BlueprintsResource.UploadBlueprint;
+import org.openecomp.mso.cloudify.v3.model.Blueprint;
+import org.openecomp.mso.cloudify.v3.model.Blueprints;
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+public class BlueprintsResourceTest {
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void cloudifyClientBlueprintFromStream() {
+ wireMockRule.stubFor(put(urlPathEqualTo("/api/v3/blueprints/")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"id\": \"123\"}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ BlueprintsResource br = c.blueprints();
+ InputStream is = new ByteArrayInputStream("{}".getBytes(StandardCharsets.UTF_8));
+ UploadBlueprint ub = br.uploadFromStream("123", "blueprint.json", is);
+ Blueprint b = ub.execute();
+ assertEquals("123", b.getId());
+ }
+
+ @Test
+ public void cloudifyClientBlueprintFromUrl() {
+ wireMockRule.stubFor(put(urlPathEqualTo("/api/v3/blueprints/")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"id\": \"123\"}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ BlueprintsResource br = c.blueprints();
+ UploadBlueprint ub = br.uploadFromUrl("123", "blueprint.json", "http://localhost:"+port+"/blueprint");
+ Blueprint b = ub.execute();
+ assertEquals("123", b.getId());
+ }
+
+ @Test
+ public void cloudifyClientBlueprintDelete() {
+ wireMockRule.stubFor(delete(urlPathEqualTo("/api/v3/blueprints/")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"id\": \"123\"}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ BlueprintsResource br = c.blueprints();
+ DeleteBlueprint db = br.deleteById("123");
+ Blueprint b = db.execute();
+ assertEquals("123", b.getId());
+ }
+
+ @Test
+ public void cloudifyClientBlueprintList() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/blueprints")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"items\": [{\"id\": \"123\"}]}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ BlueprintsResource br = c.blueprints();
+ ListBlueprints lb = br.list();
+ Blueprints b = lb.execute();
+ assertEquals("123", b.getItems().get(0).getId());
+ }
+
+ @Test
+ public void cloudifyClientBlueprintGetById() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/blueprints/")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"id\": \"123\"}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ BlueprintsResource br = c.blueprints();
+ GetBlueprint gb = br.getById("123");
+ Blueprint b = gb.execute();
+ assertEquals("123", b.getId());
+ }
+
+
+}
diff --git a/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/ExecutionsResourceTest.java b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/ExecutionsResourceTest.java
new file mode 100644
index 0000000000..93f5473159
--- /dev/null
+++ b/cloudify-client/src/test/java/org/openecomp/mso/cloudify/v3/client/ExecutionsResourceTest.java
@@ -0,0 +1,170 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.cloudify.v3.client;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.patch;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.http.HttpStatus;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.openecomp.mso.cloudify.connector.http.HttpClientException;
+import org.openecomp.mso.cloudify.v3.client.ExecutionsResource.CancelExecution;
+import org.openecomp.mso.cloudify.v3.client.ExecutionsResource.GetExecution;
+import org.openecomp.mso.cloudify.v3.client.ExecutionsResource.ListExecutions;
+import org.openecomp.mso.cloudify.v3.client.ExecutionsResource.StartExecution;
+import org.openecomp.mso.cloudify.v3.client.ExecutionsResource.UpdateExecution;
+import org.openecomp.mso.cloudify.v3.model.CancelExecutionParams;
+import org.openecomp.mso.cloudify.v3.model.Execution;
+import org.openecomp.mso.cloudify.v3.model.Executions;
+import org.openecomp.mso.cloudify.v3.model.StartExecutionParams;
+
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
+
+public class ExecutionsResourceTest {
+ @Rule
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ @Test
+ public void cloudifyClientExecutions() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"items\": [{ \"id\": \"345\" }, { \"id\": \"123\" }], \"metadata\": {\"pagination\": {\"total\": 100, \"offset\": 0, \"size\": 25}}}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+ ListExecutions lx = xr.list();
+ Executions x = lx.execute();
+ assertEquals("123", x.getItems().get(1).getId());
+ }
+
+ @Test
+ public void cloudifyClientExecutionsSorted() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"items\": [{ \"id\": \"123\" }, { \"id\": \"345\" }], \"metadata\": {\"pagination\": {\"total\": 100, \"offset\": 0, \"size\": 25}}}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+ ListExecutions lx = xr.listSorted("id");
+ Executions x = lx.execute();
+ assertEquals("345", x.getItems().get(1).getId());
+ }
+
+ @Test
+ public void cloudifyClientExecutionsFilter() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{\"items\": [{ \"id\": \"121\" }, { \"id\": \"123\" }], \"metadata\": {\"pagination\": {\"total\": 100, \"offset\": 0, \"size\": 25}}}")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+ ListExecutions lx = xr.listFiltered("a=b", "id");
+ Executions x = lx.execute();
+ assertEquals("123", x.getItems().get(1).getId());
+ }
+
+ @Test
+ public void cloudifyClientExecutionById() {
+ wireMockRule.stubFor(get(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{ \"id\": \"123\" }")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+ GetExecution gx = xr.byId("123");
+ Execution x = gx.execute();
+ assertEquals("123", x.getId());
+ }
+
+ @Test
+ public void cloudifyClientStartExecution() {
+ wireMockRule.stubFor(post(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{ \"id\": \"123\" }")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+
+ StartExecutionParams params = new StartExecutionParams();
+ StartExecution sx = xr.start(params);
+ Execution x = sx.execute();
+ assertEquals("123", x.getId());
+ }
+
+ @Test
+ public void cloudifyClientUpdateExecution() {
+ thrown.expect(HttpClientException.class);
+ thrown.expectMessage("Unrecognized HTTP Method: PATCH");
+
+ wireMockRule.stubFor(patch(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{ \"id\": \"123\" }")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+
+ UpdateExecution ux = xr.updateStatus("123", "good");
+ Execution x = ux.execute();
+ assertEquals("123", x.getId());
+ }
+
+ @Test
+ public void cloudifyClientCancelExecution() {
+ wireMockRule.stubFor(post(urlPathEqualTo("/api/v3/executions")).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withBody("{ \"id\": \"123\" }")
+ .withStatus(HttpStatus.SC_OK)));
+
+ int port = wireMockRule.port();
+
+ Cloudify c = new Cloudify("http://localhost:"+port, "tenant");
+ ExecutionsResource xr = c.executions();
+
+ CancelExecutionParams params = new CancelExecutionParams();
+ CancelExecution cx = xr.cancel("123", params);
+ Execution x = cx.execute();
+ assertEquals("123", x.getId());
+ }
+
+
+
+}
diff --git a/common/src/test/java/org/openecomp/mso/utils/UUIDCheckerTest.java b/common/src/test/java/org/openecomp/mso/utils/UUIDCheckerTest.java
new file mode 100644
index 0000000000..fa00246e8b
--- /dev/null
+++ b/common/src/test/java/org/openecomp/mso/utils/UUIDCheckerTest.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 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=========================================================
+ */
+
+package org.openecomp.mso.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openecomp.mso.logger.MsoLogger;
+
+public class UUIDCheckerTest {
+
+ private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+
+ @Test
+ public void testUUIDChecker() throws Exception {
+ boolean isValidUUID = UUIDChecker.isValidUUID("invalid-uuid");
+ assertEquals(false, isValidUUID);
+ String validUUID = UUIDChecker.verifyOldUUID("invalid-uuid", LOGGER);
+ assertEquals(true, UUIDChecker.isValidUUID(validUUID));
+ String generatedUUID = UUIDChecker.generateUUID(LOGGER);
+ assertEquals(true, UUIDChecker.isValidUUID(generatedUUID));
+ String generatedServiceInstanceId = UUIDChecker.generateServiceInstanceID(LOGGER);
+ assertEquals(true, UUIDChecker.isValidUUID(generatedServiceInstanceId));
+ }
+
+}
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..44094a1394 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/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
index e1d590531f..3fa074e8e1 100644
--- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
+++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java
@@ -1216,7 +1216,7 @@ public class CatalogDatabase implements Closeable {
return null;
}
- VnfRecipe recipe = this.getVnfRecipeByNameVersion(vnfResource.getModelName(), vnfResource.getModelVersion(), action);
+ VnfRecipe recipe = this.getVnfRecipeByNameVersion(vnfResource.getModelName(), vnfResource.getVersion(), action);
return recipe;
}
diff --git a/pom.xml b/pom.xml
index 9d1bcc5ca4..ed64d08b70 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
<swm.version>2.19.3-1</swm.version>
<openstack.version>1.2.1</openstack.version>
<nexusproxy>https://nexus.onap.org</nexusproxy>
- <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format>
+ <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
<resteasy.version>3.0.19.Final</resteasy.version>
</properties>
<distributionManagement>