WebLogic Integration


com.bea.wlpi.common
Class WorkflowException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.bea.wlpi.common.WorkflowException
Direct Known Subclasses:
EvaluatorException, PluginException

public class WorkflowException
extends java.lang.Exception

Encapsulates exceptions encountered when executing a remote EJB call. WorkflowException is thrown in 3 different situations:

1. On a system error (i.e., rethrown exception).
2. On a workflow error (i.e., illegal workflow situation such as an inconsistent state).
3. On a non-fatal workflow error.

WorkflowException has constructors that take a nested exception and others that take a message code to support internationalization of server exception messages.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Messages, Serialized Form

Field Summary
static int ERROR_CUSTOM
          A custom error raised either by an application calling WorkflowProcessor.invokeWorkfowErrorHandler, or by a workflow executing the 'Invoke Error handler' action.
static int ERROR_SYSTEM
          A fatal exception occurred while processing a user request.
static int ERROR_UNKNOWN
          Unknown error type - internal use only.
static int ERROR_WORKFLOW
          A fatal, illegal condition such as inconsistent workflow state.
static int WARNING_WORKFLOW
          A non-fatal workflow condition that the user can rectify manually.
 
Constructor Summary
WorkflowException(java.lang.Exception e)
          Construct a new WorkflowException containing a nested exception.
WorkflowException(java.lang.Exception e, int severity)
          Construct a new WorkflowException containing a nested exception.
WorkflowException(java.lang.Exception e, int msgNum, int severity)
          Construct a new WorkflowException containing a nested exception.
WorkflowException(java.lang.Exception e, int msgNum, java.lang.Object[] args)
          Construct a new WorkflowException containing a nested exception.
WorkflowException(java.lang.Exception e, int msgNum, java.lang.Object[] args, int severity)
          Construct a new WorkflowException containing a nested exception.
WorkflowException(int msgNum)
          Construct a new WorkflowException with the specified error code.
WorkflowException(int msgNum, int severity)
          Construct a new WorkflowException with the specified error code.
WorkflowException(int msgNum, java.lang.Object[] args)
          Construct a new WorkflowException with the specified error code.
WorkflowException(int msgNum, java.lang.Object[] args, int severity)
          Construct a new WorkflowException with the specified error code.
WorkflowException(int msgNum, java.lang.Object[] args, int severity, java.lang.String origin)
          Construct a new WorkflowException with the specified error code.
 
Method Summary
 java.lang.String getLocalizedMessage()
          As for getMessage() but in the locale of the calling system.
static java.lang.String getLocalizedMessage(int msgNum, java.lang.Object[] args)
          Create a localized message with parameter values substituted.
 java.lang.String getLocalizedSeverityDescription()
          Return a string to indicate the severity of the exception.
 java.lang.String getMessage()
          Return the error message string of this object.
 int getMessageNumber()
          Return the exception message number.
 java.lang.Exception getNestedException()
          Return the nested exception (null if none).
 java.lang.String getOrigin()
          Return the name of the workflow component from which this exception originated.
 java.lang.Exception getOriginalException()
          Return the original exception.
static java.lang.Exception getOriginalException(java.lang.Exception e)
          Return the innermost nested exception.
 int getSeverity()
          Return the exception severity code.
 java.lang.String getSeverityDescription()
          Return a string to indicate the severity of the exception.
 boolean isDeadlock()
          Whether this exception resulted from a database deadlock.
static boolean isDeadlock(java.lang.Exception e)
          Whether an exception resulted from a database deadlock.
 void printStackTrace()
          Print this exception and its backtrace to the standard error stream.
 void printStackTrace(java.io.PrintStream stream)
          Print this exception and its backtrace to the specified print stream.
 void printStackTrace(java.io.PrintWriter writer)
          Print this exception and its backtrace to the specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_UNKNOWN

public static final int ERROR_UNKNOWN
Unknown error type - internal use only.

ERROR_SYSTEM

public static final int ERROR_SYSTEM
A fatal exception occurred while processing a user request.

ERROR_WORKFLOW

public static final int ERROR_WORKFLOW
A fatal, illegal condition such as inconsistent workflow state.

WARNING_WORKFLOW

public static final int WARNING_WORKFLOW
A non-fatal workflow condition that the user can rectify manually.

ERROR_CUSTOM

public static final int ERROR_CUSTOM
A custom error raised either by an application calling WorkflowProcessor.invokeWorkfowErrorHandler, or by a workflow executing the 'Invoke Error handler' action.
Constructor Detail

WorkflowException

public WorkflowException(java.lang.Exception e)
Construct a new WorkflowException containing a nested exception. The exception is of severity ERROR_SYSTEM, unless the nested exception is of class WorkflowException, in which case the new exception inherits its severity setting from the nested exception.

Parameters:
e - The nested exception (assumed to have been previously caught).
See Also:
WorkflowException(Exception, int)

WorkflowException

public WorkflowException(java.lang.Exception e,
                         int severity)
Construct a new WorkflowException containing a nested exception.

Parameters:
e - The nested exception (assumed to have been previously caught).
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.
See Also:
WorkflowException(Exception)

WorkflowException

public WorkflowException(java.lang.Exception e,
                         int msgNum,
                         int severity)
Construct a new WorkflowException containing a nested exception.

Parameters:
e - The nested exception (assumed to have been previously caught).
msgNum - Message number from Messages.
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.
See Also:
WorkflowException(Exception)

WorkflowException

public WorkflowException(java.lang.Exception e,
                         int msgNum,
                         java.lang.Object[] args)
Construct a new WorkflowException containing a nested exception.

