summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-11-18 12:04:26 -0500
committerJim Hahn <jrh3@att.com>2020-11-18 13:56:22 -0500
commit3d776b9d24b73b366b2f1e70b6c536e4d2705202 (patch)
tree74df66d9de508147afd40d18d7d9d0891ec3cfec /controlloop/common/eventmanager/src/main
parente8369d6d3088b7b68acb987ebff432ac830a3200 (diff)
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 <jrh3@att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/main')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/Step.java15
1 files changed, 13 insertions, 2 deletions
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() + ")";