From 5bcf94e7e286ea9d84ebcdef65f8318f4a72111a Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 31 Mar 2020 11:29:20 +0100 Subject: Fix State Finalizer Prepare and Cleanup The prepare() and cleanup() method were not called on state finalizers for states. This review adds calls for them. Issue-ID: POLICY-2450 Change-Id: I27aec4dea51f3e22b5922c04c7b7b974fca24292 Signed-off-by: liamfallon --- .../apex/core/engine/executor/StateExecutor.java | 38 +++++++++++++--------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'core/core-engine/src/main') diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java index caaa1842b..192653930 100644 --- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java +++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +97,7 @@ public class StateExecutor implements Executor incomingParent, final AxState incomingAxState, - final ApexInternalContext incomingContext) { + final ApexInternalContext incomingContext) { // Save the state and context definition this.parent = incomingParent; this.axState = incomingAxState; @@ -108,7 +108,7 @@ public class StateExecutor implements Executor stateTaskReferenceEntry : axState.getTaskReferences() - .entrySet()) { + .entrySet()) { final AxArtifactKey taskKey = stateTaskReferenceEntry.getKey(); final AxStateTaskReference taskReference = stateTaskReferenceEntry.getValue(); @@ -125,20 +125,20 @@ public class StateExecutor implements Executor incomingValues = new TreeMap<>(); incomingValues.putAll(incomingEvent); final Map taskExecutionResultMap = - taskExecutorMap.get(taskKey).execute(executionId, executionProperties, incomingValues); + taskExecutorMap.get(taskKey).execute(executionId, executionProperties, incomingValues); final AxTask task = taskExecutorMap.get(taskKey).getSubject(); // Check if this task has direct output @@ -207,20 +211,20 @@ public class StateExecutor implements Executor