Examples
// Input Content // Output Content
Pipelines.Add(
AddOne(), // [Empty] // 0
AddOne(), // 0 // 1
AddOne(), // 1 // 2
Branch(
AddOne(), // 2 // 3
AddOne() // 3 // 4
),
AddOne(), // 2 // 3
AddOne() // 3 // 4
);
You can see that the input content to the AddOne modules after the Branch is the
same as the input content to the AddOne modules inside the branch. The result of
the modules in the Branch had no impact on those modules that run after the Branch.
This is true for both content and metadata. If any modules inside the Branch created
or changed metadata, it would be forgotten once the Branch was done.
Usage
-
Branch(IEnumerable<IModule> modules)
Evaluates the specified modules with each input document as the initial document and then outputs the original input documents without modification.
modules
The modules to execute.
-
Branch(params IModule[] modules)
Evaluates the specified modules with each input document as the initial document and then outputs the original input documents without modification.
modules
The modules to execute.
Fluent Methods
Chain these methods together after the constructor to modify behavior.
-
Where(DocumentConfig predicate)
Limits the documents passed to the child modules to those that satisfy the supplied predicate. All original input documents are output without modification regardless of whether they satisfy the predicate.
predicate
A delegate that should return a
bool
.