Fix State change result of AC instances after timeout 62/135462/1
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Tue, 18 Jul 2023 12:43:11 +0000 (13:43 +0100)
committerRamesh Murugan Iyer <ramesh.murugan.iyer@est.tech>
Mon, 24 Jul 2023 09:29:45 +0000 (09:29 +0000)
If the AC operation succeeds/failed after timeout, the latest results were not updated in the database.

Issue-ID: POLICY-4769
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
Change-Id: Id849a79847f85aa96ae36cd614d045e180731ebf
(cherry picked from commit a78d8dbecaca562d900858321e70c2a9fa064ec7)

runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandler.java

index 5a2079b..df5d0ff 100644 (file)
@@ -248,10 +248,9 @@ public class SupervisionAcHandler {
             Set<Map.Entry<UUID, AcElementDeployAck>> automationCompositionResultSet,
             StateChangeResult stateChangeResult) {
         var updated = false;
-        var elementInErrors = StateChangeResult.FAILED.equals(stateChangeResult);
         boolean inProgress = !StateChangeResult.FAILED.equals(automationComposition.getStateChangeResult());
-        if (elementInErrors && inProgress) {
-            automationComposition.setStateChangeResult(StateChangeResult.FAILED);
+        if (inProgress) {
+            automationComposition.setStateChangeResult(stateChangeResult);
         }
 
         for (var acElementAck : automationCompositionResultSet) {