FME can now create processing loops around blocking (or group-based) transformers that would usually block the flow of features. This feature is similar to looping functionality but it operates in a very different manner.
In a standard workspace, the feature processing loop processes one feature at a time. FME's usual workflow is to take one feature from the reader, push it through transformers, and then write the result to a writer before moving on to the next input feature. Transformers can divert features along different paths, but FME will push the single feature as far down the workspace as possible before moving on to the next feature.
Workbench provides a way to develop a custom transformer that can bypass FME's natural process of transformation: the transformer loop enables FME to take a feature from one point of processing within the custom transformer and insert it into another point. This is called Looping. Until now, looping was limited to feature-based transformers only.
Some transformers can block: that is, they might hold on to some features, very often until FME finishes processing. (This will happen when a transformer's "Group By" functionality is used, for instance, because groups cannot complete until every feature has been considered.) Transformers like this are also often called "Group-Based" transformers. When these transformers hold onto a feature, FME returns to the reader to get the next feature for processing. The blocking transformer cannot generate any output until all of its input has been accumulated. Logically, this means that a blocking transformer cannot be included in a transformer loop because the loop occurs at a time when the transformer is not yet prepared to take on new features.
The Enable Blocked Looping feature overcomes this limitation.
There is only one requirement when using blocking transformers in loops: custom transformers must be external (saved and stored as an .fmx
file) and always LINKED (not embedded).
FME will also prompt you to export the custom transformer: when you place a blocking transformer in a custom transformer with a loop, or add a LOOP port to a custom transformer that contains a blocking transformer, FME displays the following message:
.fmx
file) in Workbench. In the Navigator, under Transformer Properties, set "Enable Blocked
Looping"
parameter to Yes and save the changes.
Only one LOOP is allowed when "Enable Blocked Looping" is set to Yes.
When "Blocked Looping" is enabled in a linked custom transformer, two additional parameters are exposed on the transformer: Maximum number of iterations and Attribute to hold iteration count:
These two parameters control how many times the loop is to be executed and help prevent infinite looping.
Note: Any of the INPUT/OUTPUT ports in the linked custom transformer cannot use the name "INCOMPLETE".