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