summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java6
2 files changed, 15 insertions, 12 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 ");
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
index a6e29227a0..a0a47a1d16 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java
@@ -31,7 +31,7 @@ import javax.annotation.PostConstruct;
import org.junit.Rule;
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.slf4j.Logger;
@@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
-public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
+public class GrpcNettyServer extends BluePrintProcessingServiceImplBase {
private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class);
@@ -60,7 +60,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase {
@PostConstruct
public void start() throws IOException {
- final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() {
+ final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() {
@Override
public StreamObserver<ExecutionServiceInput> process(
StreamObserver<ExecutionServiceOutput> responseObserver) {