summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main
diff options
context:
space:
mode:
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() + ")";