aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql6
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql8
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java9
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java4
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java3
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/Application.java5
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java5
-rw-r--r--asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java76
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn8
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn4
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy43
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy5
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy5
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn35
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn141
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java53
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java33
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java129
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java)62
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java5
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java2
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java2
29 files changed, 642 insertions, 162 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
index 372fbab33d..2183d3b6d3 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql
@@ -27,7 +27,7 @@ INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, I
('VFModule-Delete', 'deleteInstance', 'VfModule', true,true, '7','7', 'CloudOwner'),
('NetworkCollection-Macro-Create', 'createInstance', 'NetworkCollection', false,true, '7','7', 'CloudOwner'),
('NetworkCollection-Macro-Delete', 'deleteInstance', 'NetworkCollection', false,true, '7','7', 'CloudOwner'),
-('VFModule-ScaleOut', 'createInstance', 'VfModule', true, true, '7','7', 'CloudOwner');
+('VFModule-ScaleOut', 'scaleOut', 'VfModule', true, true, '7','7', 'CloudOwner');
INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES
@@ -234,8 +234,8 @@ VALUES
('DeleteNetworkBB', 'NETWORK', 'DELETE'),
('DeleteNetworkCollectionBB', 'NETWORK', 'DELETE'),
-('ConfigurationScaleOutBB', 'VF_MODULE', 'CREATE'),
-('GenericVnfHealthCheckBB', 'VF_MODULE', 'CREATE');
+('ConfigurationScaleOutBB', 'NO_VALIDATE', 'CUSTOM'),
+('GenericVnfHealthCheckBB', 'NO_VALIDATE', 'CUSTOM');
INSERT INTO orchestration_status_state_transition_directive (resource_type, orchestration_status, target_action, flow_directive)
VALUES
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
index fd7fcd48d0..3f76334bd9 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
@@ -196,4 +196,10 @@ VALUES
((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
(select ID from user_parameters where NAME='existing_software_version')),
((select ID from activity_spec where NAME='VNFUpgradeSoftwareActivity' and VERSION=1.0),
-(select ID from user_parameters where NAME='new_software_version')); \ No newline at end of file
+(select ID from user_parameters where NAME='new_software_version'));
+
+INSERT INTO `workflow` (`ARTIFACT_UUID`,`ARTIFACT_NAME`,`NAME`,`OPERATION_NAME`,`VERSION`,`DESCRIPTION`,`RESOURCE_TARGET`,`SOURCE`)
+VALUES
+('9d45cd30-1a89-4993-87c1-6dd09c1696cf','VFModule-ScaleOut','VNF Scale Out','ScaleOut',1.0,'native static workflow to support ScaleOut','vfModule','native'),
+('da6478e4-ea33-3346-ac12-ab121284a333','VnfInPlaceUpdate.bpmn','VNF In Place Software Update','inPlaceSoftwareUpdate',1.0,'native static workflow to support inPlaceSoftwareUpdate','vnf','native'),
+('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VNF Config Update','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native'); \ No newline at end of file
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
index 164f12ea29..2aee1c06e3 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
@@ -20,6 +20,10 @@
package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
+import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
+import com.google.gson.Gson;
+import java.util.Iterator;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
import org.onap.so.configuration.rest.HttpHeadersProvider;
import org.onap.so.rest.service.HttpRestServiceProvider;
@@ -32,8 +36,6 @@ import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
-import java.util.Iterator;
-import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
/**
* Configures the HttpRestServiceProvider for REST call to a VNFM.
@@ -60,7 +62,8 @@ public class VnfmServiceProviderConfiguration {
iterator.remove();
}
}
- restTemplate.getMessageConverters().add(new GsonHttpMessageConverter());
+ final Gson gson = new JSON().getGson();
+ restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
}
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
index 345ff5119a..b3552c780e 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/jobmanagement/JobManager.java
@@ -93,6 +93,10 @@ public class JobManager {
logger.debug("Job Id: " + jobId + ", operationId: " + operation.getId() + ", operation details: " + operation);
+ if (operation.getOperationState() == null) {
+ return response.operationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.WAITING_FOR_STATUS);
+ }
+
response.setOperationStatusRetrievalStatus(OperationStatusRetrievalStatusEnum.STATUS_FOUND);
response.setId(operation.getId());
response.setOperation(OperationEnum.fromValue(operation.getOperation().getValue()));
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
index 73a49e9c40..b48de30f88 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/VnfmAdapterControllerTest.java
@@ -52,6 +52,7 @@ import org.onap.aai.domain.yang.RelationshipData;
import org.onap.aai.domain.yang.RelationshipList;
import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication;
import org.onap.so.adapters.vnfmadapter.extclients.SdcPackageProvider;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
@@ -115,7 +116,7 @@ public class VnfmAdapterControllerTest {
@Autowired
VnfmAdapterController controller;
- Gson gson = new Gson();
+ Gson gson = new JSON().getGson();
@Before
public void setUp() throws Exception {
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/Application.java b/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
index a05eeea466..eb2957c6f8 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
@@ -22,6 +22,8 @@ package org.onap.so.asdc;
import javax.annotation.PostConstruct;
import org.onap.so.asdc.activity.DeployActivitySpecs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -32,7 +34,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
public class Application {
-
+ private static final Logger logger = LoggerFactory.getLogger(Application.class);
private static final String MSO_CONFIG_PATH = "mso.config.path";
private static final String LOGS_DIR = "logs_dir";
@@ -55,6 +57,7 @@ public class Application {
try {
deployActivitySpecs.deployActivities();
} catch (Exception e) {
+ logger.warn("{} {}", "Exception on deploying activitySpecs: ", e.getMessage());
}
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
index 87008f1d8f..54da1b9247 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java
@@ -25,6 +25,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import org.onap.so.asdc.activity.beans.ActivitySpec;
import org.onap.so.asdc.activity.beans.Input;
import org.onap.so.asdc.activity.beans.Output;
@@ -52,14 +53,16 @@ public class DeployActivitySpecs {
protected static final Logger logger = LoggerFactory.getLogger(DeployActivitySpecs.class);
-
+ @Transactional
public void deployActivities() throws Exception {
String hostname = env.getProperty(SDC_ENDPOINT);
+ logger.debug("{} {}", "SDC ActivitySpec endpoint: ", hostname);
if (hostname == null || hostname.isEmpty()) {
return;
}
List<org.onap.so.db.catalog.beans.ActivitySpec> activitySpecsFromCatalog = activitySpecRepository.findAll();
for (org.onap.so.db.catalog.beans.ActivitySpec activitySpecFromCatalog : activitySpecsFromCatalog) {
+ logger.debug("{} {}", "Attempting to create activity ", activitySpecFromCatalog.getName());
ActivitySpec activitySpec = mapActivitySpecFromCatalogToSdc(activitySpecFromCatalog);
String activitySpecId = activitySpecsActions.createActivitySpec(hostname, activitySpec);
if (activitySpecId != null) {
diff --git a/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
new file mode 100644
index 0000000000..81977da278
--- /dev/null
+++ b/asdc-controller/src/test/java/org/onap/asdc/activity/DeployActivitySpecsITTest.java
@@ -0,0 +1,76 @@
+/*-
+ * ============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.onap.asdc.activity;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.put;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.onap.so.asdc.BaseTest;
+import org.onap.so.asdc.activity.DeployActivitySpecs;
+import org.onap.so.asdc.activity.beans.ActivitySpecCreateResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpHeaders;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import javax.ws.rs.core.MediaType;
+
+public class DeployActivitySpecsITTest extends BaseTest {
+ @Mock
+ protected Environment env;
+
+ @Value("${wiremock.server.port}")
+ private String wiremockPort;
+
+ @Autowired
+ private DeployActivitySpecs deployActivitySpecs;
+
+ @Test
+ public void deployActivitySpecsIT_Test() throws Exception {
+ ActivitySpecCreateResponse activitySpecCreateResponse = new ActivitySpecCreateResponse();
+ activitySpecCreateResponse.setId("testActivityId");
+ HttpHeaders headers = new HttpHeaders();
+ headers.set("Accept", MediaType.APPLICATION_JSON);
+ headers.set("Content-Type", MediaType.APPLICATION_JSON);
+
+ ObjectMapper mapper = new ObjectMapper();
+ String body = mapper.writeValueAsString(activitySpecCreateResponse);
+
+ wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.OK.value()).withBody(body)));
+
+ when(env.getProperty("mso.asdc.config.activity.endpoint")).thenReturn("http://localhost:8090");
+
+ String urlPath = "/v1.0/activity-spec/testActivityId/versions/latest/actions";
+
+ wireMockServer.stubFor(
+ put(urlPathMatching(urlPath)).willReturn(aResponse().withHeader("Content-Type", "application/json")
+ .withStatus(org.springframework.http.HttpStatus.OK.value())));
+
+ deployActivitySpecs.deployActivities();
+ assertTrue(activitySpecCreateResponse.getId().equals("testActivityId"));
+ }
+}
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn
index 6d54262dc5..9712ca8ab7 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmCreateNodeStatus.bpmn
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ko0frn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
- <bpmn:process id="Process_1" isExecutable="true">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1ko0frn" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3">
+ <bpmn:process id="MonitorVnfmCreateNodeStatus" name="MonitorVnfmCreateNodeStatus" isExecutable="true">
<bpmn:startEvent id="StartEvent_0k0qfjb">
<bpmn:outgoing>SequenceFlow_1miob62</bpmn:outgoing>
</bpmn:startEvent>
@@ -24,7 +24,7 @@
<bpmn:endEvent id="EndEvent_0tei3i9">
<bpmn:incoming>SequenceFlow_1rxbeqi</bpmn:incoming>
</bpmn:endEvent>
- <bpmn:serviceTask id="ServiceTask_0y71su8" name="&#10;Get node status &#10;" camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="ServiceTask_0y71su8" name="&#10;Get node status &#10;" camunda:asyncAfter="true" camunda:expression="${MonitorInstantiateVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_1moaz0q</bpmn:incoming>
<bpmn:incoming>SequenceFlow_09t51ao</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0qvy3sn</bpmn:outgoing>
@@ -56,7 +56,7 @@
<bpmn:sequenceFlow id="SequenceFlow_0qcc5x4" sourceRef="BoundaryEvent_1f5o5i9" targetRef="ServiceTask_12qp0ty" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MonitorVnfmCreateNodeStatus">
<bpmndi:BPMNShape id="StartEvent_0k0qfjb_di" bpmnElement="StartEvent_0k0qfjb">
<dc:Bounds x="155" y="219" width="36" height="36" />
</bpmndi:BPMNShape>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn
index 8fababaffe..668cfaa44a 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/MonitorVnfmDeleteNodeStatus.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_15jp7td" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_15jp7td" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3">
<bpmn:process id="MonitorVnfmDeleteNodeStatus" name="MonitorVnfmDeleteNodeStatus" isExecutable="true">
<bpmn:startEvent id="StartEvent_0f7nbs2">
<bpmn:outgoing>SequenceFlow_0spr34x</bpmn:outgoing>
@@ -28,7 +28,7 @@
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("deleteVnfNodeStatus")}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0zlblru" sourceRef="ExclusiveGateway_1j9jbtk" targetRef="IntermediateCatchEvent_15yl23y" />
- <bpmn:serviceTask id="ServiceTask_1ksqjjf" name="&#10;Get node status &#10;" camunda:asyncAfter="true" camunda:expression="${MonitorVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:serviceTask id="ServiceTask_1ksqjjf" name="&#10;Get node status &#10;" camunda:asyncAfter="true" camunda:expression="${MonitorTerminateVnfmNodeTask.getNodeStatus(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_17vvpzi</bpmn:incoming>
<bpmn:incoming>SequenceFlow_11rfobu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1unicf9</bpmn:outgoing>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
index bd465eb9a8..a771741e18 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
@@ -23,6 +23,13 @@
package org.onap.so.bpmn.infrastructure.scripts
+import org.onap.aai.domain.yang.ServiceInstance
+import org.onap.so.bpmn.core.domain.ServiceDecomposition
+import org.onap.so.bpmn.core.domain.VnfResource
+import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.AAIResourcesClient
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
+import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.ErrorCode;
import static org.apache.commons.lang3.StringUtils.*
@@ -332,5 +339,41 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}
logger.trace("finished prepareInitServiceOperationStatus")
}
+
+ public void updateAAIOrchStatus (DelegateExecution execution){
+ logger.debug(" ***** start updateAAIOrchStatus ***** ")
+ String msg = ""
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ logger.debug("serviceInstanceId: "+serviceInstanceId)
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+
+ try {
+ ServiceInstance si = execution.getVariable("serviceInstanceData")
+ boolean allActive = true
+ for (VnfResource resource : serviceDecomposition.vnfResources) {
+ logger.debug("resource.modelInfo.getModelName: " + resource.modelInfo.getModelName() +" | resource.getOrchestrationStatus: "+resource.getOrchestrationStatus())
+ if (resource.getOrchestrationStatus() != "Active") {
+ allActive = false
+ }
+ }
+
+ if (allActive){
+ si.setOrchestrationStatus("Active")
+ }else {
+ si.setOrchestrationStatus("Pending")
+ }
+ AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId)
+ client.update(uri, si)
+ } catch (BpmnError e) {
+ throw e
+ } catch (Exception ex) {
+ msg = "Exception in org.onap.so.bpmn.common.scripts.CompleteMsoProcess.updateAAIOrchStatus " + ex.getMessage()
+ logger.info( msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+
+ logger.debug(" ***** end updateAAIOrchStatus ***** ")
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index b0749ded86..b70797c63b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -243,12 +243,11 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String ontsn = jsonUtil.getJsonValue(serInput,
"service.parameters.requestInputs.ont_ont_serial_num")
- String uResourceInput = jsonUtil.addJsonValue(resourceInput, "requestInputs.c_vlan", cvlan)
- uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.s_vlan", svlan)
+ String uResourceInput = jsonUtil.addJsonValue(resourceInput, "requestInputs.CVLAN", cvlan)
+ uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.SVLAN", svlan)
uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.remote_id", remoteId)
uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.manufacturer", manufacturer)
uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.ONTSN", ontsn)
-
logger.debug("old resource input:" + resourceInputObj.toString())
resourceInputObj.setResourceParameters(uResourceInput)
execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString())
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 98def612de..b49f00a247 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -280,5 +280,10 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
public void postConfigRequest(DelegateExecution execution){
//now do noting
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ for (VnfResource resource : serviceDecomposition.vnfResources) {
+ resource.setOrchestrationStatus("Active")
+ }
+ execution.setVariable("serviceDecomposition", serviceDecomposition)
}
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
index 04ff48d4ed..c1b5ef82de 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4">
<bpmn:process id="CreateCustomE2EServiceInstance" name="CreateCustomE2EServiceInstance" isExecutable="true">
<bpmn:startEvent id="StartEvent_00qj6ro" name="Create SI Start Flow">
<bpmn:outgoing>SequenceFlow_0s2spoq</bpmn:outgoing>
@@ -44,6 +44,8 @@ ex.processJavaException(execution)</bpmn:script>
<camunda:in source="uuiRequest" target="uuiRequest" />
<camunda:in source="requestAction" target="operationType" />
<camunda:in source="operationId" target="operationId" />
+ <camunda:out source="serviceDecomposition" target="serviceDecomposition" />
+ <camunda:out source="serviceInstanceData" target="serviceInstanceData" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
@@ -74,7 +76,7 @@ csi.prepareCompletionRequest(execution)</bpmn:script>
<camunda:out source="CompleteMsoProcessResponse" target="CompleteMsoProcessResponse" />
<camunda:out source="CMSO_ErrorResponse" target="CMSO_ErrorResponse" />
</bpmn:extensionElements>
- <bpmn:incoming>SequenceFlow_0je30si</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0kaz8ac</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0yayvrf</bpmn:outgoing>
</bpmn:callActivity>
<bpmn:subProcess id="SubProcess_0vaws86" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true">
@@ -140,7 +142,7 @@ csi.sendSyncResponse(execution)</bpmn:script>
<bpmn:sequenceFlow id="SequenceFlow_14zu6wr" name="yes" sourceRef="ExclusiveGateway_0aqn64l" targetRef="ScriptTask_0ttvn8r">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("WorkflowException") == null}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
- <bpmn:sequenceFlow id="SequenceFlow_0je30si" sourceRef="ScriptTask_0ttvn8r" targetRef="CallActivity_02fyxz0" />
+ <bpmn:sequenceFlow id="SequenceFlow_0je30si" sourceRef="ScriptTask_0ttvn8r" targetRef="Task_1bgdtc9" />
<bpmn:sequenceFlow id="SequenceFlow_1fueo69" name="no" sourceRef="ExclusiveGateway_0aqn64l" targetRef="EndEvent_07uk5iy">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("WorkflowException") != null}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
@@ -175,6 +177,14 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
<bpmn:outgoing>SequenceFlow_081z8l2</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_081z8l2" sourceRef="Task_19mxcw3" targetRef="ScriptTask_0xupxj9" />
+ <bpmn:sequenceFlow id="SequenceFlow_0kaz8ac" sourceRef="Task_1bgdtc9" targetRef="CallActivity_02fyxz0" />
+ <bpmn:scriptTask id="Task_1bgdtc9" name="Update AAI Status" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0je30si</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0kaz8ac</bpmn:outgoing>
+ <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def csi = new CreateCustomE2EServiceInstance()
+csi.updateAAIOrchStatus(execution)</bpmn:script>
+ </bpmn:scriptTask>
</bpmn:process>
<bpmn:error id="Error_0nbdy47" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
@@ -192,9 +202,9 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
<dc:Bounds x="751" y="158" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0bpd6c0_di" bpmnElement="EndEvent_0bpd6c0">
- <dc:Bounds x="1258" y="286" width="36" height="36" />
+ <dc:Bounds x="1387" y="286" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1268" y="322" width="22" height="12" />
+ <dc:Bounds x="1398" y="322" width="20" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1s09c7d_di" bpmnElement="ScriptTask_1s09c7d">
@@ -204,7 +214,7 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
<dc:Bounds x="1038" y="158" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_02fyxz0_di" bpmnElement="CallActivity_02fyxz0">
- <dc:Bounds x="1226" y="158" width="100" height="80" />
+ <dc:Bounds x="1355" y="158" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_0vaws86_di" bpmnElement="SubProcess_0vaws86" isExpanded="true">
<dc:Bounds x="348" y="370" width="679" height="194" />
@@ -246,8 +256,8 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0yayvrf_di" bpmnElement="SequenceFlow_0yayvrf">
- <di:waypoint x="1276" y="238" />
- <di:waypoint x="1276" y="286" />
+ <di:waypoint x="1405" y="238" />
+ <di:waypoint x="1405" y="286" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1246" y="262" width="0" height="12" />
</bpmndi:BPMNLabel>
@@ -270,7 +280,7 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0je30si_di" bpmnElement="SequenceFlow_0je30si">
<di:waypoint x="1138" y="198" />
- <di:waypoint x="1226" y="198" />
+ <di:waypoint x="1189" y="198" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1137" y="183" width="0" height="12" />
</bpmndi:BPMNLabel>
@@ -386,6 +396,13 @@ csi.prepareInitServiceOperationStatus(execution)</bpmn:script>
<dc:Bounds x="533" y="177" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0kaz8ac_di" bpmnElement="SequenceFlow_0kaz8ac">
+ <di:waypoint x="1289" y="198" />
+ <di:waypoint x="1355" y="198" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0novdpr_di" bpmnElement="Task_1bgdtc9">
+ <dc:Bounds x="1189" y="158" width="100" height="80" />
+ </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
index eccb9486dd..76dd6facd6 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.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="2.2.4" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateE2EServiceInstanceV3" name="DoCreateE2EServiceInstanceV3" isExecutable="true">
<bpmn2:startEvent id="createSI_startEvent" name="Start Flow">
<bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing>
@@ -7,10 +7,10 @@
<bpmn2:scriptTask id="preProcessRequest_ScriptTask" name="PreProcess Incoming Request" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1qiiycn</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0w9t6tc</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
dcsi.preProcessRequest(execution)
-]]></bpmn2:script>
+</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:subProcess id="SubProcess_06d8lk8" name="Sub-process for Application Errors" triggeredByEvent="true">
<bpmn2:startEvent id="StartEvent_0yljq9y">
@@ -36,28 +36,28 @@ dcsi.preProcessRequest(execution)
<bpmn2:scriptTask id="ScriptTask_0ocetux" name="Pre Process Rollback" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0tgrn11</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1lqktwf</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
dcsi.preProcessRollback(execution)
-]]></bpmn2:script>
+</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1lqktwf" sourceRef="ScriptTask_0ocetux" targetRef="CallActivity_1srx6p6" />
<bpmn2:scriptTask id="ScriptTask_1p0vyip" name="Post Process Rollback" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0eumzpf</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1xzgv5k</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
dcsi.postProcessRollback(execution)
-]]></bpmn2:script>
+</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1xzgv5k" sourceRef="ScriptTask_1p0vyip" targetRef="EndEvent_117lkk3" />
</bpmn2:subProcess>
<bpmn2:scriptTask id="ScriptTask_0q37vn9" name="&#10;AAI&#10;Create&#10;(srv instance)&#10;" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_012h7yx</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1tkgqu3</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def ddsi = new DoCreateE2EServiceInstance()
-ddsi.createServiceInstance(execution)]]></bpmn2:script>
+ddsi.createServiceInstance(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_0bq4fxs" name="Go to Decompose_Service">
<bpmn2:incoming>SequenceFlow_0w9t6tc</bpmn2:incoming>
@@ -66,9 +66,9 @@ ddsi.createServiceInstance(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ScriptTask_1o01d7d" name="PostProcess&#10;Decompose&#10;Service&#10;" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0xjwb45</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_012h7yx</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new DoCreateE2EServiceInstance()
-dcsi.processDecomposition(execution)]]></bpmn2:script>
+dcsi.processDecomposition(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:callActivity id="CallActivity_0biblpc" name="Call Decompose Service" calledElement="DecomposeService">
<bpmn2:extensionElements>
@@ -85,9 +85,9 @@ dcsi.processDecomposition(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ScriptTask_1cllqk3" name="Prepare&#10;Decompose&#10;Service&#10;" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_166w91p</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0qxzgvq</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new DoCreateE2EServiceInstance()
-dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
+dcsi.prepareDecomposeService(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_0tv85pg" name="Decompose_Service">
<bpmn2:outgoing>SequenceFlow_166w91p</bpmn2:outgoing>
@@ -111,9 +111,9 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ScriptTask_1rzf8a1" name="Prepare Resource Oper Status" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_1y9rkfr</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0n7nbx3</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def ddsi = new DoCreateE2EServiceInstance()
-ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script>
+ddsi.preInitResourcesOperStatus(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:serviceTask id="ServiceTask_1asgesv" name="Init Resource Oper Status">
<bpmn2:extensionElements>
@@ -154,6 +154,7 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script>
<camunda:in source="serviceDecomposition" target="serviceDecomposition" />
<camunda:in source="uuiRequest" target="uuiRequest" />
<camunda:in source="msoRequestId" target="msoRequestId" />
+ <camunda:out source="serviceDecomposition" target="serviceDecomposition" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0b1dsaj</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0sphcy5</bpmn2:outgoing>
@@ -161,16 +162,16 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ScriptTask_0ns08tn" name="PreProcess for Add Resources" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_022onug</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0b1dsaj</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def csi = new DoCreateE2EServiceInstance()
-csi.preProcessForAddResource(execution)]]></bpmn2:script>
+csi.preProcessForAddResource(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_19t13rd" name="PostProcess for Add Resource" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0sphcy5</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_18gnns6</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def csi = new DoCreateE2EServiceInstance()
-csi.postProcessForAddResource(execution)]]></bpmn2:script>
+csi.postProcessForAddResource(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:endEvent id="EndEvent_1x4kvfh">
<bpmn2:incoming>SequenceFlow_18gnns6</bpmn2:incoming>
@@ -178,16 +179,16 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script>
<bpmn2:scriptTask id="ScriptTask_0jxdler" name="Process Site Location" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0yuzaen</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1y9rkfr</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new DoCreateE2EServiceInstance()
-dcsi.doProcessSiteLocation(execution)]]></bpmn2:script>
+dcsi.doProcessSiteLocation(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_0ts3c3b" name="Process Link TP Resource Allocation" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0ckto7v</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_022onug</bpmn2:outgoing>
- <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi= new DoCreateE2EServiceInstance()
-dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
+dcsi.doTPResourcesAllocation(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1y9rkfr" sourceRef="ScriptTask_0jxdler" targetRef="ScriptTask_1rzf8a1" />
<bpmn2:sequenceFlow id="SequenceFlow_0n7nbx3" sourceRef="ScriptTask_1rzf8a1" targetRef="ServiceTask_1asgesv" />
@@ -230,15 +231,15 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
<dc:Bounds x="409" y="920" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0eumzpf_di" bpmnElement="SequenceFlow_0eumzpf">
- <di:waypoint xsi:type="dc:Point" x="509" y="960" />
- <di:waypoint xsi:type="dc:Point" x="577" y="960" />
+ <di:waypoint x="509" y="960" />
+ <di:waypoint x="577" y="960" />
<bpmndi:BPMNLabel>
<dc:Bounds x="498" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0tgrn11_di" bpmnElement="SequenceFlow_0tgrn11">
- <di:waypoint xsi:type="dc:Point" x="147" y="960" />
- <di:waypoint xsi:type="dc:Point" x="246" y="960" />
+ <di:waypoint x="147" y="960" />
+ <di:waypoint x="246" y="960" />
<bpmndi:BPMNLabel>
<dc:Bounds x="152" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -250,8 +251,8 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
<dc:Bounds x="246" y="920" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1lqktwf_di" bpmnElement="SequenceFlow_1lqktwf">
- <di:waypoint xsi:type="dc:Point" x="346" y="960" />
- <di:waypoint xsi:type="dc:Point" x="409" y="960" />
+ <di:waypoint x="346" y="960" />
+ <di:waypoint x="409" y="960" />
<bpmndi:BPMNLabel>
<dc:Bounds x="333" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -260,10 +261,10 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
<dc:Bounds x="577" y="920" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1xzgv5k_di" bpmnElement="SequenceFlow_1xzgv5k">
- <di:waypoint xsi:type="dc:Point" x="677" y="960" />
- <di:waypoint xsi:type="dc:Point" x="709" y="960" />
- <di:waypoint xsi:type="dc:Point" x="709" y="960" />
- <di:waypoint xsi:type="dc:Point" x="744" y="960" />
+ <di:waypoint x="677" y="960" />
+ <di:waypoint x="709" y="960" />
+ <di:waypoint x="709" y="960" />
+ <di:waypoint x="744" y="960" />
<bpmndi:BPMNLabel>
<dc:Bounds x="679" y="960" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -290,29 +291,29 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0xjwb45_di" bpmnElement="SequenceFlow_0xjwb45">
- <di:waypoint xsi:type="dc:Point" x="569" y="146" />
- <di:waypoint xsi:type="dc:Point" x="704" y="146" />
+ <di:waypoint x="569" y="146" />
+ <di:waypoint x="704" y="146" />
<bpmndi:BPMNLabel>
<dc:Bounds x="592" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0qxzgvq_di" bpmnElement="SequenceFlow_0qxzgvq">
- <di:waypoint xsi:type="dc:Point" x="287" y="146" />
- <di:waypoint xsi:type="dc:Point" x="469" y="146" />
+ <di:waypoint x="287" y="146" />
+ <di:waypoint x="469" y="146" />
<bpmndi:BPMNLabel>
<dc:Bounds x="333" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1qiiycn_di" bpmnElement="SequenceFlow_1qiiycn">
- <di:waypoint xsi:type="dc:Point" x="45" y="-4" />
- <di:waypoint xsi:type="dc:Point" x="117" y="-4" />
+ <di:waypoint x="45" y="-4" />
+ <di:waypoint x="117" y="-4" />
<bpmndi:BPMNLabel>
<dc:Bounds x="36" y="-25" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_166w91p_di" bpmnElement="SequenceFlow_166w91p">
- <di:waypoint xsi:type="dc:Point" x="53" y="146" />
- <di:waypoint xsi:type="dc:Point" x="187" y="146" />
+ <di:waypoint x="53" y="146" />
+ <di:waypoint x="187" y="146" />
<bpmndi:BPMNLabel>
<dc:Bounds x="75" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
@@ -324,19 +325,19 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1tkgqu3_di" bpmnElement="SequenceFlow_1tkgqu3">
- <di:waypoint xsi:type="dc:Point" x="1112" y="146" />
- <di:waypoint xsi:type="dc:Point" x="1222" y="146" />
- <di:waypoint xsi:type="dc:Point" x="1222" y="146" />
- <di:waypoint xsi:type="dc:Point" x="1306" y="146" />
+ <di:waypoint x="1112" y="146" />
+ <di:waypoint x="1222" y="146" />
+ <di:waypoint x="1222" y="146" />
+ <di:waypoint x="1306" y="146" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1192" y="140" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0w9t6tc_di" bpmnElement="SequenceFlow_0w9t6tc">
- <di:waypoint xsi:type="dc:Point" x="217" y="-4" />
- <di:waypoint xsi:type="dc:Point" x="762" y="-4" />
- <di:waypoint xsi:type="dc:Point" x="762" y="-4" />
- <di:waypoint xsi:type="dc:Point" x="1306" y="-4" />
+ <di:waypoint x="217" y="-4" />
+ <di:waypoint x="762" y="-4" />
+ <di:waypoint x="762" y="-4" />
+ <di:waypoint x="1306" y="-4" />
<bpmndi:BPMNLabel>
<dc:Bounds x="732" y="-10" width="90" height="12" />
</bpmndi:BPMNLabel>
@@ -348,10 +349,10 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_012h7yx_di" bpmnElement="SequenceFlow_012h7yx">
- <di:waypoint xsi:type="dc:Point" x="804" y="146" />
- <di:waypoint xsi:type="dc:Point" x="917" y="146" />
- <di:waypoint xsi:type="dc:Point" x="917" y="146" />
- <di:waypoint xsi:type="dc:Point" x="1012" y="146" />
+ <di:waypoint x="804" y="146" />
+ <di:waypoint x="917" y="146" />
+ <di:waypoint x="917" y="146" />
+ <di:waypoint x="1012" y="146" />
<bpmndi:BPMNLabel>
<dc:Bounds x="887" y="139" width="90" height="14" />
</bpmndi:BPMNLabel>
@@ -384,61 +385,61 @@ dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
<dc:Bounds x="599" y="260" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1y9rkfr_di" bpmnElement="SequenceFlow_1y9rkfr">
- <di:waypoint xsi:type="dc:Point" x="188" y="300" />
- <di:waypoint xsi:type="dc:Point" x="262" y="300" />
+ <di:waypoint x="188" y="300" />
+ <di:waypoint x="262" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="180" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0n7nbx3_di" bpmnElement="SequenceFlow_0n7nbx3">
- <di:waypoint xsi:type="dc:Point" x="362" y="300" />
- <di:waypoint xsi:type="dc:Point" x="433" y="300" />
+ <di:waypoint x="362" y="300" />
+ <di:waypoint x="433" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="353.5" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0ckto7v_di" bpmnElement="SequenceFlow_0ckto7v">
- <di:waypoint xsi:type="dc:Point" x="533" y="300" />
- <di:waypoint xsi:type="dc:Point" x="599" y="300" />
+ <di:waypoint x="533" y="300" />
+ <di:waypoint x="599" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="521" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0b1dsaj_di" bpmnElement="SequenceFlow_0b1dsaj">
- <di:waypoint xsi:type="dc:Point" x="885" y="300" />
- <di:waypoint xsi:type="dc:Point" x="957" y="300" />
+ <di:waypoint x="885" y="300" />
+ <di:waypoint x="957" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="876" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0sphcy5_di" bpmnElement="SequenceFlow_0sphcy5">
- <di:waypoint xsi:type="dc:Point" x="1057" y="300" />
- <di:waypoint xsi:type="dc:Point" x="1131" y="300" />
+ <di:waypoint x="1057" y="300" />
+ <di:waypoint x="1131" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1049" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_022onug_di" bpmnElement="SequenceFlow_022onug">
- <di:waypoint xsi:type="dc:Point" x="699" y="300" />
- <di:waypoint xsi:type="dc:Point" x="785" y="300" />
+ <di:waypoint x="699" y="300" />
+ <di:waypoint x="785" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="697" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_18gnns6_di" bpmnElement="SequenceFlow_18gnns6">
- <di:waypoint xsi:type="dc:Point" x="1231" y="300" />
- <di:waypoint xsi:type="dc:Point" x="1301" y="300" />
+ <di:waypoint x="1231" y="300" />
+ <di:waypoint x="1301" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1221" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0yuzaen_di" bpmnElement="SequenceFlow_0yuzaen">
- <di:waypoint xsi:type="dc:Point" x="54" y="300" />
- <di:waypoint xsi:type="dc:Point" x="88" y="300" />
+ <di:waypoint x="54" y="300" />
+ <di:waypoint x="88" y="300" />
<bpmndi:BPMNLabel>
<dc:Bounds x="71" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
-</bpmn2:definitions> \ No newline at end of file
+</bpmn2:definitions>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java
new file mode 100644
index 0000000000..b885cc2ee5
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTask.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+@Component
+public class MonitorInstantiateVnfmNodeTask extends MonitorVnfmNodeTask {
+
+ @Autowired
+ public MonitorInstantiateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB,
+ final ExceptionBuilder exceptionUtil, final AAIVnfResources aaiVnfResources) {
+ super(extractPojosForBB, exceptionUtil, aaiVnfResources);
+ }
+
+ @Override
+ public String getNodeStatusVariableName() {
+ return CREATE_VNF_NODE_STATUS;
+ }
+
+ @Override
+ public boolean isOrchestrationStatusValid(final String orchestrationStatus) {
+ return VNF_CREATED.equalsIgnoreCase(orchestrationStatus);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java
new file mode 100644
index 0000000000..34296c20d6
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTask.java
@@ -0,0 +1,53 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
+import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
+import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+@Component
+public class MonitorTerminateVnfmNodeTask extends MonitorVnfmNodeTask {
+
+ @Autowired
+ public MonitorTerminateVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil,
+ final AAIVnfResources aaiVnfResources) {
+ super(extractPojosForBB, exceptionUtil, aaiVnfResources);
+ }
+
+ @Override
+ public String getNodeStatusVariableName() {
+ return DELETE_VNF_NODE_STATUS;
+ }
+
+ @Override
+ public boolean isOrchestrationStatusValid(final String orchestrationStatus) {
+ return VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
index 4645680fc2..4c84bcaa1f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmCreateJobTask.java
@@ -55,11 +55,18 @@ public class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask {
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
*/
public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
- LOGGER.debug("Executing getCurrentOperationStatus ...");
- final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
- execution.setVariable(OPERATION_STATUS_PARAM_NAME,
- getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
- LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ try {
+ LOGGER.debug("Executing getCurrentOperationStatus ...");
+ final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
+ execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+ getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
+ LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ } catch (final Exception exception) {
+ final String message = "Unable to invoke get current Operation status";
+ LOGGER.error(message);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message);
+
+ }
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
index e91f362d53..34e3efa8f5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmDeleteJobTask.java
@@ -56,10 +56,18 @@ public class MonitorVnfmDeleteJobTask extends MonitorVnfmJobTask {
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
*/
public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
- LOGGER.debug("Executing getCurrentOperationStatus ...");
- final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
- execution.setVariable(OPERATION_STATUS_PARAM_NAME, getOperationStatus(execution, deleteVnfResponse.getJobId()));
- LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ try {
+ LOGGER.debug("Executing getCurrentOperationStatus ...");
+ final DeleteVnfResponse deleteVnfResponse = execution.getVariable(Constants.DELETE_VNF_RESPONSE_PARAM_NAME);
+ execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+ getOperationStatus(execution, deleteVnfResponse.getJobId()));
+ LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+ } catch (final Exception exception) {
+ final String message = "Unable to invoke get current Operation status";
+ LOGGER.error(message);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1216, message);
+
+ }
}
/**
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
index 65b05e21f5..a7a4eadb33 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeTask.java
@@ -19,38 +19,39 @@
*/
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
import static org.onap.so.bpmn.servicedecomposition.entities.ResourceKey.GENERIC_VNF_ID;
+import java.util.Optional;
import org.onap.aai.domain.yang.GenericVnf;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception.GenericVnfNotFoundException;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.orchestration.AAIVnfResources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
/**
*
* @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-@Component
-public class MonitorVnfmNodeTask {
+public abstract class MonitorVnfmNodeTask {
private static final Logger LOGGER = LoggerFactory.getLogger(MonitorVnfmNodeTask.class);
private final ExtractPojosForBB extractPojosForBB;
private final ExceptionBuilder exceptionUtil;
+ private final AAIVnfResources aaiVnfResources;
@Autowired
- public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil) {
+ public MonitorVnfmNodeTask(final ExtractPojosForBB extractPojosForBB, final ExceptionBuilder exceptionUtil,
+ final AAIVnfResources aaiVnfResources) {
this.exceptionUtil = exceptionUtil;
this.extractPojosForBB = extractPojosForBB;
+ this.aaiVnfResources = aaiVnfResources;
}
/**
@@ -61,11 +62,23 @@ public class MonitorVnfmNodeTask {
public void getNodeStatus(final BuildingBlockExecution execution) {
try {
LOGGER.debug("Executing getNodeStatus ...");
- final GenericVnf vnf = extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
- String orchestrationStatus = vnf.getOrchestrationStatus();
- LOGGER.debug("Orchestration Status in AAI {}", orchestrationStatus);
- execution.setVariable(CREATE_VNF_NODE_STATUS, VNF_CREATED.equalsIgnoreCase(orchestrationStatus));
- execution.setVariable(DELETE_VNF_NODE_STATUS, VNF_ASSIGNED.equalsIgnoreCase(orchestrationStatus));
+
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf =
+ extractPojosForBB.extractByKey(execution, GENERIC_VNF_ID);
+
+ final String vnfId = vnf.getVnfId();
+ LOGGER.debug("Query A&AI for generic VNF using vnfID: {}", vnfId);
+ final Optional<GenericVnf> aaiGenericVnfOptional = aaiVnfResources.getGenericVnf(vnfId);
+
+ if (!aaiGenericVnfOptional.isPresent()) {
+ throw new GenericVnfNotFoundException("Unable to find generic vnf in A&AI using vnfID: " + vnfId);
+ }
+ final GenericVnf genericVnf = aaiGenericVnfOptional.get();
+ final String orchestrationStatus = genericVnf.getOrchestrationStatus();
+ LOGGER.debug("Found generic vnf with orchestration status : {}", orchestrationStatus);
+
+ execution.setVariable(getNodeStatusVariableName(), isOrchestrationStatusValid(orchestrationStatus));
+
} catch (final Exception exception) {
LOGGER.error("Unable to get vnf from AAI", exception);
exceptionUtil.buildAndThrowWorkflowException(execution, 1220, exception);
@@ -73,6 +86,20 @@ public class MonitorVnfmNodeTask {
}
/**
+ * Get variable to store in execution context
+ *
+ * @return the variable name
+ */
+ public abstract String getNodeStatusVariableName();
+
+ /**
+ * @param orchestrationStatus the orchestration status from A&AI
+ * @return true if valid
+ */
+ public abstract boolean isOrchestrationStatusValid(final String orchestrationStatus);
+
+
+ /**
* Log and throw exception on timeout for job status
*
* @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
index f193967a32..4a51891184 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java
@@ -145,7 +145,7 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide
return Optional.of(response.getBody());
} catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) {
LOGGER.error("Unexpected error while processing job request", httpInvocationException);
- return Optional.absent();
+ throw httpInvocationException;
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java
new file mode 100644
index 0000000000..d33d0bc895
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/exception/GenericVnfNotFoundException.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Ericsson. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.exception;
+
+/**
+ * @author waqas.ikram@est.tech
+ *
+ */
+public class GenericVnfNotFoundException extends Exception {
+ private static final long serialVersionUID = -2049370314818025597L;
+
+ public GenericVnfNotFoundException(final String message) {
+ super(message);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
index 94e95687db..b0ba0595d5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
@@ -205,14 +205,22 @@ public class VnfAdapterVfModuleObjectMapper {
private void buildDirectivesParamFromMap(Map<String, Object> paramsMap, String directive,
Map<String, Object> srcMap) {
StringBuilder directives = new StringBuilder();
- if (srcMap.size() > 0) {
+ int no_directives_size = 0;
+ if (directives.equals(MsoMulticloudUtils.USER_DIRECTIVES)
+ && srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) {
+ no_directives_size = 1;
+ }
+ if (srcMap.size() > no_directives_size) {
directives.append("{ \"attributes\": [ ");
int i = 0;
for (String attributeName : srcMap.keySet()) {
- directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
- if (i < (srcMap.size() - 1))
- directives.append(", ");
- i++;
+ if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directives)
+ && attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) {
+ directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString()));
+ if (i < (srcMap.size() - 1 + no_directives_size))
+ directives.append(", ");
+ i++;
+ }
}
directives.append("] }");
} else {
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java
new file mode 100644
index 0000000000..effcf24a8d
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorInstantiateVnfmNodeTaskTest.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
+
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
+import java.util.Optional;
+import java.util.UUID;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.onap.aai.domain.yang.GenericVnf;
+import org.onap.so.bpmn.BaseTaskTest;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.client.orchestration.AAIVnfResources;
+
+/**
+ *
+ * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
+ *
+ */
+public class MonitorInstantiateVnfmNodeTaskTest extends BaseTaskTest {
+
+ private static final String VNF_ID = UUID.randomUUID().toString();
+
+ private static final String VNF_NAME = "VNF_NAME";
+
+ private MonitorVnfmNodeTask objUnderTest;
+
+ @Mock
+ private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+
+ @Mock
+ private AAIVnfResources mockedAaiVnfResources;
+
+ private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
+
+ @Before
+ public void setUp() {
+ objUnderTest = getEtsiVnfMonitorNodeJobTask();
+ }
+
+ @Test
+ public void testGetNodeStatus_genericVnfWithOrchStatusCreated_executionVariableSetToCreate() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+ final GenericVnf aaiGenericVnf = getAAIGenericVnf();
+ aaiGenericVnf.setOrchestrationStatus(VNF_CREATED);
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf));
+ objUnderTest.getNodeStatus(stubbedxecution);
+ assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+ }
+
+ @Test
+ public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty());
+ objUnderTest.getNodeStatus(stubbedxecution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
+ any(Exception.class));
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+
+ }
+
+ @Test
+ public void testGetNodeStatusException() throws Exception {
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ objUnderTest.getNodeStatus(stubbedxecution);
+ assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
+ any(Exception.class));
+ }
+
+ @Test
+ public void testTimeOutLogFailue() throws Exception {
+ objUnderTest.timeOutLogFailue(stubbedxecution);
+ verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221),
+ eq("Node operation time out"));
+ }
+
+ private GenericVnf getAAIGenericVnf() {
+ final GenericVnf genericVnf = new GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ genericVnf.setVnfName(VNF_NAME);
+ return genericVnf;
+ }
+
+ private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ return genericVnf;
+
+ }
+
+ private MonitorInstantiateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
+ return new MonitorInstantiateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources);
+ }
+
+}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java
index 6b84f6a918..04831733e1 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorVnfmNodeJobTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/MonitorTerminateVnfmNodeTaskTest.java
@@ -20,16 +20,15 @@
package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.CREATE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_CREATED;
-import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.DELETE_VNF_NODE_STATUS;
+import static org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.Constants.VNF_ASSIGNED;
+import java.util.Optional;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
@@ -38,13 +37,14 @@ import org.onap.aai.domain.yang.GenericVnf;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.client.orchestration.AAIVnfResources;
/**
*
- * @author Lathishbabu Ganesan (lathishbabu.ganesan@est.tech)
+ * @author Waqas Ikram (waqas.ikram@est.tech)
*
*/
-public class MonitorVnfmNodeJobTest extends BaseTaskTest {
+public class MonitorTerminateVnfmNodeTaskTest extends BaseTaskTest {
private static final String VNF_ID = UUID.randomUUID().toString();
@@ -55,6 +55,9 @@ public class MonitorVnfmNodeJobTest extends BaseTaskTest {
@Mock
private VnfmAdapterServiceProvider mockedVnfmAdapterServiceProvider;
+ @Mock
+ private AAIVnfResources mockedAaiVnfResources;
+
private final BuildingBlockExecution stubbedxecution = new StubbedBuildingBlockExecution();
@Before
@@ -63,49 +66,48 @@ public class MonitorVnfmNodeJobTest extends BaseTaskTest {
}
@Test
- public void testGetNodeStatusCreate() throws Exception {
- GenericVnf vnf = getGenericVnf();
- vnf.setOrchestrationStatus(VNF_CREATED);
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
- objUnderTest.getNodeStatus(stubbedxecution);
- assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
- }
-
- @Test
public void testGetNodeStatusDelete() throws Exception {
- GenericVnf vnf = getGenericVnf();
- vnf.setOrchestrationStatus(VNF_ASSIGNED);
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+ final GenericVnf aaiGenericVnf = getAAIGenericVnf();
+ aaiGenericVnf.setOrchestrationStatus(VNF_ASSIGNED);
+
when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf));
+
objUnderTest.getNodeStatus(stubbedxecution);
assertTrue(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
}
@Test
- public void testGetNodeStatusException() throws Exception {
- when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenThrow(RuntimeException.class);
+ public void testGetNodeStatus_noGenericVnfFoundInAAI_throwException() throws Exception {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
+
+ when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
+ when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.empty());
objUnderTest.getNodeStatus(stubbedxecution);
- assertNull(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
- assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1220),
any(Exception.class));
- }
+ assertNull(stubbedxecution.getVariable(DELETE_VNF_NODE_STATUS));
- @Test
- public void testTimeOutLogFailue() throws Exception {
- objUnderTest.timeOutLogFailue(stubbedxecution);
- verify(exceptionUtil).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(1221),
- eq("Node operation time out"));
}
- private GenericVnf getGenericVnf() {
+ private GenericVnf getAAIGenericVnf() {
final GenericVnf genericVnf = new GenericVnf();
genericVnf.setVnfId(VNF_ID);
genericVnf.setVnfName(VNF_NAME);
return genericVnf;
}
- private MonitorVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
- return new MonitorVnfmNodeTask(extractPojosForBB, exceptionUtil);
+ private org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf getGenericVnf() {
+ final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf genericVnf =
+ new org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf();
+ genericVnf.setVnfId(VNF_ID);
+ return genericVnf;
+
+ }
+
+ private MonitorTerminateVnfmNodeTask getEtsiVnfMonitorNodeJobTask() {
+ return new MonitorTerminateVnfmNodeTask(extractPojosForBB, exceptionUtil, mockedAaiVnfResources);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
index 7bd6435b60..e94d7c2923 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImplTest.java
@@ -228,7 +228,7 @@ public class VnfmAdapterServiceProviderImplTest {
assertFalse(actual.isPresent());
}
- @Test
+ @Test(expected = RestProcessingException.class)
public void testGetInstantiateOperationJobStatus_Exception() {
when(mockedHttpServiceProvider.getHttpResponse(eq(TestConstants.JOB_STATUS_EXPECTED_URL),
@@ -237,8 +237,7 @@ public class VnfmAdapterServiceProviderImplTest {
final VnfmAdapterServiceProvider objUnderTest =
new VnfmAdapterServiceProviderImpl(getVnfmAdapterUrlProvider(), mockedHttpServiceProvider);
- final Optional<QueryJobResponse> actual = objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
- assertFalse(actual.isPresent());
+ objUnderTest.getInstantiateOperationJobStatus(DUMMY_JOB_ID);
}
private QueryJobResponse getQueryJobResponse() {
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java
index e7ace2cda5..b5da55c7d6 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java
@@ -27,7 +27,7 @@ import org.hibernate.annotations.NotFoundAction;
import uk.co.blackpepper.bowman.annotation.LinkedResource;
@Entity
-@Table(name = "ACTIVITY_SPEC_CATEGORIES")
+@Table(name = "activity_spec_categories")
public class ActivitySpecCategories implements Serializable {
private static final long serialVersionUID = -6251150462067699643L;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java
index 5173f27a15..ed056400b2 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java
@@ -17,7 +17,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import com.openpojo.business.annotation.BusinessKey;
@Entity
-@Table(name = "ACTIVITY_SPEC_PARAMETERS")
+@Table(name = "activity_spec_parameters")
public class ActivitySpecParameters implements Serializable {
private static final long serialVersionUID = 3627711377147710046L;
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java
index f49ae26305..92cc5d18f0 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java
@@ -44,7 +44,7 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource;
@Entity
@IdClass(VnfResourceWorkflowId.class)
-@Table(name = "VNF_RESOURCE_TO_WORKFLOW")
+@Table(name = "vnf_resource_to_workflow")
public class VnfResourceWorkflow implements Serializable {
private static final long serialVersionUID = -1326433350241927676L;