2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.oran.otf.camunda.exception;
\r
23 import java.io.Serializable;
\r
26 * An object that represents a workflow exception.
\r
28 public class WorkflowException implements Serializable {
\r
30 private static final long serialVersionUID = 1L;
\r
32 private final String processKey;
\r
33 private final int errorCode;
\r
34 private final String errorMessage;
\r
35 private final String workStep;
\r
40 * @param processKey the process key for the process that generated the exception
\r
41 * @param errorCode the numeric error code (normally 1xxx or greater)
\r
42 * @param errorMessage a short error message
\r
44 public WorkflowException(String processKey, int errorCode, String errorMessage) {
\r
45 this.processKey = processKey;
\r
46 this.errorCode = errorCode;
\r
47 this.errorMessage = errorMessage;
\r
51 public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep) {
\r
52 this.processKey = processKey;
\r
53 this.errorCode = errorCode;
\r
54 this.errorMessage = errorMessage;
\r
55 this.workStep = workStep;
\r
59 * Returns the process key.
\r
61 public String getProcessKey() {
\r
66 * Returns the error code.
\r
68 public int getErrorCode() {
\r
73 * Returns the error message.
\r
75 public String getErrorMessage() {
\r
76 return errorMessage;
\r
80 * Returns the error message.
\r
82 public String getWorkStep() {
\r
87 * Returns a string representation of this object.
\r
90 public String toString() {
\r
91 return getClass().getSimpleName() + "[processKey=" + getProcessKey() + ",errorCode="
\r
93 + ",errorMessage=" + getErrorMessage() + ",workStep=" + getWorkStep() + "]";
\r