Available since version 1.1.0


This pipeline will loop it's the execution looking for a match to a clause with the final, this looping includes the process and the post process, and it will exit the loop on a match or if it reaches the maximum iterations (by default 2). If it exits because of the maximum iteration, and it has a default response configured, it will merge the default response into the final (this could overwrite repeated keys in the final) 

Properties

PropertyDescriptionDefaultTypeRequired
enable
Enable pipeline configuration for execution.truebooleanNo
stages
List of stages to be executed by the pipeline.
list of stagesYes
max_iterations
Maximum number of iterations the pipeline can perform.2integerNo
default_response
In case the maximum iterations are reached, the value to merge with the final response.nullobject or nullNo
exit_field_condition
Field of the final response where values will be checked; a JMESPath expression for path formats.
stringYes
match_any_values
If any value in this list is in the field, the pipeline will exit the loop.nullarray or nullNo
match_all_values
If all the values in this list are in the field, the pipeline will exit the loop.nullarray or nullNo
match_none_of_values
If none of the values in this list are in the field, the pipeline will exit the loop.nullarray or nullNo
stages_before_loop

Since version 2.1

 List of stages to be executed by the pipeline

[ ]

list of stagesNo
stages_after_loop

Since version 2.1

List of stages to be executed by the pipeline

[ ]

list of stagesNo

Example Usage

PIPELINE = PipelineLoop(
    enable=True,
    stages=[stage1, stage2],
    max_iterations=3,
    exit_field_condition='prime.a',
    match_any_value=[1],
    match_none_value=[5], 
    match_any_value=[2, 3], 
    default_response={'prime': {'a': 0, 'msg': 'Default message overriding part of the original'}}
	stages_before_loop=[stage0],
    stages_after_loop=[stage3],
)