From 0e2cda138f35ee6a7a8a54c29a6c4edf07d51745 Mon Sep 17 00:00:00 2001 From: "Plummer, Brittany" Date: Fri, 5 Jul 2019 10:23:16 -0400 Subject: update bpmn to save extsystemerrorsource Added ext error source to workflow exception Updated all lines that create this exception with source Added unit tests and updated existing ones Change-Id: Id9b3b1e6e24368224214a6370ea2d450ae667bfb Issue-ID: SO-2092 Signed-off-by: Benjamin, Max (mb388a) --- .../org/onap/so/bpmn/core/WorkflowException.java | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'bpmn/MSOCoreBPMN/src') diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java index 1692045d33..7d5bb0dcf1 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java @@ -21,6 +21,7 @@ package org.onap.so.bpmn.core; import java.io.Serializable; +import org.onap.so.utils.TargetEntities; /** * An object that represents a workflow exception. @@ -32,6 +33,7 @@ public class WorkflowException implements Serializable { private final int errorCode; private final String errorMessage; private final String workStep; + private TargetEntities extSystemErrorSource; /** * Constructor @@ -47,6 +49,15 @@ public class WorkflowException implements Serializable { workStep = "*"; } + public WorkflowException(String processKey, int errorCode, String errorMessage, + TargetEntities extSystemErrorSource) { + this.processKey = processKey; + this.errorCode = errorCode; + this.errorMessage = errorMessage; + workStep = "*"; + this.extSystemErrorSource = extSystemErrorSource; + } + public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep) { this.processKey = processKey; this.errorCode = errorCode; @@ -54,6 +65,15 @@ public class WorkflowException implements Serializable { this.workStep = workStep; } + public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep, + TargetEntities extSystemErrorSource) { + this.processKey = processKey; + this.errorCode = errorCode; + this.errorMessage = errorMessage; + this.workStep = workStep; + this.extSystemErrorSource = extSystemErrorSource; + } + /** * Returns the process key. */ @@ -82,12 +102,17 @@ public class WorkflowException implements Serializable { return workStep; } + public TargetEntities getExtSystemErrorSource() { + return extSystemErrorSource; + } + /** * Returns a string representation of this object. */ @Override public String toString() { return getClass().getSimpleName() + "[processKey=" + getProcessKey() + ",errorCode=" + getErrorCode() - + ",errorMessage=" + getErrorMessage() + ",workStep=" + getWorkStep() + "]"; + + ",errorMessage=" + getErrorMessage() + ",workStep=" + getWorkStep() + ",extSystemErrorSource=" + + extSystemErrorSource + "]"; } } -- cgit 1.2.3-korg