summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-11-20 13:28:27 +0000
committerGerrit Code Review <gerrit@onap.org>2020-11-20 13:28:27 +0000
commit022405974f42fc183d8de46a603a1049dfb2ee15 (patch)
treee34c31c1233a1dfcf4771ca2de1b233f9b84d0f9 /controlloop/common/eventmanager/src/main
parent03c9f7be0e81f39f71c5ba87a77448a726db06db (diff)
parent3d776b9d24b73b366b2f1e70b6c536e4d2705202 (diff)
Merge "Delete preprocessed flag from actors"
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() + ")";