Subloop Helper

Subloop helper can be used to perform nested integration-flow

The subloop helper operation involves calling one or more i-flows from the first i-flow, which has various limitations such as different pagination functionality or an API with a hierarchical structure. It is also possible to separate a module of business logic into a sub-flow, thereby reducing the complexity of understanding the flow structure.

Architecture

Functionality

To trigger one i-flow inside another, we can use a subloop helper. For instance, if we need to fetch the last five days' data repeatedly, a single i-flow cannot do so because we must retrieve data page by page. Instead, we use a subloop helper to generate a list of the last five dates, pass it to the subloop i-flow, and fetch all data from the first page to the last page. The subloop helper triggers i-flows through the jobInvoker.jobSync() method, and we can store previous step data and API-required data in the RequestObject.Data property via step settings and responseFormatter of the subloop step. The RequestObject data is stored in the Configs['0'] of a new ObjectHolder in the job sync method, and a new object holder instance is created every time the subloop job is triggered. As usual, the subloop steps' request and response data are stored in the step history, and if an error occurs, it is caught in the IIF. We can trigger the subloop job once or more times, depending on the client's requirements.

Prerequisites

  • The response formatter of the step allows passing the previous step's data in all formats. To call a sub-loop flow, the step type should be chosen as SUBLOOP in the step type.

  • The sub flow's name with the exact case type should be given in the step's path where it is desired to call it.

  • If it is necessary to pass any previous step data in string format in the step settings, it can be passed both statically and dynamically.

Limitations

  • If it tries to pass any big information from the main flow it can end up in a nested exception or infinite loop. So only specific minimal information required to trigger the sub-I-flow can be passed.

  • The client should be the same for both the main I-Flow and the sub-I-Flow.

  • The Subloop I-flow’s scheduled date & time is taken from the main I-flow.

Last updated