Class SubProcessCall

java.lang.Object
ch.ivyteam.ivy.process.call.SubProcessCall

public class SubProcessCall extends Object

Find a sub process start, map parameters, call it and get the result.

This API can also be used in Unit Tests if you annotate your test with the @IvyProcessTest annotation. However, for testing consider to use the bpmClient.start().subProcess(...) API.

See simple examples:

Call the CallSubStart in the 'Functional Processes/Customer' sub process with one parameter 'id' and get the 'name' field from the result tuple:
(Only possible if there is only one start with a parameter named 'id')

 String result = SubProcessCall.withPath("Functional Processes/Customer")
         .withParam("id", 27)
         .call()
         .get("name", String.class);
 

Same as above but without named parameters and result:
(Only possible if there is only one start with a single parameter)

 String result = SubProcessCall.withPath("Functional Processes/Customer")
         .call(27)
         .first(String.class);
 

Specify more exact which start to call by name: withStartName(String)

 String result = SubProcessCall.withPath("Functional Processes/Customer")
         .withStartName("getName")
         .withParam("id", 27)
         .call()
         .get("name", String.class);
 

Specify more exact which start to call by name and parameter types: withStart(String, Class...)

 String result = SubProcessCall.withPath("Functional Processes/Customer")
         .withStart("getName", Number.class)
         .call(27)
         .get("name", String.class);
 

Specify more exact which start to call by signature: withStartSignature(String)

 String result = SubProcessCall.withPath("Functional Processes/Customer")
         .withStartSignature("getName(Number)")
         .call(27)
         .get("name", String.class);
 
API:
This is a public API.
  • Method Details

    • withPath

      public static SubProcess withPath(String processPath)
      Find sub process by path.
      Parameters:
      processPath - the path (process groups) and name of a process. E.g. "Functional Processes/ProcessName"
      Returns:
      the selected SubProcess where to select the CallSubStart to call.
      See Also:
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • withPathOverrides

      public static SubProcess withPathOverrides(String processPath, boolean considerOverrides)
      Find sub process by path with overrides.
      Parameters:
      processPath - the path (process groups) and name of a process. E.g. "Functional Processes/ProcessName"
      considerOverrides - controls the usage of overriden sub processes.
      Returns:
      the selected SubProcess where to select the CallSubStart to call.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • withPid

      public static SubProcess withPid(String processId)
      Find sub process by process id.
       SubProcessCall.withPid("1549FEEB682EF158")
       
      Parameters:
      processId - the identifier of a process e.g.
      Returns:
      the selected SubProcess where to select the CallSubStart to call.
      API:
      This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • find

      public static List<SubProcessCallStart> find(SubProcessSearchFilter filter)
      Finds sub process starts on the basis of a filter.

      Example finds sub process starts:

       SubProcessSearchFilter filter = SubProcessSearchFilter.create()
                                                             .setProcessPath("testSub")
                                                             .setSignature("call(String)")
                                                             .toFilter();
       List<SubProcessCallStart> foundSubProcessStarts = SubProcessCall.find(filter);
       
      Parameters:
      filter - search filter
      Returns:
      a list with the found sub process starts
      API:
      This public API is available in Java.