diff options
Diffstat (limited to 'participant')
3 files changed, 4 insertions, 2 deletions
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java index 02fce5548..79fef3def 100755 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandler.java @@ -267,6 +267,7 @@ public class AutomationCompositionHandler { */ private void handleUndeployState(UUID messageId, final AutomationComposition automationComposition, Integer startPhaseMsg) { + automationComposition.setCompositionTargetId(null); for (var acElement : automationComposition.getElements().values()) { int startPhase = ParticipantUtils.findStartPhase( cacheProvider.getCommonProperties(automationComposition.getInstanceId(), acElement.getId())); diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandler.java index e2e93dabb..927eaa61d 100755 --- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandler.java +++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandler.java @@ -123,7 +123,8 @@ public class AutomationCompositionOutHandler { var checkOpt = automationComposition.getElements().values().stream() .filter(acElement -> !deployState.equals(acElement.getDeployState())).findAny(); if (checkOpt.isEmpty()) { - if (DeployState.MIGRATING.equals(automationComposition.getDeployState())) { + if (DeployState.DEPLOYED.equals(automationComposition.getDeployState()) + && automationComposition.getCompositionTargetId() != null) { // migration scenario automationComposition.setCompositionId(automationComposition.getCompositionTargetId()); automationComposition.setCompositionTargetId(null); diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java index cbd236efe..a04f9079c 100755 --- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java +++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionOutHandlerTest.java @@ -231,7 +231,7 @@ class AutomationCompositionOutHandlerTest { var compositionTarget = UUID.randomUUID(); automationComposition.setCompositionTargetId(compositionTarget); - automationComposition.setDeployState(DeployState.MIGRATING); + automationComposition.setDeployState(DeployState.DEPLOYED); when(cacheProvider.getAcElementsDefinitions()).thenReturn(Map.of(compositionTarget, Map.of())); for (var element : automationComposition.getElements().values()) { |