Interface MicroflowCallBuilder


  • public interface MicroflowCallBuilder
    Provides a builder for building a microflow call. The builder can be used to add arguments and eventually call the microflow.
    • Method Detail

      • withParams

        default MicroflowCallBuilder withParams​(java.util.Map<java.lang.String,​java.lang.Object> params)
        Adds multiples parameters to the microflow call.
        Parameters:
        params - the parameters to add
        Returns:
        the updated builder
      • execute

        <R> R execute​(IContext context)
        Execute the microflow call synchronously.
        Parameters:
        context - the context in which the microflow should be executed
        Returns:
        the result of the microflow call
      • executeInBackground

        void executeInBackground​(IContext context,
                                 java.lang.String queueName)
        Put the microflow call on a task queue. It will be executed in a different thread, and potentially on a different cluster node. `inTransaction` option is ignored when the microflows are called with this method.
        Parameters:
        queueName - Name of a queue. These have to exist in the model.
        context - the context that is used to schedule the background call. A sudo clone is used internally, so no permissions are taken into account. The execution will only happen when the transaction held by this context has ended / is committed to the database.
        Throws:
        MendixRuntimeException - if enqueueing the microflow call fails, for example if the queue doesn't exist.