Interface ISuccessResultBuilder<TBuilder,TResult>
-
- Type Parameters:
TBuilder
- The type of the builder returned by the various builder methods.TResult
- The type of the result being built by the builder.
- All Superinterfaces:
org.apache.commons.lang3.builder.Builder<TResult>
,ICompletionResultBuilder<TBuilder,TResult>
- All Known Subinterfaces:
INodeReturnedExceptionBuilder
,INormalCompletionResultBuilder
- All Known Implementing Classes:
NormalCompletionResultBuilder
public interface ISuccessResultBuilder<TBuilder,TResult> extends ICompletionResultBuilder<TBuilder,TResult>
Builder for the result of a node when it was executed successfully.- Since:
- 7.0.7
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> TBuilder
softError(String errorCode, Class<T> memberClass, String message, IValueCreator<T> valueCreator, Throwable cause)
Adds a soft error to the list of soft errors.default TBuilder
softError(String errorCode, String message, Object value, Throwable cause)
Adds a soft error to the list of soft errors.TBuilder
softError(String message, Throwable cause, Consumer<IUnionValueBuilder<String>> errorValue)
Adds a soft error to the list of soft errors.TBuilder
success(IValueCreator<?> successValue)
Sets (replaces) the value returned by the node when it was executed successfully.default TBuilder
success(Object value)
Sets (replaces) the value returned by the node when it was executed successfully.-
Methods inherited from interface de.xima.fc.interfaces.workflow.params.ICompletionResultBuilder
always, always, attachment, attachment, attachment, file, file, file
-
-
-
-
Method Detail
-
success
TBuilder success(IValueCreator<?> successValue)
Sets (replaces) the value returned by the node when it was executed successfully. This value is ignored unless the node was actually executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getSuccessValueDescriptor(IValueDescriptorFactory)
is used. When this method is called multiple times, only the value supplied by the last invocation is used.For example, when you wish to return a record with two properties:
// Corresponds to the JSON object {"foo": "bar", "baz": 42} builder.success(b -> b.asRecord().property("foo", "bar").property("baz", 42);
- Parameters:
successValue
- Function that takes a value builder to create the value.- Returns:
- This builder for chaining methods calls.
-
success
default TBuilder success(Object value)
Sets (replaces) the value returned by the node when it was executed successfully. This value is ignored unless the node was actually executed successfully. When this method is not called, the default value from theIExecutionResultDescriptor.getSuccessValueDescriptor(IValueDescriptorFactory)
is used. When this method is called multiple times, only the value supplied by the last invocation is used.- Parameters:
value
- Value made available by the plugin when it was executed successfully.- Returns:
- This builder for chaining methods calls.
-
softError
default <T> TBuilder softError(String errorCode, Class<T> memberClass, String message, IValueCreator<T> valueCreator, Throwable cause)
Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrors
for more details.- Parameters:
errorCode
- String with the soft error type.memberClass
- Type of the value for that soft error type.message
- Message providing more details about the error .valueCreator
- Function that takes a value builder to create the soft error value.cause
- The exception that caused the soft error. May benull
when not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
softError
default TBuilder softError(String errorCode, String message, Object value, Throwable cause)
Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrors
for more details.- Parameters:
errorCode
- String with the error type.message
- Message providing more details about the error .value
- Value with details about the error.cause
- The exception that caused the soft error. May benull
when not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
softError
TBuilder softError(String message, Throwable cause, Consumer<IUnionValueBuilder<String>> errorValue)
Adds a soft error to the list of soft errors. When a node is executed normally, it may provide one or more soft errors to indicate that some issues have occurred that were not sever enough for the node to throw an exception. SeesoftErrors
for more details.// Adds a soft error with no additional data. builder.softError("bad data", b -> b.value("FOUND_BAD_DATA", new HashMap<>()));
- Parameters:
message
- Message providing more details about the error .errorValue
- Function that takes a value builder to create the error value.cause
- The exception that caused the soft error. May benull
when not caused by any exception.- Returns:
- This builder for chaining methods calls.
- Since:
- 7.0.7
-
-