Class SmartServiceException.Builder
java.lang.Object
com.appiancorp.suiteapi.process.exceptions.SmartServiceException.Builder
- Direct Known Subclasses:
RetryableSmartServiceException.Builder
- Enclosing class:
- SmartServiceException
The Builder inner class is used to create an instance of the SmartServiceException. Pass the class
that is throwing the SmartServiceException and the Throwable that caused the exception to the constructor, then
set the
userMessage
, then build
. See the example in the main class javadoc.-
Constructor Summary
ConstructorDescriptionConstruct aSmartServiceException.Builder
using the class that is throwing the exception, the bundle name, and the cause of the exception.Construct aSmartServiceException.Builder
using the class that is throwing the exception and the cause of the exception. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies that the message of the cause exception should be added to the list of arguments passed to the alert message.Specifies that the message of the cause exception should be added to the list of arguments passed to the user message.alertMessage
(String key, Object... args) Set the message that will be displayed in the error alert for both attended and unattended nodes.build()
After setting theuserMessage
, callbuild
to create an instance of the SmartServiceException with the message set.Set the ErrorCode for the SmartServiceException that is to be built.userMessage
(String key, Object... args) Set the message that will be displayed in the user interface for attended nodes and in the error alert for both attended and unattended nodes ifalertMessage
is not set.
-
Constructor Details
-
Builder
Construct aSmartServiceException.Builder
using the class that is throwing the exception and the cause of the exception.- Parameters:
smartServiceClass
- the class that is throwing the exceptioncause
- the Throwable that was caught, causing the SmartServiceException to be thrown
-
Builder
Construct aSmartServiceException.Builder
using the class that is throwing the exception, the bundle name, and the cause of the exception.- Parameters:
smartServiceClass
- the class that is throwing the exceptionsmartServiceBundleName
- the bundle name used to locate the i18n properties filecause
- the Throwable that was caught, causing the SmartServiceException to be thrown
-
-
Method Details
-
alertMessage
Set the message that will be displayed in the error alert for both attended and unattended nodes.- Parameters:
key
- the key to the error message in the bundleargs
- the set of parameters that are passed with the error message to include dynamic information in the message if the value of the error bundle contains templates.- See Also:
-
addCauseToAlertMessageArgs
Specifies that the message of the cause exception should be added to the list of arguments passed to the alert message. -
userMessage
Set the message that will be displayed in the user interface for attended nodes and in the error alert for both attended and unattended nodes ifalertMessage
is not set. The message is used when the smart service throws the exception.- Parameters:
key
- the key to the error message in the bundleargs
- the set of parameters that are passed with the error message to include dynamic information in the message if the value of the error bundle contains templates.
-
addCauseToUserMessageArgs
Specifies that the message of the cause exception should be added to the list of arguments passed to the user message. -
errorCode
Set the ErrorCode for the SmartServiceException that is to be built.- Parameters:
errorCode
-
-
build
After setting theuserMessage
, callbuild
to create an instance of the SmartServiceException with the message set.- Returns:
- the SmartServiceException with everything set
-