Threshold Checks
When a bulk file is split into multiple interacting levels of flows, it is often important to be able to determine when one level of flow completes.
For example, imaging a simple file with two top level records each containing 5 sub records. From a flow processing perspective, we may represent this as 2 "parent" flows and 10 "child flows". Here it can be important for a "parent" flow to know when all it’s "children" are completed.
For this we introduce the concept of a threshold check. It’s job is to track the interaction between parent flows and their children and determine when each has completed.
When implemented within a flow, the threshold check will track the outcomes of all children and then each time a child returns it’s result status, it will determine whether the threshold for completion has passed.
Configuration
The threshold check by default assumes that to pass it requires 100% of the child transactions to return successfully. This figure can be altered through the property:
ipf.debulker.threshold.percentage=100
Outcomes
There are four outcomes possible from the threshold check:
-
Threshold Passed - this occurs when the number of records returned successfully exceeds or equals the threshold value without any failures occurring.
-
Threshold Failed - this occurs when the number of records that returns unsuccessfully means it is no longer possible to pass the threshold value.
-
Threshold Passed With Errors - this occurs when the number of records returned successfully exceeds or equals the threshold value but errors have occurred in some of the records.
-
In Progress- the threshold check will wait for more records as it is still waiting enough results to determine an outcome.
When any of the top three outcomes occurs an equivalent event is emitted which can then be handled as normal in the flo. When the fourth outcome occurs, the flow takes no further action and awaits for the next record to return.
Using the Threshold Check
We use the threshold check just as we would a normal action, calling it within the flow will automatically cause the three events to be emitted. These will then need to be handled as per standard flow processing, for example:
For a detailed guide to using the threshold checks, see the quick-start.