summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java17
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json3
4 files changed, 22 insertions, 4 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
index 7945ad0174..0379e2a423 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/bpmn/BpmnInstaller.java
@@ -34,6 +34,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
@@ -45,6 +46,7 @@ import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.HttpClientBuilder;
+import org.onap.so.asdc.client.ASDCConfiguration;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
@@ -63,6 +65,9 @@ public class BpmnInstaller {
@Autowired
private Environment env;
+ @Autowired
+ private ASDCConfiguration asdcConfig;
+
public void installBpmn(String csarFilePath) {
logger.info("Deploying BPMN files from {}", csarFilePath);
try {
@@ -139,7 +144,7 @@ public class BpmnInstaller {
protected HttpEntity buildMimeMultipart(String bpmnFileName, String version) throws Exception {
FileInputStream bpmnFileStream = new FileInputStream(
- Paths.get(System.getProperty("mso.config.path"), "ASDC", version, bpmnFileName).normalize().toString());
+ Paths.get(getMsoConfigPath(), "ASDC", version, bpmnFileName).normalize().toString());
byte[] bytesToSend = IOUtils.toByteArray(bpmnFileStream);
HttpEntity requestEntity =
@@ -193,4 +198,14 @@ public class BpmnInstaller {
logger.error("Unable to open file.", e);
}
}
+
+ private String getMsoConfigPath() {
+ String msoConfigPath = System.getProperty("mso.config.path");
+ if (msoConfigPath == null) {
+ logger.info("Unable to find the system property mso.config.path, use the default configuration");
+ msoConfigPath = StringUtils.defaultString(asdcConfig.getPropertyOrNull("mso.config.defaultpath"));
+ }
+ logger.info("MSO config path is: {}", msoConfigPath);
+ return msoConfigPath;
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
index a40bf59097..ebab6ad0ac 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
@@ -226,6 +226,8 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor {
try {
getAAIClient().update(uri,payload)
+ execution.setVariable('UAAIGenVnf_updateGenericVnfResponseCode', 200)
+ execution.setVariable('UAAIGenVnf_updateGenericVnfResponse', "Success")
} catch (Exception ex) {
logger.debug('Exception occurred while executing AAI PATCH: {}', ex.getMessage(), ex)
execution.setVariable('UAAIGenVnf_updateGenericVnfResponseCode', 500)
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index e8171ac834..bba8064f7c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -175,7 +175,7 @@ public class WorkflowSpecificationsHandler {
private List<WorkflowInputParameter> buildWorkflowInputParameters(Workflow workflow) {
List<WorkflowActivitySpecSequence> workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence();
if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
Map<String, WorkflowInputParameter> workflowInputParameterMap = new HashMap<String, WorkflowInputParameter>();
for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) {
@@ -199,7 +199,7 @@ public class WorkflowSpecificationsHandler {
}
if (workflowInputParameterMap.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
List<WorkflowInputParameter> workflowInputParameterList =
workflowInputParameterMap.values().stream().collect(Collectors.toList());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
index 545fbbe26c..59bc12d92d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
@@ -122,7 +122,8 @@
"operationName": "inPlaceSoftwareUpdate",
"workflowSource": "native",
"workflowResourceTarget": "vnf"
- }
+ },
+ "workflowInputParameters": []
}
}
]