com.groiss.wfxml
Class WfXMLException

java.lang.Object
  extended by com.groiss.wfxml.WfXMLException

public class WfXMLException
extends java.lang.Object

This class represents WfXML exceptions as they are defined in the WfXML specification.
According to the specification, WfXML exceptions can occur in all response messages. Use the WfXMLMessage.setException(com.groiss.wfxml.WfXMLException) method if you want to return an exception in a message.
When you receive a response message and want to do something with it, you should first check if it contains an excetpion with the WfXMLMessage.getException() method.


Field Summary
static char TYPE_FATAL
           
static char TYPE_TEMP
           
static int WF_ELEMENT_MISSING
           
static int WF_INVALID_CONTEXT_DATA
           
static int WF_INVALID_KEY
           
static int WF_INVALID_NOTIFICATION_NAME
           
static int WF_INVALID_OBSERVER_FOR_RESOURCE
           
static int WF_INVALID_OPERATION_SPECIFICATION
           
static int WF_INVALID_PROCESS_DEFINITION
           
static int WF_INVALID_PROCESS_INSTANCE_KEY
           
static int WF_INVALID_REQUEST_ID
           
static int WF_INVALID_RESPONSE_REQUIRED_VALUE
           
static int WF_INVALID_RESULT_DATA
           
static int WF_INVALID_STATE_TRANSITION
           
static int WF_INVALID_VERSION
           
static int WF_INVALUD_RESULT_DATA_SET
           
static int WF_MISSING_NOTIFICATION_NAME
           
static int WF_MISSING_PROCESS_INSTANCE_KEY
           
static int WF_NO_ACCESS_TO_RESOURCE
           
static int WF_NO_AUTHORIZATION
           
static int WF_OPERATION_FAILED
           
static int WF_OTHER
          Error code for self defined errors.
static int WF_OTHER_LISTENER_VETOED
          Sub code error which is returned if a listener vetoes and a request message is not performed.
static int WF_PARSING_ERROR
           
 
Constructor Summary
WfXMLException(int mainCode, char type, java.lang.String subject)
           
 
Method Summary
 java.lang.String getDescription()
          Returns a more detailed description for the exception.
 int getMainCode()
          Returns the main code of the exception.
 int getSubCode()
          Returns the sub code.
 java.lang.String getSubject()
          Returns the subject of the exception or null if no subject is defined.
 char getType()
          Returns the exception type.
 boolean isValid()
          Checks if the obligatory values 'main code', 'subject', and 'type' are set.
 void setDescription(java.lang.String description)
          Add a description to the exception.
 void setMainCode(int code)
          Set the main code for the exception.
 void setSubCode(int code)
          Set a subcode for the Exception.
 void setSubject(java.lang.String subject)
          Set a subject for the exception.
 void setType(char type)
          Set the type of the Exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_FATAL

public static final char TYPE_FATAL
See Also:
Constant Field Values

TYPE_TEMP

public static final char TYPE_TEMP
See Also:
Constant Field Values

WF_PARSING_ERROR

public static final int WF_PARSING_ERROR
See Also:
Constant Field Values

WF_ELEMENT_MISSING

public static final int WF_ELEMENT_MISSING
See Also:
Constant Field Values

WF_INVALID_VERSION

public static final int WF_INVALID_VERSION
See Also:
Constant Field Values

WF_INVALID_RESPONSE_REQUIRED_VALUE

public static final int WF_INVALID_RESPONSE_REQUIRED_VALUE
See Also:
Constant Field Values

WF_INVALID_KEY

public static final int WF_INVALID_KEY
See Also:
Constant Field Values

WF_INVALID_OPERATION_SPECIFICATION

public static final int WF_INVALID_OPERATION_SPECIFICATION
See Also:
Constant Field Values

WF_INVALID_REQUEST_ID

public static final int WF_INVALID_REQUEST_ID
See Also:
Constant Field Values

WF_INVALID_CONTEXT_DATA

public static final int WF_INVALID_CONTEXT_DATA
See Also:
Constant Field Values

WF_INVALID_RESULT_DATA

public static final int WF_INVALID_RESULT_DATA
See Also:
Constant Field Values

WF_INVALUD_RESULT_DATA_SET

