Interface FlowableFutureJavaDelegate<Input,​Output>

  • Type Parameters:
    Input - the input of the execution
    Output - the output of the execution
    All Superinterfaces:
    All Known Subinterfaces:

    public interface FlowableFutureJavaDelegate<Input,​Output>
    extends FutureJavaDelegate<Output>
    Convenience class which always uses the AsyncTaskInvoker to execute the async data. Provides intermediate methods to prepare the execution data before executing and do the actual execution without the need to work with futures.
    Filip Hrisafov
    See Also:
    MapBasedFlowableFutureJavaDelegate, FutureJavaDelegate
    • Method Detail

      • execute

        default CompletableFuture<Output> execute​(DelegateExecution execution,
                                                  org.flowable.common.engine.api.async.AsyncTaskInvoker taskInvoker)
        Description copied from interface: FutureJavaDelegate
        Perform the execution of the delegate, potentially on another thread. The result of the future is passed in the FutureJavaDelegate.afterExecution(DelegateExecution, Object) in order to store the data on the execution on the same thread as the caller of this method. IMPORTANT: the execution should only be used to read data before creating the future. The execution should not be used in the task that will be executed on a new thread.

        The AsyncTaskInvoker is in order to schedule an execution on a different thread. However, it is also possible to use a different scheduler, or return a future not created by the given taskInvoker.

        Specified by:
        execute in interface FutureJavaDelegate<Input>
        execution - the execution that can be used to extract data
        taskInvoker - the task invoker that can be used to execute expensive operation on another thread
        the output data of the execution
      • prepareExecutionData

        Input prepareExecutionData​(DelegateExecution execution)
        Method invoked before doing the execution to extract needed that from the execution on the main thread. This should be used to prepare and extract data from the execution before doing the execution in a different thread.
        execution - the execution from which to extract data
        the data for the delegate