From 3d776b9d24b73b366b2f1e70b6c536e4d2705202 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Wed, 18 Nov 2020 12:04:26 -0500 Subject: Delete preprocessed flag from actors Removed the "preprocessed" flag from the Actor parameters, now that the actors no longer have a startPreprocess() method. Also removed targetEntity from the parameters. Issue-ID: POLICY-2804 Change-Id: I13bc80e1b6bb22d8d21b176796ca062109ce6658 Signed-off-by: Jim Hahn --- .../org/onap/policy/controlloop/eventmanager/Step.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'controlloop/common/eventmanager/src/main/java') diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java index 1cbdb53b2..d406e6efe 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java @@ -30,6 +30,7 @@ import lombok.Getter; import lombok.NonNull; import org.onap.policy.controlloop.actorserviceprovider.Operation; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; +import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams; import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineUtil; import org.slf4j.Logger; @@ -190,7 +191,7 @@ public class Step { logger.warn("{}.{}: exception starting operation for {}", params.getActor(), params.getOperation(), params.getRequestId(), thrown); - OperationOutcome outcome = new PipelineUtil(params).setOutcome(params.makeOutcome(), thrown); + OperationOutcome outcome = new PipelineUtil(params).setOutcome(makeOutcome(), thrown); outcome.setStart(startTime.get()); outcome.setEnd(Instant.now()); outcome.setFinalOutcome(true); @@ -210,7 +211,7 @@ public class Step { logger.warn("{}.{}: control loop timeout for {}", params.getActor(), params.getOperation(), params.getRequestId(), thrown); - OperationOutcome outcome = new PipelineUtil(params).setOutcome(params.makeOutcome(), thrown); + OperationOutcome outcome = new PipelineUtil(params).setOutcome(makeOutcome(), thrown); outcome.setActor(ActorConstants.CL_TIMEOUT_ACTOR); outcome.setOperation(null); outcome.setStart(startTime.get()); @@ -262,6 +263,16 @@ public class Step { return params.build(); } + /** + * Makes an operation outcome, populating the target entity from the operation's + * properties. + * + * @return a new operation outcome + */ + public OperationOutcome makeOutcome() { + return params.makeOutcome(operation.getProperty(OperationProperties.AAI_TARGET_ENTITY)); + } + @Override public String toString() { return "Step(actor=" + getActorName() + ", operation=" + getOperationName() + ")"; -- cgit 1.2.3-korg