aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-09-22 15:08:34 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-22 15:08:34 +0000
commit7d39eea7a0537b4a1dd6f0d1ac9d30b268e1d91d (patch)
treebd84bd4e32f6f3ff3ec48d56bc01a86adbfd2530 /controlloop/common/eventmanager
parentb2b8f46ab3a524eae487fa932d9ceb2b884a68f5 (diff)
parent1aa30b7d83f97103097c7f5d3e4cbd2fad92f659 (diff)
Merge "Add VFC Response in Working Memory & JUNIT"
Diffstat (limited to 'controlloop/common/eventmanager')
-rw-r--r--controlloop/common/eventmanager/pom.xml7
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java23
2 files changed, 29 insertions, 1 deletions
diff --git a/controlloop/common/eventmanager/pom.xml b/controlloop/common/eventmanager/pom.xml
index e41c24bd7..57de25576 100644
--- a/controlloop/common/eventmanager/pom.xml
+++ b/controlloop/common/eventmanager/pom.xml
@@ -142,6 +142,13 @@
<version>1.1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.drools-applications</groupId>
+ <artifactId>vfc</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
index 8849a2351..ec99c1a5c 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
@@ -45,6 +45,7 @@ import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.controlloop.actor.so.SOActorServiceProvider;
import org.onap.policy.so.SOResponse;
+import org.onap.policy.vfc.VFCResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -367,8 +368,28 @@ public class ControlLoopOperationManager implements Serializable {
return PolicyResult.FAILURE;
}
+ } else if (response instanceof VFCResponse) {
+ VFCResponse vfcResponse = (VFCResponse) response;
+ if (vfcResponse.responseDescriptor.getStatus().equalsIgnoreCase("finished")) {
+ //
+ // Consider it as success
+ //
+ this.completeOperation(new Integer(1), " Success", PolicyResult.SUCCESS);
+ if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) {
+ return null;
+ }
+ return PolicyResult.SUCCESS;
+ } else {
+ //
+ // Consider it as failure
+ //
+ this.completeOperation(new Integer(1), " Failed", PolicyResult.FAILURE);
+ if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) {
+ return null;
+ }
+ return PolicyResult.FAILURE;
+ }
}
-
return null;
}