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.openecomp.mso.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;
37 * @param processKey the process key for the process that generated the exception
38 * @param errorCode the numeric error code (normally 1xxx or greater)
39 * @param errorMessage a short error message
41 public WorkflowException(String processKey, int errorCode,
42 String errorMessage) {
43 this.processKey = processKey;
44 this.errorCode = errorCode;
45 this.errorMessage = errorMessage;
49 * Returns the process key.
51 public String getProcessKey() {
56 * Returns the error code.
58 public int getErrorCode() {
63 * Returns the error message.
65 public String getErrorMessage() {
70 * Returns a string representation of this object.
72 public String toString() {
73 StringBuilder out = new StringBuilder();
74 out.append(getClass().getSimpleName());
75 out.append("[processKey=");
76 out.append(getProcessKey());
77 out.append(",errorCode=");
78 out.append(getErrorCode());
79 out.append(",errorMessage=");
80 out.append(getErrorMessage());
82 return out.toString();