public static final int WF_INVALUD_RESULT_DATA_SET
See Also:
Constant Field Values

WF_NO_AUTHORIZATION

public static final int WF_NO_AUTHORIZATION
See Also:
Constant Field Values

WF_OPERATION_FAILED

public static final int WF_OPERATION_FAILED
See Also:
Constant Field Values

WF_NO_ACCESS_TO_RESOURCE

public static final int WF_NO_ACCESS_TO_RESOURCE
See Also:
Constant Field Values

WF_INVALID_PROCESS_DEFINITION

public static final int WF_INVALID_PROCESS_DEFINITION
See Also:
Constant Field Values

WF_MISSING_PROCESS_INSTANCE_KEY

public static final int WF_MISSING_PROCESS_INSTANCE_KEY
See Also:
Constant Field Values

WF_INVALID_PROCESS_INSTANCE_KEY

public static final int WF_INVALID_PROCESS_INSTANCE_KEY
See Also:
Constant Field Values

WF_INVALID_STATE_TRANSITION

public static final int WF_INVALID_STATE_TRANSITION
See Also:
Constant Field Values

WF_INVALID_OBSERVER_FOR_RESOURCE

public static final int WF_INVALID_OBSERVER_FOR_RESOURCE
See Also:
Constant Field Values

WF_MISSING_NOTIFICATION_NAME

public static final int WF_MISSING_NOTIFICATION_NAME
See Also:
Constant Field Values

WF_INVALID_NOTIFICATION_NAME

public static final int WF_INVALID_NOTIFICATION_NAME
See Also:
Constant Field Values

WF_OTHER

public static final int WF_OTHER
Error code for self defined errors. If you use this code, you must set a sub code with the code of your own error.

See Also:
Constant Field Values

WF_OTHER_LISTENER_VETOED

public static final int WF_OTHER_LISTENER_VETOED
Sub code error which is returned if a listener vetoes and a request message is not performed.

See Also:
Constant Field Values
Constructor Detail

WfXMLException

public WfXMLException(int mainCode,
                      char type,
                      java.lang.String subject)
Method Detail

setMainCode

public void setMainCode(int code)
Set the main code for the exception. You can use one of the values that have been defined in the WfXML specification.

Parameters:
code - The code for this exception. All possible values are defined as static fields of this class, so you should use one of this values. If you want to define your own exceptions, use main code WF_OTHER (800) and add an arbitrary sub code.

getMainCode

public int getMainCode()
Returns the main code of the exception.

Returns:
The main code as an integer value.

setSubCode

public void setSubCode(int code)
Set a subcode for the Exception. The WfXML specification doesn't define any sub codes, so you can set your own ones here. Mind that you should use main code WF_OTHER (800) for your own exceptions.

Parameters:
code - Integer Value representing the sub code.

getSubCode

public int getSubCode()
Returns the sub code. If no sub code is defined for the message, it returns 0.

Returns:
The sub code of the message or 0 if no sub code is defined.

setType

public void setType(char type)
             throws java.lang.IllegalArgumentException
Set the type of the Exception.

Parameters:
type - The type that you want to set. Use either TYPE_FATAL or TYPE_TEMP.
Throws:
java.lang.IllegalArgumentException - if you attempt to set any other type.

getType

public char getType()
Returns the exception type. The value can be either 'F' (fatal) or 'T' (temporary).

Returns:
The message type in a one character representation. If no message type has been defined yet, the returned value will be 0.

setSubject

public void setSubject(java.lang.String subject)
Set a subject for the exception. The subject should be a one-line short decription of the exception.

Parameters:
subject - A String representing the subject that you want to set.

getSubject

public java.lang.String getSubject()
Returns the subject of the exception or null if no subject is defined.

Returns:
The subject of the exception or null.

setDescription

public void setDescription(java.lang.String description)
Add a description to the exception. This should be a several line text description, which details the subject.

Parameters:
description - A String containing the description that you want to set for this exception.

getDescription

public java.lang.String getDescription()
Returns a more detailed description for the exception.

Returns:
A String containing the description or null if no decription was set.

isValid

public boolean isValid()
Checks if the obligatory values 'main code', 'subject', and 'type' are set.

Returns:
true if the exception contains all required values, or false if one or more parts are missing.


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.