Class SubRequestBuilder


  • public class SubRequestBuilder
    extends Object
    Callable sub process request builder
    Since:
    9.2
    API:
    This is a public API.
    • Method Detail

      • as

        public SubSessionChooser as()
        Defines the session that is used to execute the request

        Example:

        
         bpmClient.start().subProcess(startElement).as().user("test").execute("Reto", 49);
         
        Returns:
        session chooser access
        API:
        This public API is available in Java.
      • http

        public SubHttpRequestBuilder http()
        Controls the request method. Per default a sub process will be executed with HTTP context. You can disable this or start a POST request instead of GET.

        Example:

        
         bpmClient.start().subProcess(startElement).http().disable().execute();
         bpmClient.start().subProcess(startElement).http().post().execute();
         
        Returns:
        http control access
        API:
        This public API is available in Java.
      • withParam

        public SubRequestBuilder withParam​(String name,
                                           Object value)

        Add input parameters for the chosen callable sub process.

        The input parameters of a callable sub process can either be provided with this method or as parameters of the execute(Object...) method. The provided value must match the parameter type. Not all input parameters have to be set.

        Example:

        
         bpmClient.start().subProcess(startElement).withParam("name", "value").execute();
         
        Parameters:
        name - name of the parameter
        value - value of the parameter. Must match input parameter type defined on signature of the sub start
        Returns:
        request builder for further request construction
        Since:
        9.2
        API:
        This public API is available in Java.
      • execute

        public ExecutionResult execute​(Object... params)

        Executes the chosen callable sub process.

        The input parameters of a callable sub process can either be provided as parameters of this method or with the withParam(String, Object) method. If input parameters are provided by parameters of the method they must match the number of input parameters and their types.

        The result parameters of the callable sub process can be get with the ExecutionResult.subResult() method.

        Example:

        
         String name = bpmClient.start().subProcess(startElement).execute("Reto", 49).subResult().firstParam();
         
        
         Number age = bpmClient.start().subProcess(startElement).withParam("name", "Reto").withParam("age", 49).execute().subResult().param("age");
         
        Parameters:
        params - input parameters of the callable sub process or empty if withParam(String, Object) is used
        Returns:
        execution result
        Since:
        9.2
        See Also:
        ExecutionResult.subResult()
        API:
        This public API is available in Java.
      • executeAndIgnoreBpmError

        public ExecutionResult executeAndIgnoreBpmError​(Object... params)

        Executes the chosen callable sub process and ignores all bpm errors. Use ExecutionResult.bpmError() to assert a bpm error that was thrown by the process. Use execute(Object...) if you don't want to ignore bpm errors.

        The input parameters of a callable sub process can either be provided as parameters of this method or with the withParam(String, Object) method. If input parameters are provided by parameters of the method they must match the number of input parameters and their types.

        The result parameters of the callable sub process can be get with the ExecutionResult.subResult() method.

        Example:

        
         String name = bpmClient.start().subProcess(startElement).executeAndIgnoreBpmError("Reto", 49).subResult().firstParam();
         
        
         Number age = bpmClient.start().subProcess(startElement).withParam("name", "Reto").withParam("age", 49).executeAndIgnoreBpmError().subResult().param("age");
         
        Parameters:
        params - input parameters of the callable sub process or empty if withParam(String, Object) is used
        Returns:
        execution result
        Since:
        9.2
        See Also:
        ExecutionResult.subResult(), ExecutionResult.bpmError(), execute(Object...)
        API:
        This public API is available in Java.