Parameters:
e - The nested exception (assumed to have been previously caught).
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.
See Also:
WorkflowException(Exception)

WorkflowException

public WorkflowException(java.lang.Exception e,
                         int msgNum,
                         java.lang.Object[] args,
                         int severity)
Construct a new WorkflowException containing a nested exception.

Parameters:
e - The nested exception (assumed to have been previously caught).
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.
See Also:
WorkflowException(Exception)

WorkflowException

public WorkflowException(int msgNum)
Construct a new WorkflowException with the specified error code. The exception is of severity ERROR_WORKFLOW.

Parameters:
msgNum - Message number from Messages.

WorkflowException

public WorkflowException(int msgNum,
                         java.lang.Object[] args)
Construct a new WorkflowException with the specified error code. The exception is of severity ERROR_WORKFLOW.

Parameters:
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.

WorkflowException

public WorkflowException(int msgNum,
                         int severity)
Construct a new WorkflowException with the specified error code.

Parameters:
msgNum - Message number from Messages.
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.

WorkflowException

public WorkflowException(int msgNum,
                         java.lang.Object[] args,
                         int severity)
Construct a new WorkflowException with the specified error code.

Parameters:
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.

WorkflowException

public WorkflowException(int msgNum,
                         java.lang.Object[] args,
                         int severity,
                         java.lang.String origin)
Construct a new WorkflowException with the specified error code.

Parameters:
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.
severity - Error type: ERROR_SYSTEM, ERROR_WORKFLOW or WARNING_WORKFLOW.
origin - Name or label of workflow node in which error originated.
Since:
WebLogic Process Integrator version 1.2.
Method Detail

getMessage

public java.lang.String getMessage()
Return the error message string of this object. If this exception contains a nested exception, the message will be that of the nested exception. Otherwise, the message will be in the language of the system locale from which the exception was thrown.

Returns:
The error message string of this exception object if it was created with an error message string; or null if it was created with no error message.
Overrides:
getMessage in class java.lang.Throwable

getOrigin

public java.lang.String getOrigin()
Return the name of the workflow component from which this exception originated.

Since:
WebLogic Process Integrator version 1.2.

getMessageNumber

public int getMessageNumber()
Return the exception message number.

Returns:
Exception message number.

getLocalizedMessage

public java.lang.String getLocalizedMessage()
As for getMessage() but in the locale of the calling system.

Returns:
A localized message string if available; otherwise, in the locale of the system from which the exception was first thrown.
Overrides:
getLocalizedMessage in class java.lang.Throwable

getNestedException

public java.lang.Exception getNestedException()
Return the nested exception (null if none).

Returns:
The nested exception.

getOriginalException

public java.lang.Exception getOriginalException()
Return the original exception.

Returns:
The original exception.
See Also:
getOriginalException(Exception)

getSeverity

public int getSeverity()
Return the exception severity code.

Returns:
Exception severity code: ERROR_SYSTEM, ERROR_WORKFLOW, WARNING_WORKFLOW, ERROR_UNKNOWN or ERROR_CUSTOM.

getSeverityDescription

public java.lang.String getSeverityDescription()
Return a string to indicate the severity of the exception. This will be either "System error", "Workflow error", "Workflow warning" or "Unknown error".

See Also:
getLocalizedSeverityDescription()

getLocalizedSeverityDescription

public java.lang.String getLocalizedSeverityDescription()
Return a string to indicate the severity of the exception. This will be either "System error", "Workflow error", "Workflow warning" or "Unknown error", expressed in the language of the system locale on which the method is called.

See Also:
getSeverityDescription()

isDeadlock

public boolean isDeadlock()
Whether this exception resulted from a database deadlock.

Returns:
true if the original problem was a database deadlock.
Since:
WebLogic Process Integrator version 1.2.
See Also:
isDeadlock(Exception)

printStackTrace

public void printStackTrace()
Print this exception and its backtrace to the standard error stream. This method prints a stack trace for this object on the error output stream that is the value of the field System.err. The first line of output contains the result of the toString() method for this object. The remaining lines represent data previously recorded by the method fillInStackTrace(). If this exception contains a nested exception, the stack trace for this exception is printed as well.

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream stream)
Print this exception and its backtrace to the specified print stream.

Parameters:
stream - PrintStream to use for output.
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)
Print this exception and its backtrace to the specified print writer.

Parameters:
stream - PrintWriter to use for output.
Overrides:
printStackTrace in class java.lang.Throwable

getLocalizedMessage

public static java.lang.String getLocalizedMessage(int msgNum,
                                                   java.lang.Object[] args)
Create a localized message with parameter values substituted.

Parameters:
msgNum - Message number from Messages.
args - Arguments for substitution into localized message string.
Returns:
The localized message string.

getOriginalException

public static java.lang.Exception getOriginalException(java.lang.Exception e)
Return the innermost nested exception. The method takes account of the following exception classes that can contain a nested exception: com.bea.wlpi.common.WorkflowException, java.rmi.RemoteException, javax.ejb.EJBException, weblogic.utils.NestedThrowable.

Parameters:
e - The outermost exception.
Returns:
The innermost nested exception.

isDeadlock

public static boolean isDeadlock(java.lang.Exception e)
Whether an exception resulted from a database deadlock. The method calls getOriginalException() to retrieve the original exception (it may have been wrapped and re-thrown multiple times before being caught by the client). If the original exception is an instance of java.sql.SQLException, the implementation calls the getSQLState() method to determine whether the original problem was a database deadlock (i.e., SQLSTATE="40001").

Returns:
true if the original problem was a database deadlock.
Since:
WebLogic Process Integrator version 1.2.

WebLogic Integration

WebLogic Integration (WLI)