aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-09-10 23:04:51 -0400
committerElena Kuleshov <evn@att.com>2019-09-10 23:04:51 -0400
commit074027b6660fe5865ef8f360663abd03359ec21e (patch)
tree54c55a17bd109d6134446f95cfcda21a13b4d081 /bpmn/so-bpmn-tasks
parentcd7f7a357a4a85de096f3ce7b6d20d0df655af79 (diff)
Set payload to empty when it is not specified
Handle a case of non-existent payload and improve error reporting on APPC request construction Issue-ID: SO-2300 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I93a1ac8ebfcaa0e39b26130e601d3b657cbed503
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
index 3bf9720036..9c72d229b2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java
@@ -61,6 +61,7 @@ public class AppcRunTasks {
public static final String ROLLBACK_VNF_LOCK = "rollbackVnfLock";
public static final String ROLLBACK_QUIESCE_TRAFFIC = "rollbackQuiesceTraffic";
public static final String CONTROLLER_TYPE_DEFAULT = "APPC";
+ public static final String GENERIC_APPC_ERROR_CODE = "1002";
@Autowired
private ExceptionBuilder exceptionUtil;
@Autowired
@@ -159,7 +160,7 @@ public class AppcRunTasks {
HashMap<String, String> payloadInfo = buildPayloadInfo(vnfName, aicIdentity, vnfHostIpAddress, vmIdList,
vserverIdList, identityUrl, vfModuleId);
- Optional<String> payload = null;
+ Optional<String> payload = Optional.empty();
RequestParameters requestParameters = gBBInput.getRequestContext().getRequestParameters();
if (requestParameters != null) {
String pay = requestParameters.getPayload();
@@ -175,7 +176,9 @@ public class AppcRunTasks {
mapRollbackVariables(execution, action, appcCode);
} catch (Exception e) {
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION.toString(),
- "Caught exception in runAppcCommand", "BPMN", ErrorCode.UnknownError.getValue(), "APPC Error", e);
+ "Caught exception in runAppcCommand", "BPMN", ErrorCode.UnknownError.getValue(),
+ "Error on request to APPC", e);
+ appcCode = GENERIC_APPC_ERROR_CODE;
appcMessage = e.getMessage();
}