Class NodeReturnedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- de.xima.fc.exceptions.AbstractXfcException
-
- de.xima.fc.exceptions.WorkflowProcessingException
-
- de.xima.fc.exceptions.AbstractAbruptCompletionException
-
- de.xima.fc.exceptions.NodeReturnedException
-
- All Implemented Interfaces:
IXfcException
,IBaseCompletionResult
,IReturningCompletionResult
,ISuccessResultData
,Serializable
public final class NodeReturnedException extends AbstractAbruptCompletionException implements IReturningCompletionResult
Indicates that an exception occurred during the execution of a workflow node.This is an extended version of the
WorkflowProcessingException
that lets you specify an error type and some data that describe the error in more detail.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeReturnedException.Builder
A simple builder for configuring aNodeReturnedException
.
-
Constructor Summary
Constructors Constructor Description NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, String message)
Deprecated.NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, String message, Throwable cause)
Deprecated.NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, Throwable cause)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NodeReturnedException.Builder
builder(WorkflowNode node)
List<NodeSoftErrorException>
getSoftErrors()
Business logic might need to distinguish between hard errors and soft errors.Object
getSuccessValue()
-
Methods inherited from class de.xima.fc.exceptions.AbstractAbruptCompletionException
getAlwaysValue, getAttachmentValue, getFileValue, getNode
-
Methods inherited from class de.xima.fc.exceptions.WorkflowProcessingException
getDefaultErrorCode, getDefaultMessageKey
-
Methods inherited from class de.xima.fc.exceptions.AbstractXfcException
getErrorCode, getExceptionData, getLocalizedMessage, getMessageKey, getMessageParams
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.execution.IBaseCompletionResult
getAlwaysValue, getAttachmentValue, getFileValue, getNode
-
-
-
-
Constructor Detail
-
NodeReturnedException
@Deprecated public NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, String message)
Deprecated.Usebuilder(WorkflowNode)
. Ideally, do not create instances directly, prefer usingINodeExecutionParams.returningException()
.Creates a new exception that should be thrown when a node wishes to return.- Parameters:
node
- The node that did return.alwaysValue
- Data always provided by the node, regardless of how it completed.successValue
- Data provided by the node when successful.fileValue
- Files provided by the node.softErrors
- Soft errors that occurred during the node's execution.message
- Message why the note returned, usually empty.
-
NodeReturnedException
@Deprecated public NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, String message, Throwable cause)
Deprecated.Usebuilder(WorkflowNode)
. Ideally, do not create instances directly, prefer usingINodeExecutionParams.returningException()
.Creates a new exception that should be thrown when a node wishes to return.- Parameters:
node
- The node that did return.alwaysValue
- Data always provided by the node, regardless of how it completed.successValue
- Data provided by the node when successful.fileValue
- Files provided by the node.softErrors
- Soft errors that occurred during the node's execution.message
- Message why the note returned, usually empty.cause
- Cause that resulted in the node returning, usuallynull
.
-
NodeReturnedException
@Deprecated public NodeReturnedException(WorkflowNode node, Object alwaysValue, Object successValue, IWorkflowFileValue fileValue, List<NodeSoftErrorException> softErrors, Throwable cause)
Deprecated.Usebuilder(WorkflowNode)
. Ideally, do not create instances directly, prefer usingINodeExecutionParams.returningException()
.Creates a new exception that should be thrown when a node wishes to return.- Parameters:
node
- The node that did return.alwaysValue
- Data always provided by the node, regardless of how it completed.successValue
- Data provided by the node when successful.fileValue
- Files provided by the node.softErrors
- Soft errors that occurred during the node's execution.cause
- Cause that resulted in the node returning, usuallynull
.
-
-
Method Detail
-
getSoftErrors
public List<NodeSoftErrorException> getSoftErrors()
Description copied from interface:ISuccessResultData
Business logic might need to distinguish between hard errors and soft errors. A hard error is anexception
that results in the workflow failing when not caught by an error handler. These are for example technical errors such as a missing database connection, or when a file cannot be read form the file system due to missing permissions.Soft errors are similar to warnings in that not all of the the business logic could be performed or that some the business logic had to be skipped. In contrast with hard errors, however, the node itself still completes normally and does not cause the workflow to fail. This method can be used to check if any soft errors occurred.
Soft errors are similar to
hard errors
in that both provide an error code, an error message, as well as custom additional data.Common examples of soft errors include missing files from optional upload form elements, or a
4xx
HTTP return code. However, the exact definition of what constitutes a soft error must be decided on a case-by-case basis by each individualnode implementation
. This method is meant to be a uniform interface for nodes to provide information about soft errors. This method can also be used to check whether a node was "successful", by checking whether the list of soft errors is empty. Implementations are encouraged to provide more details about their completion status viaISuccessResultData.getSuccessValue()
.Soft errors are purely informational. Workflow execution is not affected in any way by whether or not soft error occurred. The node still either completes normally or returns, and the next node or trigger is processed as if no soft errors were present.
@implNote This interface provides a default implementation that returns an empty list for backwards compatibility so as not to break existing implementation. However, all existing implementations are strongly advised to override and implement this method. The default implementation may be removed at some point.
- Specified by:
getSoftErrors
in interfaceISuccessResultData
- Returns:
- A list of soft errors that did occur during the execution of the workflow node.
-
getSuccessValue
public Object getSuccessValue()
- Specified by:
getSuccessValue
in interfaceISuccessResultData
- Returns:
- The value that is returned when node completed normally. Must conform to the
IExecutionResultDescriptor.getSuccessValueDescriptor(IValueDescriptorFactory)
IExecutionResultDescriptor#getSuccessValueDescriptor.
-
builder
public static NodeReturnedException.Builder builder(WorkflowNode node)
- Parameters:
node
- The node that did finish execution.- Returns:
- A new builder for a
NodeReturnedException
. - Since:
- 8.1.0
-
-