Interface ISuccessResultBuilder<TBuilder,​TResult>

    • 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 the IExecutionResultDescriptor.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 the IExecutionResultDescriptor.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. See softErrors 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 be null 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. See softErrors 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 be null 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. See softErrors 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 be null when not caused by any exception.
        Returns:
        This builder for chaining methods calls.
        Since:
        7.0.7