aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2021-07-28 12:56:21 +0000
committerGerrit Code Review <gerrit@onap.org>2021-07-28 12:56:21 +0000
commit3d8768d468510462c85008ded35dddc272a1b060 (patch)
tree332347fb5d78cbb605249f3455298bda123cfac1 /bpmn/so-bpmn-tasks/src
parent836d6dd0f6d03a0026cb25f5589437fd68323c17 (diff)
parent5aec6989f31a3074d65e5bea3aa203f6130c3cc1 (diff)
Merge "Fix ControllerExecutionBB flow."
Diffstat (limited to 'bpmn/so-bpmn-tasks/src')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
index 2d39cc185e..76c67eefc5 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java
@@ -21,11 +21,12 @@
*/
package org.onap.so.bpmn.infrastructure.flowspecific.tasks;
+import static org.onap.so.bpmn.infrastructure.decisionpoint.impl.camunda.controller.common.SoPropertyConstants.CONTROLLER_STATUS;
import java.util.HashMap;
import java.util.Optional;
-import org.onap.so.logger.LoggingAnchor;
import org.camunda.bpm.engine.delegate.BpmnError;
import org.onap.appc.client.lcm.model.Action;
+import org.onap.logging.filter.base.ErrorCode;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
@@ -33,9 +34,9 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.appc.ApplicationControllerAction;
import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.catalog.beans.ControllerSelectionReference;
-import org.onap.logging.filter.base.ErrorCode;
+import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -90,13 +91,12 @@ public class GenericVnfHealthCheck {
public void callAppcClient(BuildingBlockExecution execution) {
logger.trace("Start runAppcCommand ");
String appcCode = "1002";
- String appcMessage = "";
+ String appcMessage;
try {
- Action action = null;
- action = Action.valueOf(execution.getVariable("action"));
+ Action action = Action.valueOf(execution.getVariable("action"));
String msoRequestId = execution.getVariable("msoRequestId");
String vnfId = execution.getVariable("vnfId");
- Optional<String> payload = null;
+ Optional<String> payload = Optional.empty();
if (execution.getVariable("payload") != null) {
String pay = execution.getVariable("payload");
payload = Optional.of(pay);
@@ -108,7 +108,7 @@ public class GenericVnfHealthCheck {
payloadInfo.put(OAM_IP_ADDRESS, execution.getVariable(OAM_IP_ADDRESS));
payloadInfo.put(VNF_HOST_IP_ADDRESS, execution.getVariable(VNF_HOST_IP_ADDRESS));
- logger.debug("Running APP-C action: {}", action.toString());
+ logger.debug("Running APP-C action: {}", action);
logger.debug("VNFID: {}", vnfId);
// PayloadInfo contains extra information that adds on to payload before making request to appc
appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType);
@@ -134,11 +134,14 @@ public class GenericVnfHealthCheck {
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
}
+
logger.error("Error Message: " + appcMessage);
logger.error("ERROR CODE: " + appcCode);
- logger.trace("End of runAppCommand ");
if (appcCode != null && !("0").equals(appcCode)) {
exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage);
}
+
+ execution.setVariable(CONTROLLER_STATUS, "Success");
+ logger.debug("Successfully end of runAppCommand ");
}
}