Interface UserActionCallBuilder

  • public interface UserActionCallBuilder
    • Method Detail

      • withParams

        UserActionCallBuilder withParams​(java.lang.Object... params)
        Sets the parameters that will be used to create the user action.

        There are two ways of using this method:

        1. Provide exactly the constructor parameters of the UserAction that is to be called. For example for the MyCustomAction has a constructor public MyCustomAction(IContext context, Integer param>) then it can be called with all those parameter, e.g. ....withParams(context, 23).
        2. Provide all except context parameter of the constructor of the UserAction that is to be called. In the above example that would mean ....withParams(23).
          Only parameters of the exact type IContext can be omitted. If one IContext parameter is omitted all parameters of that type have to be omitted.
        The second method is preferred.

        All parameters have to be specified at once, subsequent calls override earlier calls.

      • execute

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

        void executeInBackground​(IContext context,
                                 java.lang.String queueName)
        Put the user action call on a task queue. It will be executed in a different thread, and potentially on a different cluster node.
        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.
        MendixRuntimeException - if enqueueing the user action call fails, for example if the queue doesn't exist.